Geenz 2019-03-29 09:32:24 -07:00
commit 4e86079008
17 changed files with 97 additions and 62 deletions

View File

@ -1295,9 +1295,15 @@ void LLSettingsSky::calculateLightSettings() const
mSunDiffuse = gammaCorrect(componentMult(sunlight, light_transmittance));
mSunAmbient = gammaCorrect(componentMult(tmpAmbient, light_transmittance) * 0.5);
LLColor3 moonlight(0.75, 0.75, 0.92);
mMoonDiffuse = gammaCorrect(componentMult(moonlight, light_transmittance) * 0.25f);
mMoonAmbient = gammaCorrect(componentMult(moonlight, light_transmittance) * 0.125f);
F32 moon_brightness = getMoonBrightness();
LLColor3 moonlight_a(0.66, 0.66, 0.66);
LLColor3 moonlight_b(0.66, 0.66, 1.0);
LLColor3 moonlight = lerp(moonlight_b, moonlight_a, moon_brightness);
mMoonDiffuse = gammaCorrect(componentMult(moonlight, light_transmittance) * moon_brightness * 0.25f);
mMoonAmbient = gammaCorrect(componentMult(moonlight_b, light_transmittance) * 0.0125f);
mTotalAmbient = mSunAmbient;
}

View File

@ -96,6 +96,8 @@ LLLineEditor::Params::Params()
ignore_tab("ignore_tab", true),
is_password("is_password", false),
cursor_color("cursor_color"),
use_bg_color("use_bg_color", false),
bg_color("bg_color"),
text_color("text_color"),
text_readonly_color("text_readonly_color"),
text_tentative_color("text_tentative_color"),
@ -150,10 +152,12 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)
mBgImageDisabled( p.background_image_disabled ),
mBgImageFocused( p.background_image_focused ),
mShowImageFocused( p.bg_image_always_focused ),
mUseBgColor(p.use_bg_color),
mHaveHistory(FALSE),
mReplaceNewlinesWithSpaces( TRUE ),
mLabel(p.label),
mCursorColor(p.cursor_color()),
mBgColor(p.bg_color()),
mFgColor(p.text_color()),
mReadOnlyFgColor(p.text_readonly_color()),
mTentativeFgColor(p.text_tentative_color()),
@ -1681,37 +1685,42 @@ void LLLineEditor::doDelete()
void LLLineEditor::drawBackground()
{
bool has_focus = hasFocus();
LLUIImage* image;
if ( mReadOnly )
F32 alpha = getCurrentTransparency();
if (mUseBgColor)
{
image = mBgImageDisabled;
}
else if ( has_focus || mShowImageFocused)
{
image = mBgImageFocused;
gl_rect_2d(getLocalRect(), mBgColor % alpha, TRUE);
}
else
{
image = mBgImage;
}
bool has_focus = hasFocus();
LLUIImage* image;
if (mReadOnly)
{
image = mBgImageDisabled;
}
else if (has_focus || mShowImageFocused)
{
image = mBgImageFocused;
}
else
{
image = mBgImage;
}
if (!image) return;
F32 alpha = getCurrentTransparency();
// optionally draw programmatic border
if (has_focus)
{
LLColor4 tmp_color = gFocusMgr.getFocusColor();
if (!image) return;
// optionally draw programmatic border
if (has_focus)
{
LLColor4 tmp_color = gFocusMgr.getFocusColor();
tmp_color.setAlpha(alpha);
image->drawBorder(0, 0, getRect().getWidth(), getRect().getHeight(),
tmp_color,
gFocusMgr.getFocusFlashWidth());
}
LLColor4 tmp_color = UI_VERTEX_COLOR;
tmp_color.setAlpha(alpha);
image->drawBorder(0, 0, getRect().getWidth(), getRect().getHeight(),
tmp_color,
gFocusMgr.getFocusFlashWidth());
image->draw(getLocalRect(), tmp_color);
}
LLColor4 tmp_color = UI_VERTEX_COLOR;
tmp_color.setAlpha(alpha);
image->draw(getLocalRect(), tmp_color);
}
void LLLineEditor::draw()

