#version 330 core layout (location = 0) in vec3 aPos; out vec3 WorldPos; uniform mat4 view; uniform mat4 projection; void main() { WorldPos = aPos; /* Force depth value to 1.0 after perspective division * to ensure the skybox is always rendered behind everythig else. */ vec4 pos = projection * view * vec4(WorldPos, 1.0); gl_Position = pos.xyww; }