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

Commit a49365f

Browse files
committed
Fixed NaNs with SSR
Dirty fix, will do the trick until we get the new SSR in.
1 parent aa6aee4 commit a49365f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

PostProcessing/Resources/Shaders/ScreenSpaceReflection.shader

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -749,16 +749,15 @@ Shader "Hidden/Post FX/Screen Space Reflection"
749749
float confidence = temp.w;
750750
float3 colorResult = confidence > 0.0 ? tex2D(_MainTex, hitPoint).rgb : tex2D(_CameraReflectionsTexture, tsP).rgb;
751751

752-
#ifdef UNITY_COMPILER_HLSL
753-
/*if (any(isnan(colorResult)))
752+
if (any(isnan(colorResult)))
754753
colorResult = float3(0.0, 0.0, 0.0);
755754

756755
// As of 11/29/2015, on Unity 5.3 on a Windows 8.1 computer with a NVIDIA GeForce 980,
757756
// with driver 347.62, the above check does not actually work to get rid of NaNs!
758757
// So we add this "redundant" check.
759758
if (!all(isfinite(colorResult)))
760-
colorResult = float3(0.0, 0.0, 0.0);*/
761-
#endif
759+
colorResult = float3(0.0, 0.0, 0.0);
760+
762761
return float4(colorResult, confidence);
763762
}
764763

0 commit comments

Comments
 (0)