Depth offset in OpenGL

Viewed 6125

What would be the best way of offsetting depth in OpenGL? I currently have index vertex attribute per polygon which I am passing to the Vertex Shader in OpenGL. My goal is to offset the polygons in depth where the highest index would be always in-front of the lower index. I currently have this simple approach modifying gl_Position.z.

gl_Position.z += -index * 0.00001;
1 Answers
Related