Files
loop/shader/pull/window.vert
T
2025-11-10 14:08:34 +00:00

17 lines
513 B
GLSL

#version 450 core
struct PosCol { vec4 pospos; vec4 col; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std430, binding = 1) readonly buffer Pos { PosCol data[]; };
out vec4 vCol;
out vec4 vPos;
int indices[6] = {0,1,3,0,3,2};
void main()
{
vCol = data[gl_VertexID / 6].col;
vec4 pp = data[gl_VertexID / 6].pospos;
int j = indices[gl_VertexID % 6];
float z = (j > 1.5 ? 5000 : 0);
vec2 xy = (j % 2 > 0 ? pp.xy : pp.zw);
gl_Position = theMat * vec4( xy, z, 1);
}