VoxelEngine2/shaders/rt_quad.vert
2024-12-16 20:01:39 +01:00

27 lines
No EOL
681 B
GLSL

#version 450
layout(binding = 0) uniform UniformBufferObject {
mat4 model;
mat4 geom_rot;
mat4 view;
mat4 proj;
bool[16] use_geom_shader;
} ubo;
layout(location = 0) in vec3 inPosition;
layout(location = 1) in uvec2 inRasterPos;
layout(location = 2) in uint inVolumeStart;
layout(location = 0) out uvec2 rasterPos;
layout(location = 1) out uint volumeStart;
void main() {
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);
}
rasterPos = inRasterPos;
volumeStart = inVolumeStart;
}