render_backend_d3d11_default_shader.hlsl 627 B

1234567891011121314151617181920212223242526
  1. cbuffer constants : register(b0) {
  2. float4x4 mvp;
  3. }
  4. struct vs_in {
  5. float3 position : position;
  6. float2 texcoord : texcoord;
  7. float4 color : color;
  8. };
  9. struct vs_out {
  10. float4 position : SV_POSITION;
  11. float2 texcoord : texcoord;
  12. float4 color : color;
  13. };
  14. Texture2D tex : register(t0);
  15. SamplerState smp : register(s0);
  16. vs_out vs_main(vs_in input) {
  17. vs_out output;
  18. output.position = mul(mvp, float4(input.position, 1.0f));
  19. output.texcoord = input.texcoord;
  20. output.color = input.color;
  21. return output;
  22. }
  23. float4 ps_main(vs_out input) : SV_TARGET {
  24. float4 c = tex.Sample(smp, input.texcoord);
  25. return c * input.color;
  26. }