terminal/src/renderer/atlas/shader_vs.hlsl
Leonard Hecker 70eeea68e4 wip
2021-10-11 02:15:21 +02:00

13 lines
404 B
HLSL

float4 main(uint id : SV_VERTEXID) : SV_POSITION
{
// The algorithm below is a fast way to generate a full screen triangle,
// published by Bill Bilodeau "Vertex Shader Tricks" at GDC14.
// It covers the entire viewport and is faster for the GPU than a quad/rectangle.
return float4(
float(id / 2) * 4.0 - 1.0,
float(id % 2) * 4.0 - 1.0,
0.0,
1.0
);
}