VoxelEngine2/shaders/rt_quad.vert

32 lines
871 B
GLSL
Raw Permalink Normal View History

2024-12-16 20:01:39 +01:00
#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 = 3) in uint inFacing;
2024-12-16 20:01:39 +01:00
layout(location = 0) flat out uvec2 rasterPos;
layout(location = 1) flat out uint volumeStart;
layout(location = 2) out vec3 origPosition;
layout(location = 3) flat out uint facing;
2024-12-16 20:01:39 +01:00
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;
origPosition = inPosition;
facing = inFacing;
2024-12-16 20:01:39 +01:00
}