1234567891011121314151617181920212223242526 |
- #ifndef UNIVERSAL_PIPELINE_LODCROSSFADE_INCLUDED
- #define UNIVERSAL_PIPELINE_LODCROSSFADE_INCLUDED
-
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GlobalSamplers.hlsl"
-
- float _DitheringTextureInvSize;
-
- TEXTURE2D(_DitheringTexture);
-
- half CopySign(half x, half s)
- {
- return (s >= 0) ? abs(x) : -abs(x);
- }
-
- void LODFadeCrossFade(float4 positionCS)
- {
- half2 uv = positionCS.xy * _DitheringTextureInvSize;
-
- half d = SAMPLE_TEXTURE2D(_DitheringTexture, sampler_PointRepeat, uv).a;
-
- d = unity_LODFade.x - CopySign(d, unity_LODFade.x);
-
- clip(d);
- }
-
- #endif
|