out float vertex_depth; void main() { vertex_texcoord = texcoord; vec3 pos = (position * vec4(vertex, 1.0)).xyz; vertex_fragpos = pos; vec4 vpos = view * vec4(pos, 1.0); vertex_depth = vpos.z; gl_Position = projection * vpos; }