Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit 500924d

Browse files
committed
Linear fog was incorrect in deferred (see #141)
1 parent 3afb425 commit 500924d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PostProcessing/Resources/Shaders/Fog.shader

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Shader "Hidden/Post FX/Fog"
6161

6262
float depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv);
6363
depth = Linear01Depth(depth);
64-
float dist = ComputeDistance(depth) - _Start;
64+
float dist = ComputeDistance(depth);
6565
half fog = 1.0 - ComputeFog(dist);
6666

6767
return lerp(color, _FogColor, fog);
@@ -74,7 +74,7 @@ Shader "Hidden/Post FX/Fog"
7474
float depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv);
7575
depth = Linear01Depth(depth);
7676
float skybox = depth < SKYBOX_THREASHOLD_VALUE;
77-
float dist = ComputeDistance(depth) - _Start;
77+
float dist = ComputeDistance(depth);
7878
half fog = 1.0 - ComputeFog(dist);
7979

8080
return lerp(color, _FogColor, fog * skybox);

0 commit comments

Comments
 (0)