makes geometry shader an option

This commit is contained in:
zomseffen 2024-06-02 15:25:11 +02:00
parent 5c971d0288
commit a9d4aae1bc
10 changed files with 171 additions and 109 deletions

Binary file not shown.

View file

@ -8,6 +8,7 @@ layout(binding = 0) uniform UniformBufferObject {
mat4 geom_rot;
mat4 view;
mat4 proj;
bool[16] use_geom_shader;
} ubo;
layout(location = 0) in vec3 geoColor[];

View file

@ -5,6 +5,7 @@ layout(binding = 0) uniform UniformBufferObject {
mat4 geom_rot;
mat4 view;
mat4 proj;
bool[16] use_geom_shader;
} ubo;
@ -16,7 +17,11 @@ layout(location = 0) out vec3 geoColor;
layout(location = 1) out vec2 geoTexCoord;
void main() {
gl_Position = ubo.proj * ubo.view * ubo.geom_rot * ubo.model * vec4(inPosition, 1.0);
if (ubo.use_geom_shader[0]) {
gl_Position = ubo.geom_rot * ubo.model * vec4(inPosition, 1.0);
} else {
gl_Position = ubo.proj * ubo.view * ubo.geom_rot * ubo.model * vec4(inPosition, 1.0);
}
geoColor = inColor;
geoTexCoord = inTexCoord;
}

Binary file not shown.