Skip to content

Commit 2050134

Browse files
svc-reach-platform-supportEvergreen
authored andcommitted
[Port] [2022.3] [URP] Fix Screen Space Shadows depth precision issue
1 parent 093c8a4 commit 2050134

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Packages/com.unity.render-pipelines.universal/Shaders/Utils/ScreenSpaceShadows.shader

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ Shader "Hidden/Universal Render Pipeline/ScreenSpaceShadows"
2020
{
2121
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
2222

23-
#if UNITY_REVERSED_Z
24-
float deviceDepth = SAMPLE_TEXTURE2D_X(_CameraDepthTexture, sampler_PointClamp, input.texcoord.xy).r;
25-
#else
26-
float deviceDepth = SAMPLE_TEXTURE2D_X(_CameraDepthTexture, sampler_PointClamp, input.texcoord.xy).r;
23+
float deviceDepth = LoadSceneDepth(input.positionCS.xy);
24+
#if !UNITY_REVERSED_Z
2725
deviceDepth = deviceDepth * 2.0 - 1.0;
2826
#endif
2927

0 commit comments

Comments
 (0)