prosperon/source/shaders/billboardvertex.glsl
John Alanbrook e745acad3e Project cleanup
Standard shaders and fonts now belong to the source directory
2022-08-05 21:16:04 +00:00

11 lines
438 B
GLSL

void main(){
// Output position of the vertex, in clip space
// map [0..800][0..600] to [-1..1][-1..1]
vec2 vertexPosition_homoneneousspace = vertexPosition_screenspace - vec2(400,300); // [0..800][0..600] -> [-400..400][-300..300]
vertexPosition_homoneneousspace /= vec2(400,300);
gl_Position = vec4(vertexPosition_homoneneousspace,0,1);
// UV of the vertex. No special space for this one.
UV = vertexUV;
}