summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-07-19 20:46:37 +0100
committerGraham Linden <graham@lindenlab.com>2018-07-19 20:46:37 +0100
commit5b874db7c0568373a4132f933894d2733bd08ee2 (patch)
tree054ccbd72cb0cd0a07fd393a292f97fd0c062de1 /indra
parent1abea33b7012b6b00502620dab92cc39eacb1d50 (diff)
Modify deferred sun disc and moon shaders to write all deferrred gbuffer channels
and fix rendering issue from norm/spec channels during lighting.
Diffstat (limited to 'indra')
-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);
}