Нема описа
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. Shader "Hidden/Universal Render Pipeline/Stop NaN"
  2. {
  3. HLSLINCLUDE
  4. #pragma target 3.5
  5. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  6. #include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
  7. #define NAN_COLOR half4(0.0, 0.0, 0.0, 0.0)
  8. half4 FragStopNaN(Varyings input) : SV_Target
  9. {
  10. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
  11. float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord);
  12. half4 color = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_PointClamp, uv);
  13. if (AnyIsNaN(color) || AnyIsInf(color))
  14. color = NAN_COLOR;
  15. return color;
  16. }
  17. ENDHLSL
  18. SubShader
  19. {
  20. Tags { "RenderType" = "Opaque" "RenderPipeline" = "UniversalPipeline"}
  21. LOD 100
  22. ZTest Always ZWrite Off Cull Off
  23. Pass
  24. {
  25. Name "Stop NaN"
  26. HLSLPROGRAM
  27. #pragma vertex Vert
  28. #pragma fragment FragStopNaN
  29. ENDHLSL
  30. }
  31. }
  32. }