diff options
Diffstat (limited to 'indra')
17 files changed, 97 insertions, 62 deletions
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index a7b87c4d96..9211a48a8e 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -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; } diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index cfab6b7fc8..ee8c445afb 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -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 ) - { - image = mBgImageDisabled; - } - else if ( has_focus || mShowImageFocused) + F32 alpha = getCurrentTransparency(); + if (mUseBgColor) { - image = mBgImageFocused; + gl_rect_2d(getLocalRect(), mBgColor % alpha, TRUE); } else { - image = mBgImage; - } - - if (!image) return; - - F32 alpha = getCurrentTransparency(); + bool has_focus = hasFocus(); + LLUIImage* image; + if (mReadOnly) + { + image = mBgImageDisabled; + } + else if (has_focus || mShowImageFocused) + { + image = mBgImageFocused; + } + else + { + image = mBgImage; + } - // 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() diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 287837a15c..a711ccefab 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -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; diff --git a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl index d964ce8eee..e257b668c8 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl @@ -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); diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 3364d5b5fc..57916eb3e5 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -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; diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index 55410c1ed7..f8264d971c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -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; diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index b546519a7d..d09bc25334 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -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; diff --git a/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl b/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl index 947c301110..c8bbdd109d 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl @@ -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; diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index f817817f37..9e14c03a96 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -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; diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 510d1ca9fd..93b55ab9c1 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -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; diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl index dec9afcfb7..abb6a3a5d8 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl @@ -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; diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl index 6a813cac15..afc542b8bc 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl @@ -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; diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index b343c913e5..cda1137182 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -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); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 85bc1ba845..16fca58f8c 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -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()) { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2a7cac3eda..b8c8a42125 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -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); } diff --git a/indra/newview/skins/default/xui/en/panel_region_environment.xml b/indra/newview/skins/default/xui/en/panel_region_environment.xml index bac27f7457..4d4ee7d730 100644 --- a/indra/newview/skins/default/xui/en/panel_region_environment.xml +++ b/indra/newview/skins/default/xui/en/panel_region_environment.xml @@ -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> diff --git a/indra/newview/skins/default/xui/en/widgets/line_editor.xml b/indra/newview/skins/default/xui/en/widgets/line_editor.xml index a054960bf8..f39e086196 100644 --- a/indra/newview/skins/default/xui/en/widgets/line_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/line_editor.xml @@ -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" |