summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-05-24 10:34:47 -0500
committerDave Parks <davep@lindenlab.com>2022-05-24 10:34:47 -0500
commit0940e8871894e08da80730d11c31cbd252a05b35 (patch)
treea73b1ce8c7539c0c71d3eb4670e77311507a56f0 /indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl
parent6eaf8521abae0deeb1162f9c61747183110176b0 (diff)
SL-17472 Add checkbox to preferences for enabling "PBR" that uses "class3" deferred shaders. Move reflection probe shaders to class3 and restore class2 shaders to non-reflection probe versions.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl50
1 files changed, 17 insertions, 33 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl
index a04f611440..9fcee04c32 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl
@@ -35,11 +35,10 @@ out vec4 frag_color;
uniform sampler2D diffuseMap;
#endif
-
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
VARYING vec3 vary_texcoord1;
-VARYING vec3 vary_position;
+VARYING vec4 vary_position;
uniform samplerCube environmentMap;
@@ -55,14 +54,6 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou
vec3 linear_to_srgb(vec3 c);
vec3 srgb_to_linear(vec3 c);
-#ifdef HAS_REFLECTION_PROBES
-// reflection probe interface
-void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyEnv,
- vec3 pos, vec3 norm, float glossiness, float envIntensity);
-void applyGlossEnv(inout vec3 color, vec3 glossenv, vec4 spec, vec3 pos, vec3 norm);
-void applyLegacyEnv(inout vec3 color, vec3 legacyenv, vec4 spec, vec3 pos, vec3 norm, float envIntensity);
-#endif
-
// See:
// class1\deferred\fullbrightShinyF.glsl
// class1\lighting\lightFullbrightShinyF.glsl
@@ -79,29 +70,21 @@ void main()
// SL-9632 HUDs are affected by Atmosphere
if (no_atmo == 0)
{
- vec3 sunlit;
- vec3 amblit;
- vec3 additive;
- vec3 atten;
- vec3 pos = vary_position;
- calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false);
-
- float env_intensity = vertex_color.a;
-#ifndef HAS_REFLECTION_PROBES
- vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;
- color.rgb = mix(color.rgb, envColor.rgb, env_intensity);
-#else
- vec3 ambenv;
- vec3 glossenv;
- vec3 legacyenv;
- vec3 norm = normalize(vary_texcoord1.xyz);
- vec4 spec = vec4(0,0,0,0);
- sampleReflectionProbes(ambenv, glossenv, legacyenv, pos.xyz, norm.xyz, spec.a, env_intensity);
- legacyenv *= 1.5; // fudge brighter
- applyLegacyEnv(color.rgb, legacyenv, spec, pos, norm, env_intensity);
-#endif
- color.rgb = fullbrightAtmosTransportFrag(color.rgb, additive, atten);
- color.rgb = fullbrightScaleSoftClip(color.rgb);
+ vec3 sunlit;
+ vec3 amblit;
+ vec3 additive;
+ vec3 atten;
+ vec3 pos = vary_position.xyz/vary_position.w;
+
+ calcAtmosphericVars(pos.xyz, vec3(0), 1.0, sunlit, amblit, additive, atten, false);
+
+ vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;
+ float env_intensity = vertex_color.a;
+
+ //color.rgb = srgb_to_linear(color.rgb);
+ color.rgb = mix(color.rgb, envColor.rgb, env_intensity);
+ color.rgb = fullbrightAtmosTransportFrag(color.rgb, additive, atten);
+ color.rgb = fullbrightScaleSoftClip(color.rgb);
}
/*
@@ -115,6 +98,7 @@ void main()
*/
color.a = 1.0;
+
//color.rgb = linear_to_srgb(color.rgb);
frag_color = color;