Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
graphite/dist/shaders/scube.geom
2024-01-03 16:05:02 -05:00

33 lines
No EOL
594 B
GLSL

layout(triangles) in;
layout(triangle_strip, max_vertices = 18) out;
layout(binding = 8) uniform UBO
{
mat4 viewMatrices[6];
} ubo;
in VS_OUT {
vec2 uv;
vec3 fragpos;
} vs_in[];
out VS_OUT {
vec2 uv;
vec3 fragpos;
} vs_out;
void main()
{
for (int face = 0; face < 6; ++face) {
gl_Layer = face;
for (int i = 0; i < 3; ++i) {
vs_out.uv = vs_in[i].uv;
vs_out.fragpos = vs_in[i].fragpos;
gl_Position = ubo.viewMatrices[face] * gl_in[i].gl_Position;
EmitVertex();
}
EndPrimitive();
}
}