voxel-engine/shaders/cube_vert.glsl
2025-11-09 23:04:07 -06:00

17 lines
500 B
GLSL

#version 330 core
// Input vertex attribute (e.g., from your VBO)
// 'layout (location = 0)' matches the first attribute you enable.
layout (location = 0) in vec3 aPos;
// A "uniform" is a global variable you set from your C++/Java/etc. code.
// This matrix combines your model, view, and projection matrices.
uniform mat4 u_mvp;
void main()
{
// gl_Position is a special built-in variable.
// It's the final clip-space position of the vertex.
gl_Position = u_mvp * vec4(aPos, 1.0);
}