21 lines
526 B
GLSL
21 lines
526 B
GLSL
|
|
#version 450
|
|
|
|
layout(location = 0) in vec3 in_position;
|
|
layout(location = 1) in vec3 in_color;
|
|
|
|
layout(location = 0) out vec3 frag_color;
|
|
|
|
layout(push_constant) uniform PushConstants {
|
|
mat4 mvp;
|
|
vec4 chunk_offset;
|
|
} push_constants;
|
|
|
|
void main() {
|
|
// The chunk-local vertex is shifted into world space by the per-chunk offset before projection.
|
|
vec3 world_position = in_position + push_constants.chunk_offset.xyz;
|
|
gl_Position = push_constants.mvp * vec4(world_position, 1.0);
|
|
|
|
frag_color = in_color;
|
|
}
|