SimplePixelShader.hlsl 634 B

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