diff options
author | Graham Linden <graham@lindenlab.com> | 2018-10-10 18:44:03 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-10-10 18:44:03 +0100 |
commit | 79d33f9d19a0c6e5ed34ffbd01a31cb2625e1ecc (patch) | |
tree | f0bbe587871419ecd36363c5c1d0def6e9166825 /indra/newview | |
parent | 4b174a31c8db1bf7f378f9b088c1335651a34ec5 (diff) |
Fix names of WATER_BLUR_MULTIPILER.
Give wave direction uniforms more meaningful names in shaders.
Add comments on glow size/focus conversions for clarity.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/waterV.glsl | 10 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl | 1 | ||||
-rw-r--r-- | indra/newview/lllegacyatmospherics.cpp | 4 | ||||
-rw-r--r-- | indra/newview/lllegacyatmospherics.h | 1 | ||||
-rw-r--r-- | indra/newview/llpaneleditsky.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llsettingsvo.cpp | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml | 46 |
7 files changed, 36 insertions, 31 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl index 9734acf005..8863869e44 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl @@ -31,8 +31,8 @@ ATTRIBUTE vec3 position; void calcAtmospherics(vec3 inPositionEye); -uniform vec2 d1; -uniform vec2 d2; +uniform vec2 waveDir1; +uniform vec2 waveDir2; uniform float time; uniform vec3 eyeVec; uniform float waterHeight; @@ -88,10 +88,10 @@ void main() calcAtmospherics(pos.xyz); //pass wave parameters to pixel shader - vec2 bigWave = (v.xy) * vec2(0.04,0.04) + d1 * time * 0.055; + vec2 bigWave = (v.xy) * vec2(0.04,0.04) + waveDir1 * time * 0.055; //get two normal map (detail map) texture coordinates - littleWave.xy = (v.xy) * vec2(0.45, 0.9) + d2 * time * 0.13; - littleWave.zw = (v.xy) * vec2(0.1, 0.2) + d1 * time * 0.1; + littleWave.xy = (v.xy) * vec2(0.45, 0.9) + waveDir2 * time * 0.13; + littleWave.zw = (v.xy) * vec2(0.1, 0.2) + waveDir1 * time * 0.1; view.w = bigWave.y; refCoord.w = bigWave.x; diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl index e918bdcb9d..20280ab1c5 100644 --- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl @@ -47,7 +47,6 @@ uniform float kd; uniform vec4 waterPlane; uniform vec3 eyeVec; uniform vec4 waterFogColor; -uniform float waterFogDensity; uniform float waterFogKS; uniform vec2 screenRes; diff --git a/indra/newview/lllegacyatmospherics.cpp b/indra/newview/lllegacyatmospherics.cpp index 0c4e5b48e8..371bd1b7c2 100644 --- a/indra/newview/lllegacyatmospherics.cpp +++ b/indra/newview/lllegacyatmospherics.cpp @@ -264,6 +264,7 @@ void LLAtmospherics::calcSkyColorWLVert(LLVector3 & Pn, AtmosphericsVars& vars) F32 haze_horizon = vars.haze_horizon; F32 haze_density = vars.haze_density; F32 density_multiplier = vars.density_multiplier; + //F32 distance_multiplier = vars.distance_multiplier; F32 max_y = vars.max_y; LLVector4 sun_norm = vars.sun_norm; @@ -323,7 +324,7 @@ void LLAtmospherics::calcSkyColorWLVert(LLVector3 & Pn, AtmosphericsVars& vars) temp2.mV[2] = Plen * density_multiplier; // Transparency (-> temp1) - temp1 = componentExp((temp1 * -1.f) * temp2.mV[2]); + temp1 = componentExp((temp1 * -1.f) * temp2.mV[2]);// * distance_multiplier); // Compute haze glow @@ -510,6 +511,7 @@ void LLAtmospherics::updateFog(const F32 distance, const LLVector3& tosun_in) vars.haze_density = psky->getHazeDensity(); vars.haze_horizon = psky->getHazeHorizon(); vars.density_multiplier = psky->getDensityMultiplier(); + vars.distance_multiplier = psky->getDistanceMultiplier(); vars.max_y = psky->getMaxY(); vars.sun_norm = LLEnvironment::instance().getClampedSunNorm(); vars.sunlight = psky->getSunlightColor(); diff --git a/indra/newview/lllegacyatmospherics.h b/indra/newview/lllegacyatmospherics.h index 1979e93cdd..76b1a0f313 100644 --- a/indra/newview/lllegacyatmospherics.h +++ b/indra/newview/lllegacyatmospherics.h @@ -218,6 +218,7 @@ public: F32 haze_density; F32 haze_horizon; F32 density_multiplier; + F32 distance_multiplier; F32 max_y; LLVector4 sun_norm; LLColor3 sunlight; diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index 1ae220a5ca..6d9f016aba 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -481,8 +481,10 @@ void LLPanelSettingsSkySunMoonTab::refresh() LLColor3 glow(mSkySettings->getGlow()); + // takes 40 - 0.2 range -> 0 - 1.99 UI range getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->setValue(2.0 - (glow.mV[0] / SLIDER_SCALE_GLOW_R)); getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->setValue(glow.mV[2] / SLIDER_SCALE_GLOW_B); + getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->setValue(mSkySettings->getStarBrightness()); getChild<LLVirtualTrackball>(FIELD_SKY_SUN_ROTATION)->setRotation(mSkySettings->getSunRotation()); getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setValue(mSkySettings->getSunTextureId()); @@ -509,6 +511,7 @@ void LLPanelSettingsSkySunMoonTab::onGlowChanged() { LLColor3 glow(getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->getValue().asReal(), 0.0f, getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->getValue().asReal()); + // takes 0 - 1.99 UI range -> 40 -> 0.2 range glow.mV[0] = (2.0f - glow.mV[0]) * SLIDER_SCALE_GLOW_R; glow.mV[2] *= SLIDER_SCALE_GLOW_B; diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 17384a3a6b..8e55ae395a 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -791,7 +791,7 @@ LLSD LLSettingsVOWater::convertToLegacy(const LLSettingsWater::ptr_t &pwater) LLSD legacy(LLSD::emptyMap()); LLSD settings = pwater->getSettings(); - legacy[SETTING_LEGACY_BLUR_MULTIPILER] = settings[SETTING_BLUR_MULTIPILER]; + legacy[SETTING_LEGACY_BLUR_MULTIPLIER] = settings[SETTING_BLUR_MULTIPLIER]; legacy[SETTING_LEGACY_FOG_COLOR] = ensure_array_4(settings[SETTING_FOG_COLOR], 1.0f); legacy[SETTING_LEGACY_FOG_DENSITY] = settings[SETTING_FOG_DENSITY]; legacy[SETTING_LEGACY_FOG_MOD] = settings[SETTING_FOG_MOD]; diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml index 1332ecd965..371ecd74bd 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml @@ -176,29 +176,6 @@ top_delta="15" width="250" can_edit_text="true"/> - <text - follows="left|top" - height="10" - layout="topleft" - left_delta="-5" - top_delta="22" - width="200"> - Moon Brightness: - </text> - <slider - decimal_digits="2" - follows="left|top" - height="16" - increment="0.01" - initial_value="0" - layout="topleft" - left_delta="5" - min_val="0.0" - max_val="1.0" - name="moon_brightness" - top_delta="15" - width="250" - can_edit_text="true"/> </layout_panel> <layout_panel border="false" @@ -287,6 +264,29 @@ top_delta="15" width="130" can_edit_text="true"/> + <text + follows="left|top" + height="10" + layout="topleft" + left_delta="-5" + top_delta="22" + width="200"> + Brightness: + </text> + <slider + decimal_digits="2" + follows="left|top" + height="16" + increment="0.01" + initial_value="0" + layout="topleft" + left_delta="5" + min_val="0.0" + max_val="1.0" + name="moon_brightness" + top_delta="15" + width="250" + can_edit_text="true"/> </layout_panel> </layout_stack> </layout_panel> |