summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/moonF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl10
2 files changed, 11 insertions, 7 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
index 6562b86aaf..2bfc4f3d2f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
@@ -28,9 +28,9 @@
/*[EXTRA_CODE_HERE]*/
#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 frag_color;
+out vec4 frag_data[3];
#else
-#define frag_color gl_FragColor
+#define frag_data gl_FragData
#endif
vec3 fullbrightAtmosTransport(vec3 light);
@@ -59,6 +59,8 @@ void main()
// and shows true moon color at night
vec3 luma_weights = vec3(0.1, 0.3, 0.0);
float mix = 1.0f - dot(sunlight_color.rgb, luma_weights);
- frag_color = vec4(c.rgb, mix * c.a);
+ frag_data[0] = vec4(c.rgb, mix * c.a);
+ frag_data[1] = vec4(0.0);
+ frag_data[2] = vec4(0.0f);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl
index d2e3be2720..bbc5049f1c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl
@@ -28,9 +28,9 @@
/*[EXTRA_CODE_HERE]*/
#ifdef DEFINE_GL_FRAGCOLOR
-out vec4 frag_color;
+out vec4 frag_data[3];
#else
-#define frag_color gl_FragColor
+#define frag_data gl_FragData
#endif
vec3 fullbrightAtmosTransport(vec3 light);
@@ -46,10 +46,12 @@ void main()
vec4 sunDiscA = texture2D(diffuseMap, vary_texcoord0.xy);
vec4 sunDiscB = texture2D(altDiffuseMap, vary_texcoord0.xy);
vec4 c = mix(sunDiscB, sunDiscA, blend_factor);
-
+ c.rgb = clamp(c.rgb, vec3(0), vec3(1));
c.rgb = pow(c.rgb, vec3(0.7f));
c.rgb = fullbrightAtmosTransport(c.rgb);
c.rgb = fullbrightScaleSoftClip(c.rgb);
- frag_color = c;
+ frag_data[0] = c;
+ frag_data[1] = vec4(0.0f);
+ frag_data[2] = vec4(0.0, 1.0, 0.0, 1.0);
}