From 07d204fd6631ae0d0bfec16c8d057cd39c5ab810 Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 3 Jun 2025 22:37:12 -0700 Subject: Continue work on fog Fix screen uv calculation --- cnlohr.cginc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cnlohr.cginc') diff --git a/cnlohr.cginc b/cnlohr.cginc index 2a03516..b01bbce 100644 --- a/cnlohr.cginc +++ b/cnlohr.cginc @@ -76,10 +76,9 @@ float GetLinearZFromZDepth_WorksWithMirrors(float zDepthFromMap, float2 screenUV void GetScreenUVAndPerspectiveFactor(float3 worldPos, float4 clipPos, out float2 screen_uv, out float perspective_factor) { float3 full_vec_eye_to_geometry = worldPos - _WorldSpaceCameraPos; - float3 world_dir = normalize(worldPos - _WorldSpaceCameraPos); float perspective_divide = 1.0f / clipPos.w; perspective_factor = length(full_vec_eye_to_geometry * perspective_divide); - screen_uv = clipPos.xy * perspective_divide; + screen_uv = ComputeScreenPos(clipPos).xy; } #if defined(_SSAO) -- cgit v1.2.3