diff --git a/Assets/Shaders/AtmosphericScattering.shader b/Assets/Shaders/AtmosphericScattering.shader index 2be7a9e..3a0c26d 100644 --- a/Assets/Shaders/AtmosphericScattering.shader +++ b/Assets/Shaders/AtmosphericScattering.shader @@ -254,7 +254,10 @@ Shader "Hidden/AtmosphericScattering" float4 fragDir(v2f i) : COLOR0 { float2 uv = i.uv.xy; - float depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); +#ifdef UNITY_UV_STARTS_AT_TOP + uv.y = 1.0 - uv.y; +#endif + float depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv.xy); float linearDepth = Linear01Depth(depth); float3 wpos = i.wpos;