ReflectionCubeDownsample.bsl 535 B

1234567891011121314151617181920212223242526272829
  1. #include "$ENGINE$\PPBase.bslinc"
  2. #include "$ENGINE$\ReflectionCubemapCommon.bslinc"
  3. technique ReflectionCubeDownsample
  4. {
  5. mixin PPBase;
  6. mixin ReflectionCubemapCommon;
  7. code
  8. {
  9. [internal]
  10. cbuffer Input
  11. {
  12. int gCubeFace;
  13. int gMipLevel;
  14. }
  15. SamplerState gInputSamp;
  16. TextureCube gInputTex;
  17. float4 fsmain(VStoFS input) : SV_Target0
  18. {
  19. float2 scaledUV = input.uv0 * 2.0f - 1.0f;
  20. float3 dir = getDirFromCubeFace(gCubeFace, scaledUV);
  21. return gInputTex.SampleLevel(gInputSamp, dir, gMipLevel);
  22. }
  23. };
  24. };