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/cube.geom
2024-01-03 16:05:02 -05:00

39 lines
No EOL
768 B
GLSL

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