#version 150 flat in uint vertIndex; out uint fragIndex; uniform float depthOffset; void main() { fragIndex = vertIndex; gl_FragDepth = gl_FragCoord.z - depthOffset * gl_FragCoord.w; }