summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-09-17 14:38:07 -0500
committerDave Parks <davep@lindenlab.com>2022-09-17 14:38:07 -0500
commit13ac0f77ffe488ccdebfd28cabe8ed95d61aa684 (patch)
tree2d4fa048d191382d613da447cc41e3d117da8e77 /indra/newview/app_settings/shaders/class3
parent54e6c554c528262ed053b138c6159bc34f18d6dc (diff)
Make sure specular highlights from punctual lights don't fall off of polished surfaces
Diffstat (limited to 'indra/newview/app_settings/shaders/class3')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl12
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index 6dd140bff3..a8a3b5d33f 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -111,9 +111,6 @@ void main()
float depth = texture2DRect(depthMap, tc.xy).r;
vec4 pos = getPositionWithDepth(tc, depth);
vec4 norm = texture2DRect(normalMap, tc);
- float envIntensity = norm.z;
- norm.xyz = getNorm(tc);
-
vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir;
float light_gamma = 1.0 / 1.3;
@@ -147,6 +144,7 @@ void main()
bool hasPBR = GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR);
if (hasPBR)
{
+ norm.xyz = getNorm(tc);
vec3 orm = texture2DRect(emissiveRect, tc).rgb; //orm is packed into "emissiveRect" to keep the data in linear color space
float perceptualRoughness = orm.g;
float metallic = orm.b;
@@ -164,6 +162,10 @@ void main()
vec3 f0 = vec3(0.04);
vec3 baseColor = diffuse.rgb;
+ //baseColor.rgb = vec3(0,0,0);
+ //colorEmissive = srgb_to_linear(norm.xyz*0.5+0.5);
+
+
vec3 diffuseColor = baseColor.rgb*(vec3(1.0)-f0);
diffuseColor *= 1.0 - metallic;
@@ -187,6 +189,9 @@ void main()
}
else
{
+ float envIntensity = norm.z;
+ norm.xyz = getNorm(tc);
+
float da = clamp(dot(norm.xyz, light_dir.xyz), 0.0, 1.0);
da = pow(da, light_gamma);
@@ -249,5 +254,6 @@ void main()
frag_color.rgb = srgb_to_linear(color.rgb);
}
+
frag_color.a = bloom;
}