LineVertexShader.hlsl 542 B

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