From 0336c1a06de89937d5c0f971e06270afc868ddfa Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 21 Feb 2023 22:13:08 -0600 Subject: DRTVWR-559 Fix SSR on transparent PBR surfaces. --- indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl index 35ccc65a8e..a95feb8e2f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl @@ -46,8 +46,9 @@ uniform vec3 moon_dir; out vec4 frag_color; +in vec3 vary_fragcoord; + #ifdef HAS_SUN_SHADOW - in vec3 vary_fragcoord; uniform vec2 screen_res; #endif @@ -191,8 +192,9 @@ void main() vec3 atten; calcAtmosphericVarsLinear(pos.xyz, norm, light_dir, sunlit, amblit, additive, atten); -#ifdef HAS_SUN_SHADOW vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; + +#ifdef HAS_SUN_SHADOW scol = sampleDirectionalShadow(pos.xyz, norm.xyz, frag); #endif @@ -211,7 +213,7 @@ void main() float gloss = 1.0 - perceptualRoughness; vec3 irradiance = vec3(0); vec3 radiance = vec3(0); - sampleReflectionProbes(irradiance, radiance, vec2(0), pos.xyz, norm.xyz, gloss); + sampleReflectionProbes(irradiance, radiance, vary_position.xy*0.5+0.5, pos.xyz, norm.xyz, gloss); // Take maximium of legacy ambient vs irradiance sample as irradiance // NOTE: ao is applied in pbrIbl (see pbrBaseLight), do not apply here irradiance = max(amblit,irradiance); -- cgit v1.2.3