Texture.ps 881 B

123456789101112131415161718192021222324252627282930313233343536
  1. ////////////////////////////////////////////////////////////////////////////////
  2. // Filename: texture.ps
  3. ////////////////////////////////////////////////////////////////////////////////
  4. /////////////
  5. // GLOBALS //
  6. /////////////
  7. Texture2D shaderTexture;
  8. SamplerState SampleType;
  9. //////////////
  10. // TYPEDEFS //
  11. //////////////
  12. struct PixelInputType
  13. {
  14. float4 position : SV_POSITION;
  15. float2 tex : TEXCOORD0;
  16. };
  17. ////////////////////////////////////////////////////////////////////////////////
  18. // Pixel Shader
  19. ////////////////////////////////////////////////////////////////////////////////
  20. float4 TexturePixelShader(PixelInputType input) : SV_TARGET
  21. {
  22. float4 textureColor;
  23. // Sample the pixel color from the texture using the sampler at this texture coordinate location.
  24. textureColor = shaderTexture.Sample(SampleType, input.tex);
  25. return textureColor;
  26. }