Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. cbuffer ShaderParams : register(b0)
  2. {
  3.     float2 half_size;
  4. }
  5.  
  6. struct vsinput
  7. {
  8.     float2 xy  : POSITION;
  9.     float4 rgba : COLOR;
  10.     float2 uv   : TEXCOORDS;
  11. };
  12.  
  13. struct vsoutput
  14. {
  15.     float4 pos  : SV_POSITION;
  16.     float4 col  : COLOR;
  17.     float2 uv   : TEXCOORDS;
  18. };
  19.  
  20. vsoutput main(vsinput in_)
  21. {
  22.     vsoutput out_;
  23.  
  24.     out_.pos = float4(-1.f + in_.xy.x / half_size.x, 1.f + in_.xy.y / half_size.y, 0.f, 1.f);
  25.     out_.col = in_.rgba;
  26.     out_.uv = in_.uv;
  27.  
  28.     return out_;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement