설명 없음
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.

LODCrossFade.hlsl 584B

1234567891011121314151617181920212223242526
  1. #ifndef UNIVERSAL_PIPELINE_LODCROSSFADE_INCLUDED
  2. #define UNIVERSAL_PIPELINE_LODCROSSFADE_INCLUDED
  3. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GlobalSamplers.hlsl"
  4. float _DitheringTextureInvSize;
  5. TEXTURE2D(_DitheringTexture);
  6. half CopySign(half x, half s)
  7. {
  8. return (s >= 0) ? abs(x) : -abs(x);
  9. }
  10. void LODFadeCrossFade(float4 positionCS)
  11. {
  12. half2 uv = positionCS.xy * _DitheringTextureInvSize;
  13. half d = SAMPLE_TEXTURE2D(_DitheringTexture, sampler_PointRepeat, uv).a;
  14. d = unity_LODFade.x - CopySign(d, unity_LODFade.x);
  15. clip(d);
  16. }
  17. #endif