13 lines
404 B
HLSL
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
|
|
);
|
|
}
|