View File

@ -91,10 +91,12 @@ public:
commit_on_focus_lost,
ignore_tab,
bg_image_always_focused,
is_password;
is_password,
use_bg_color;
// colors
Optional<LLUIColor> cursor_color,
bg_color,
text_color,
text_readonly_color,
text_tentative_color,
@ -365,6 +367,7 @@ protected:
LLTimer mTripleClickTimer;
LLUIColor mCursorColor;
LLUIColor mBgColor;
LLUIColor mFgColor;
LLUIColor mReadOnlyFgColor;
LLUIColor mTentativeFgColor;
@ -385,6 +388,8 @@ protected:
BOOL mShowImageFocused;
bool mUseBgColor;
LLWString mPreeditWString;
LLWString mPreeditOverwrittenWString;
std::vector<S32> mPreeditPositions;

View File

@ -52,7 +52,7 @@ void main()
// mix factor which blends when sunlight is brighter
// and shows true moon color at night
vec3 luma_weights = vec3(0.2, 0.3, 0.2);
vec3 luma_weights = vec3(0.3, 0.5, 0.3);
float mix = 1.0 - dot(normalize(sunlight_color.rgb), luma_weights);

View File

@ -158,7 +158,7 @@ void main()
proj_tc.xyz /= proj_tc.w;
float fa = (falloff * 0.5)+1.0;
float fa = falloff+1.0;
float dist_atten = min(1.0-(dist-1.0*(1.0-fa))/fa, 1.0);
dist_atten *= dist_atten;
dist_atten *= 2.0;

View File

@ -89,7 +89,7 @@ void main()
float noise = texture2D(noiseMap, frag.xy/128.0).b;
vec3 col = texture2DRect(diffuseRect, frag.xy).rgb;
float fa = (falloff * 0.5)+1.0;
float fa = falloff+1.0;
float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0);
dist_atten *= dist_atten;
dist_atten *= 2.0;

View File

@ -155,7 +155,7 @@ void main()
proj_tc.xyz /= proj_tc.w;
float fa = (falloff * 0.5)+1.0;
float fa = falloff+1.0;
float dist_atten = min(1.0-(dist-1.0*(1.0-fa))/fa, 1.0);
dist_atten *= dist_atten;
dist_atten *= 2.0;

View File

@ -52,7 +52,7 @@ void main()
// mix factor which blends when sunlight is brighter
// and shows true moon color at night
vec3 luma_weights = vec3(0.2, 0.3, 0.2);
vec3 luma_weights = vec3(0.3, 0.5, 0.3);
float mix = 1.0f - dot(normalize(sunlight_color.rgb), luma_weights);
vec3 exp = vec3(1.0 - mix * moon_brightness) * 2.0 - 1.0;

View File

@ -156,8 +156,8 @@ void main()
{
vec4 shd = texture2DRect(lightMap, frag.xy);
shadow = (proj_shadow_idx==0)?shd.b:shd.a;
shadow = clamp(shadow, 0.0, 1.0);
shadow += shadow_fade;
shadow = clamp(shadow, 0.0, 1.0);
}
vec3 norm = texture2DRect(normalMap, frag.xy).xyz;
@ -177,7 +177,7 @@ void main()
proj_tc.xyz /= proj_tc.w;
float fa = (falloff * 0.5)+1.0;
float fa = falloff+1.0;
float dist_atten = min(1.0-(dist-1.0*(1.0-fa))/fa, 1.0);
dist_atten *= dist_atten;
dist_atten *= 2.0;

View File

