makes geometry shader an option
This commit is contained in:
parent
5c971d0288
commit
a9d4aae1bc
10 changed files with 171 additions and 109 deletions
BIN
shaders/geo.spv
BIN
shaders/geo.spv
Binary file not shown.
|
@ -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[];
|
||||
|
|
|
@ -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;
|
||||
}
|
BIN
shaders/vert.spv
BIN
shaders/vert.spv
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue