diff options
author | Graham Linden <graham@lindenlab.com> | 2018-06-11 17:46:16 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-06-11 17:46:16 +0100 |
commit | a0598b12656cdcf22ba95cacd01b5ff36f8f1b26 (patch) | |
tree | 3ea09c4043c27998ac26181d80c4d41f8ef87f35 /indra/newview/app_settings/shaders/class1/windlight | |
parent | 507c4921826e73635f6ae31087ab0e6cd1280f43 (diff) |
Fix water fog consolidation in underwater shaders.
Add plumbing facilities to allow current and next moon textures to be passed to moon shader.
Modify moon shader to blend between current and next moon textures by blend factor.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/windlight')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/windlight/moonF.glsl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl b/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl index 14b08b1da4..4d0d8882b9 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl @@ -41,18 +41,23 @@ uniform vec4 sunlight_color; uniform vec3 lumWeights; uniform float minLuminance; uniform sampler2D diffuseMap; +uniform sampler2D altDiffuseMap; +uniform float blend_factor; // interp factor between moon A/B VARYING vec2 vary_texcoord0; void main() { - vec4 c = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 moonA = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 moonB = texture2D(altDiffuseMap, vary_texcoord0.xy); + vec4 c = mix(moonA, moonB, blend_factor); + c.rgb = fullbrightAtmosTransport(c.rgb); c.rgb = fullbrightScaleSoftClip(c.rgb); c.rgb = pow(c.rgb, vec3(0.45f)); // mix factor which blends when sunlight is brighter // and shows true moon color at night float mix = dot(normalize(sunlight_color.rgb), lumWeights); - mix = smoothstep(-0.5f, 2.0f, lum); + mix = smoothstep(-0.5f, 2.0f, mix); frag_color = vec4(c.rgb, mix * c.a); } |