From b2d8d63890e3ba0a5fe303f8e2de7358e4f9fc23 Mon Sep 17 00:00:00 2001 From: "Graham Linden graham@lindenlab.com" Date: Fri, 9 Mar 2018 20:59:18 +0000 Subject: Fix warnings from shaders and include EXTRA_CODE_HERE sentinel in places using DEFINE_GL_FRAGCOLOR for consistency. --- .../newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl index b0db9876d3..30e560450b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ - +/*[EXTRA_CODE_HERE]*/ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -- cgit v1.2.3 From 423fa1ac297e39c9395f45490278b8751188b6db Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 7 Mar 2019 10:56:26 -0800 Subject: SL-10618, SL-10698 Fix reflection/distortion map culling planes again. Fix broken handling of shadow disables in ALM forward shaders. --- .../app_settings/shaders/class1/deferred/fullbrightShinyF.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl index 30e560450b..4005d5064d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl @@ -31,7 +31,7 @@ out vec4 frag_color; #define frag_color gl_FragColor #endif -#ifndef diffuseLookup +#ifndef HAS_DIFFUSE_LOOKUP uniform sampler2D diffuseMap; #endif @@ -46,7 +46,7 @@ vec3 fullbrightScaleSoftClip(vec3 light); void main() { -#if HAS_DIFFUSE_LOOKUP +#ifdef HAS_DIFFUSE_LOOKUP vec4 color = diffuseLookup(vary_texcoord0.xy); #else vec4 color = texture2D(diffuseMap, vary_texcoord0.xy); -- cgit v1.2.3 From d32821ea5bf17c4de47b9ee03b43a20ae278dfe4 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Fri, 6 Mar 2020 17:20:46 -0800 Subject: SL-12574 Fix EEP cubemap not matching non-EEP for both ALM on and off --- .../newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl index 4005d5064d..523e7f9e04 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl @@ -56,7 +56,7 @@ void main() color.rgb *= vertex_color.rgb; vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a*0.75); // MAGIC NUMBER SL-12574; ALM: Off, Quality > Low color.rgb = pow(color.rgb,vec3(2.2f,2.2f,2.2f)); -- cgit v1.2.3 From 3e472948db34e8efc905b5b50249f4587ba1507f Mon Sep 17 00:00:00 2001 From: Runitai Linden Date: Fri, 20 Mar 2020 16:50:37 -0500 Subject: WIP - Make EEP match production. --- .../app_settings/shaders/class1/deferred/fullbrightShinyF.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl index 523e7f9e04..af903eeda8 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl @@ -51,12 +51,12 @@ void main() #else vec4 color = texture2D(diffuseMap, vary_texcoord0.xy); #endif - + color.rgb *= vertex_color.rgb; vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a*0.75); // MAGIC NUMBER SL-12574; ALM: Off, Quality > Low + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); color.rgb = pow(color.rgb,vec3(2.2f,2.2f,2.2f)); -- cgit v1.2.3 From 3d22273726ab4d40f2eb9afc5ceeac37471a9dfa Mon Sep 17 00:00:00 2001 From: Runitai Linden Date: Tue, 24 Mar 2020 11:22:01 -0500 Subject: Fix for bad fullbright shiny shininess values and inconsistency between materialF and fullbrightShinyF --- .../shaders/class1/deferred/fullbrightShinyF.glsl | 26 +++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl index af903eeda8..bd0ad3bce8 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl @@ -38,12 +38,20 @@ uniform sampler2D diffuseMap; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; VARYING vec3 vary_texcoord1; +VARYING vec4 vary_position; uniform samplerCube environmentMap; vec3 fullbrightShinyAtmosTransport(vec3 light); +vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten); vec3 fullbrightScaleSoftClip(vec3 light); +void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten, bool use_ao); + +vec3 linear_to_srgb(vec3 c); +vec3 srgb_to_linear(vec3 c); + + void main() { #ifdef HAS_DIFFUSE_LOOKUP @@ -52,20 +60,28 @@ void main() vec4 color = texture2D(diffuseMap, vary_texcoord0.xy); #endif - color.rgb *= vertex_color.rgb; + vec3 pos = vary_position.xyz/vary_position.w; + + vec3 sunlit; + vec3 amblit; + vec3 additive; + vec3 atten; + + calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false); vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); + float env_intensity = vertex_color.a; + color.rgb = mix(color.rgb, envColor.rgb, env_intensity); - color.rgb = pow(color.rgb,vec3(2.2f,2.2f,2.2f)); + //color.rgb = srgb_to_linear(color.rgb); - color.rgb = fullbrightShinyAtmosTransport(color.rgb); + color.rgb = fullbrightAtmosTransportFrag(color.rgb, additive, atten); color.rgb = fullbrightScaleSoftClip(color.rgb); color.a = 1.0; - color.rgb = pow(color.rgb, vec3(1.0/2.2)); + //color.rgb = linear_to_srgb(color.rgb); frag_color = color; } -- cgit v1.2.3