Sunshine/assets/shaders/directx/SceneVS.hlsl

22 lines
432 B
HLSL
Raw Normal View History

2021-05-02 20:35:19 +00:00
struct PS_INPUT
{
float4 pos : SV_POSITION;
float2 tex : TEXCOORD;
};
2021-05-06 10:00:39 +00:00
PS_INPUT main_vs(uint vI : SV_VERTEXID)
2021-05-02 20:35:19 +00:00
{
float idHigh = float(vI >> 1);
float idLow = float(vI & uint(1));
float x = idHigh * 4.0 - 1.0;
float y = idLow * 4.0 - 1.0;
float u = idHigh * 2.0;
float v = 1.0 - idLow * 2.0;
2021-05-02 20:35:19 +00:00
PS_INPUT vert_out;
vert_out.pos = float4(x, y, 0.0, 1.0);
vert_out.tex = float2(u, v);
2021-05-02 20:35:19 +00:00
return vert_out;
}