@ -156,8 +156,8 @@ void main()
{
vec4 shd = texture2DRect(lightMap, frag.xy);
shadow = (proj_shadow_idx == 0) ? shd.b : shd.a;
shadow = clamp(shadow, 0.0, 1.0);
shadow += shadow_fade;
shadow = clamp(shadow, 0.0, 1.0);
}
vec3 norm = texture2DRect(normalMap, frag.xy).xyz;
@ -175,7 +175,7 @@ void main()
proj_tc.xyz /= proj_tc.w;
float fa = (falloff * 0.5) + 1.0;
float fa = falloff + 1.0;
float dist_atten = min(1.0 - (dist - 1.0 * (1.0 - fa)) / fa, 1.0);
dist_atten *= dist_atten;
dist_atten *= 2.0;

View File

@ -157,8 +157,8 @@ void main()
{
vec4 shd = texture2DRect(lightMap, frag.xy);
shadow = (proj_shadow_idx == 0) ? shd.b : shd.a;
shadow = clamp(shadow, 0.0, 1.0);
shadow += shadow_fade;
shadow = clamp(shadow, 0.0, 1.0);
}
vec3 norm = texture2DRect(normalMap, frag.xy).xyz;

View File

@ -157,8 +157,8 @@ void main()
{
vec4 shd = texture2DRect(lightMap, frag.xy);
shadow = (proj_shadow_idx == 0) ? shd.b : shd.a;
shadow = clamp(shadow, 0.0, 1.0);
shadow += shadow_fade;
shadow = clamp(shadow, 0.0, 1.0);
}
vec3 norm = texture2DRect(normalMap, frag.xy).xyz;

View File

