summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
diff options
context:
space:
mode:
authorRye Mutt <rye@alchemyviewer.org>2024-04-21 20:40:13 -0400
committerGitHub <noreply@github.com>2024-04-21 19:40:13 -0500
commitf1b7e806eb30a343876036eff5caef7c03309aa6 (patch)
tree7c84e5e1d44e4df2fb3ebf1dfa28ceb54c78390d /indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
parente361671018068000a8b63b3cdc2ad87468def9a3 (diff)
Fix sampling normals from gbuffer and cleanup redundant gbuffer samples (#1294)
* Fix sampling normals from gbuffer and cleanup redundant gbuffer samples * Allow negative normals in gbuffer to fix broken material rendering
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl12
1 files changed, 6 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
index 0126e09d4c..e0333b6044 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl
@@ -32,7 +32,7 @@ out vec4 frag_color;
in vec2 vary_fragcoord;
vec4 getPosition(vec2 pos_screen);
-vec3 getNorm(vec2 pos_screen);
+vec4 getNorm(vec2 pos_screen);
float sampleDirectionalShadow(vec3 shadow_pos, vec3 norm, vec2 pos_screen);
float sampleSpotShadow(vec3 shadow_pos, vec3 norm, int index, vec2 pos_screen);
@@ -42,13 +42,13 @@ void main()
{
vec2 pos_screen = vary_fragcoord.xy;
vec4 pos = getPosition(pos_screen);
- vec3 norm = getNorm(pos_screen);
+ vec4 norm = getNorm(pos_screen);
vec4 col;
- col.r = sampleDirectionalShadow(pos.xyz, norm, pos_screen);
- col.g = calcAmbientOcclusion(pos, norm, pos_screen);
- col.b = sampleSpotShadow(pos.xyz, norm, 0, pos_screen);
- col.a = sampleSpotShadow(pos.xyz, norm, 1, pos_screen);
+ col.r = sampleDirectionalShadow(pos.xyz, norm.xyz, pos_screen);
+ col.g = calcAmbientOcclusion(pos, norm.xyz, pos_screen);
+ col.b = sampleSpotShadow(pos.xyz, norm.xyz, 0, pos_screen);
+ col.a = sampleSpotShadow(pos.xyz, norm.xyz, 1, pos_screen);
frag_color = clamp(col, vec4(0), vec4(1));
}