FontPixelShader.hlsl 419 B

12345678910111213141516171819202122232425
  1. Texture2D ShaderTexture : register(t2);
  2. SamplerState SampleType : register(s0);
  3. struct PS_INPUT
  4. {
  5. float4 Position : SV_POSITION;
  6. float2 Tex : TEXCOORD0;
  7. float4 Color : COLOR0;
  8. };
  9. struct PS_OUTPUT
  10. {
  11. float4 RGBColor : SV_TARGET;
  12. };
  13. PS_OUTPUT main(PS_INPUT In)
  14. {
  15. PS_OUTPUT Output;
  16. float t = ShaderTexture.Sample(SampleType, In.Tex).r;
  17. Output.RGBColor = float4(In.Color.rgb, t);
  18. return Output;
  19. }