From 5b874db7c0568373a4132f933894d2733bd08ee2 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 19 Jul 2018 20:46:37 +0100 Subject: Modify deferred sun disc and moon shaders to write all deferrred gbuffer channels and fix rendering issue from norm/spec channels during lighting. --- indra/newview/app_settings/shaders/class1/deferred/moonF.glsl | 8 +++++--- .../newview/app_settings/shaders/class1/deferred/sunDiscF.glsl | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'indra/newview/app_settings') 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); } -- cgit v1.2.3