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

Commit 483353e

Browse files
committed
Switch to a smoother distance fade
1 parent fe19831 commit 483353e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

PostProcessing/Shaders/Builtins/ScreenSpaceReflections.hlsl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,9 @@ float4 FragComposite(VaryingsDefault i) : SV_Target
383383
float4 color = _MainTex.Sample(sampler_MainTex, i.texcoordStereo);
384384
color.rgb = max(0.0, color.rgb - reflectionProbes.rgb);
385385

386-
float fade = 1.0 - resolve.a * _DistanceFade;
386+
resolve.a *= 2. * resolve.a; // 2 and 1.5 are quite important for the correct ratio of 3:2 distribution
387+
float fade = 1.0 - saturate(1.5 * resolve.a * smoothstep(0.5, 1.0, 1.5 * resolve.a) * _DistanceFade);
388+
387389
resolve.rgb = lerp(reflectionProbes.rgb, resolve.rgb, confidence * fade);
388390
color.rgb += resolve.rgb * gbuffer0.a;
389391

0 commit comments

Comments
 (0)