暫無描述
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.

DeclareOpaqueTexture.hlsl 797B

1234567891011121314151617181920
  1. #ifndef UNITY_DECLARE_OPAQUE_TEXTURE_INCLUDED
  2. #define UNITY_DECLARE_OPAQUE_TEXTURE_INCLUDED
  3. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  4. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DynamicScalingClamping.hlsl"
  5. TEXTURE2D_X(_CameraOpaqueTexture);
  6. SAMPLER(sampler_CameraOpaqueTexture); //NOTE: Configured at runtime by copy color, can be point or bilinear.
  7. float4 _CameraOpaqueTexture_TexelSize;
  8. float3 SampleSceneColor(float2 uv)
  9. {
  10. uv = ClampAndScaleUVForBilinear(UnityStereoTransformScreenSpaceTex(uv), _CameraOpaqueTexture_TexelSize.xy);
  11. return SAMPLE_TEXTURE2D_X(_CameraOpaqueTexture, sampler_CameraOpaqueTexture, uv).rgb;
  12. }
  13. float3 LoadSceneColor(uint2 uv)
  14. {
  15. return LOAD_TEXTURE2D_X(_CameraOpaqueTexture, uv).rgb;
  16. }
  17. #endif