FontVertexShader.hlsl 633 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include "VertexConstants.h"
  2. struct VS_INPUT
  3. {
  4. float3 vPos : POSITION;
  5. float2 vTex : TEXCOORD0;
  6. float4 vCol : COLOR;
  7. };
  8. struct VS_OUTPUT
  9. {
  10. float4 Position : SV_POSITION;
  11. float2 Tex : TEXCOORD0;
  12. float4 Color : COLOR0;
  13. };
  14. VS_OUTPUT main(VS_INPUT input)
  15. {
  16. VS_OUTPUT Output;
  17. float4 pos = float4(input.vPos, 1.0f);
  18. // Transform the position from object space to homogeneous projection space
  19. pos = mul(View, pos);
  20. pos = mul(Projection, pos);
  21. Output.Position = pos;
  22. // Output texture coordinates
  23. Output.Tex = input.vTex;
  24. // Output color
  25. Output.Color = input.vCol;
  26. return Output;
  27. }