@ -191,6 +191,8 @@ BOOL LLPanelEnvironmentInfo::postBuild()
{
drop_target->setPanel(this, alt_sliders[idx]);
}
// set initial values to prevent [ALTITUDE] from displaying
updateAltLabel(alt_prefixes[idx], idx + 2, idx * 1000);
}
getChild<LLSettingsDropTarget>("sdt_" + alt_prefixes[3])->setPanel(this, alt_prefixes[3]);
getChild<LLSettingsDropTarget>("sdt_" + alt_prefixes[4])->setPanel(this, alt_prefixes[4]);
@ -686,30 +688,36 @@ void LLPanelEnvironmentInfo::readjustAltLabels()
void LLPanelEnvironmentInfo::onSldDayLengthChanged(F32 value)
{
F32Hours daylength(value);
if (mCurrentEnvironment)
{
F32Hours daylength(value);
mCurrentEnvironment->mDayLength = daylength;
setDirtyFlag(DIRTY_FLAG_DAYLENGTH);
mCurrentEnvironment->mDayLength = daylength;
setDirtyFlag(DIRTY_FLAG_DAYLENGTH);
udpateApparentTimeOfDay();
udpateApparentTimeOfDay();
}
}
void LLPanelEnvironmentInfo::onSldDayOffsetChanged(F32 value)
{
F32Hours dayoffset(value);
if (mCurrentEnvironment)
{
F32Hours dayoffset(value);
if (dayoffset.value() <= 0.0f)
dayoffset += F32Hours(24.0);
if (dayoffset.value() <= 0.0f)
dayoffset += F32Hours(24.0);
mCurrentEnvironment->mDayOffset = dayoffset;
setDirtyFlag(DIRTY_FLAG_DAYOFFSET);
mCurrentEnvironment->mDayOffset = dayoffset;
setDirtyFlag(DIRTY_FLAG_DAYOFFSET);
udpateApparentTimeOfDay();
udpateApparentTimeOfDay();
}
}
void LLPanelEnvironmentInfo::onDayLenOffsetMouseUp()
{
if (getDirtyFlag() & (DIRTY_FLAG_DAYLENGTH | DIRTY_FLAG_DAYOFFSET))
if (mCurrentEnvironment && (getDirtyFlag() & (DIRTY_FLAG_DAYLENGTH | DIRTY_FLAG_DAYOFFSET)))
{
clearDirtyFlag(DIRTY_FLAG_DAYOFFSET);
clearDirtyFlag(DIRTY_FLAG_DAYLENGTH);

View File

@ -3291,18 +3291,14 @@ void LLVOVolume::updateSpotLightPriority()
F32 r = getLightRadius();
LLVector3 pos = mDrawable->getPositionAgent();
#if OLD_SPOT_PRIO_CALC
LLVector3 at(0,0,-1);
at *= getRenderRotation();
pos += at * r;
at = LLViewerCamera::getInstance()->getAtAxis();
pos -= at * r;
mSpotLightPriority = gPipeline.calcPixelArea(pos, LLVector3(r,r,r), *LLViewerCamera::getInstance());
#else
mSpotLightPriority = (gAgent.getPositionAgent() - pos).length() + r;
#endif
if (mLightTexture.notNull())
{

View File

@ -8703,7 +8703,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
LLVector4a center;
center.load3(drawablep->getPositionAgent().mV);
const F32* c = center.getF32ptr();
F32 s = volume->getLightRadius();
F32 s = volume->getLightRadius()*1.5f;
LLColor3 col = volume->getLightsRGBColor();
@ -8746,7 +8746,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
gDeferredLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, c);
gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s);
gDeferredLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff());
gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f);
gGL.syncMatrices();
mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, center));
@ -8766,7 +8766,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
mat.mult_matrix_vec(tc);
fullscreen_lights.push_back(LLVector4(tc.v[0], tc.v[1], tc.v[2], s));
light_colors.push_back(LLVector4(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()));
light_colors.push_back(LLVector4(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f));
}
}
unbindDeferredShader(gDeferredLightProgram);
@ -8791,7 +8791,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
LLVector4a center;
center.load3(drawablep->getPositionAgent().mV);
const F32* c = center.getF32ptr();
F32 s = volume->getLightRadius();
F32 s = volume->getLightRadius()*1.5f;
sVisibleLightCount++;
@ -8805,7 +8805,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
gDeferredSpotLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, c);
gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s);
gDeferredSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff());
gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f);
gGL.syncMatrices();
mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, center));
@ -8879,7 +8879,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
LLVector3 center = drawablep->getPositionAgent();
F32* c = center.mV;
F32 s = volume->getLightRadius();
F32 s = volume->getLightRadius()*1.5f;
sVisibleLightCount++;
@ -8893,7 +8893,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::LIGHT_CENTER, 1, tc.v);
gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s);
gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff());
gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff()*0.5f);
mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3);
}

View File

@ -253,6 +253,8 @@
height="20"
layout="topleft"
name="edt_invname_alt1"
use_bg_color="true"
bg_color="TextBgReadOnlyColor"
width="155">
Unknown
</line_editor>
@ -297,6 +299,8 @@
height="20"
layout="topleft"
name="edt_invname_alt2"
use_bg_color="true"
bg_color="TextBgReadOnlyColor"
width="155">
Unknown
</line_editor>
@ -342,6 +346,8 @@
height="20"
layout="topleft"
name="edt_invname_alt3"
use_bg_color="true"
bg_color="TextBgReadOnlyColor"
width="155">
Unknown
</line_editor>
@ -460,6 +466,8 @@
height="20"
layout="topleft"
name="edt_invname_ground"
use_bg_color="true"
bg_color="TextBgReadOnlyColor"
width="155">
Unknown
</line_editor>
@ -514,6 +522,8 @@
height="20"
layout="topleft"
name="edt_invname_water"
use_bg_color="true"
bg_color="TextBgReadOnlyColor"
width="155">
Unknown
</line_editor>

View File

@ -6,6 +6,7 @@
commit_on_focus_lost="true"
ignore_tab="true"
cursor_color="TextCursorColor"
bg_color="White"
text_color="TextFgColor"
text_pad_left="2"
text_readonly_color="TextFgReadOnlyColor"