summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2023-02-24 19:36:45 -0600
committerDave Parks <davep@lindenlab.com>2023-02-24 19:36:45 -0600
commitb0fb4e3b7c6762d2f63ae349490c264e42809f60 (patch)
tree961af20dd7ad6fe91a2fa7062ac63e3c6e9a77eb /indra/newview/app_settings/shaders
parent9606f2afbb3ca81d184c6b7decbbe4f3ae360272 (diff)
DRTVWR-559 Fix for ignoring specular channel alpha for attenuation environment intensity.
Diffstat (limited to 'indra/newview/app_settings/shaders')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/materialF.glsl11
1 files changed, 6 insertions, 5 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
index 48dd8e942e..b00a6ed757 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl
@@ -304,6 +304,7 @@ void main()
// spec == specular map combined with specular color
vec4 spec = getSpecular();
+ float env = env_intensity * spec.a;
float glossiness = specular_color.a;
vec3 norm = getNormal(glossiness);
@@ -336,7 +337,7 @@ void main()
vec3 ambenv;
vec3 glossenv;
vec3 legacyenv;
- sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, pos.xy*0.5+0.5, pos.xyz, norm.xyz, glossiness, env_intensity);
+ sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, pos.xy*0.5+0.5, pos.xyz, norm.xyz, glossiness, env);
// use sky settings ambient or irradiance map sample, whichever is brighter
color = max(amblit, ambenv);
@@ -369,12 +370,12 @@ void main()
color = mix(color.rgb, diffcol.rgb, emissive);
- if (env_intensity > 0.0)
+ if (env > 0.0)
{ // add environmentmap
- applyLegacyEnv(color, legacyenv, spec, pos.xyz, norm.xyz, env_intensity);
+ applyLegacyEnv(color, legacyenv, spec, pos.xyz, norm.xyz, env);
float cur_glare = max(max(legacyenv.r, legacyenv.g), legacyenv.b);
- cur_glare *= env_intensity*4.0;
+ cur_glare *= env*4.0;
glare += cur_glare;
}
@@ -410,7 +411,7 @@ void main()
// deferred path // See: C++: addDeferredAttachment(), shader: softenLightF.glsl
frag_data[0] = vec4(diffcol.rgb, emissive); // gbuffer is sRGB for legacy materials
frag_data[1] = vec4(spec.rgb, glossiness); // XYZ = Specular color. W = Specular exponent.
- frag_data[2] = vec4(encode_normal(norm), env_intensity, GBUFFER_FLAG_HAS_ATMOS);; // XY = Normal. Z = Env. intensity. W = 1 skip atmos (mask off fog)
+ frag_data[2] = vec4(encode_normal(norm), env, GBUFFER_FLAG_HAS_ATMOS);; // XY = Normal. Z = Env. intensity. W = 1 skip atmos (mask off fog)
#endif
}