diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/moonF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/moonF.glsl | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl index 41dd485fae..fabc61eb5e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl @@ -27,11 +27,7 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; -#else -#define frag_data gl_FragData -#endif +out vec4 frag_data[4]; uniform vec4 color; uniform vec3 moonlight_color; @@ -39,12 +35,7 @@ uniform vec3 moon_dir; uniform float moon_brightness; uniform sampler2D diffuseMap; -VARYING vec2 vary_texcoord0; - -vec3 srgb_to_linear(vec3 c); - -/// Soft clips the light with a gamma correction -vec3 scaleSoftClip(vec3 light); +in vec2 vary_texcoord0; void main() { @@ -53,24 +44,25 @@ void main() if( moon_dir.z > 0 ) fade = clamp( moon_dir.z*moon_dir.z*4.0, 0.0, 1.0 ); - vec4 c = texture2D(diffuseMap, vary_texcoord0.xy); + vec4 c = texture(diffuseMap, vary_texcoord0.xy); // SL-14113 Don't write to depth; prevent moon's quad from hiding stars which should be visible // Moon texture has transparent pixels <0x55,0x55,0x55,0x00> if (c.a <= 2./255.) // 0.00784 + { discard; + } -// c.rgb = srgb_to_linear(c.rgb); - c.rgb *= moonlight_color.rgb; - c.rgb *= moon_brightness; - c.rgb *= fade; - c.a *= fade; + c.rgb *= moonlight_color.rgb; + c.rgb *= moon_brightness; - c.rgb = scaleSoftClip(c.rgb); + c.rgb *= fade; + c.a *= fade; - frag_data[0] = vec4(c.rgb, c.a); + frag_data[0] = vec4(0); frag_data[1] = vec4(0.0); frag_data[2] = vec4(0.0, 0.0, 0.0, GBUFFER_FLAG_HAS_ATMOS); + frag_data[3] = vec4(c.rgb, c.a); } |