diff options
| author | yum <yum.food.vr@gmail.com> | 2025-06-03 22:37:12 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-06-03 22:37:35 -0700 |
| commit | 07d204fd6631ae0d0bfec16c8d057cd39c5ab810 (patch) | |
| tree | 1721b235fd8a20c8efbbdbaabb47c9841d90225c /cnlohr.cginc | |
| parent | f53c49c69ee42917e3789bbfe792c9d53c287e76 (diff) | |
Continue work on fog
Fix screen uv calculation
Diffstat (limited to 'cnlohr.cginc')
| -rw-r--r-- | cnlohr.cginc | 3 |
1 files changed, 1 insertions, 2 deletions
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)
|
