does depth clamp occurs before depth test or after depth test? I am rendering a primitive with coordinates > 1.0 and <-1.0 and using depth clamping with depth test. But when i enable depth test it does not render any geometry.
Here is my code:
Code :GLfloat vertices[]= { 0.5f,0.5f,0.5f, -0.5f,0.5f,0.5f, -0.5f,-0.5f,0.5f, 0.5f,-0.5f,0.5f, 0.5f,-0.5f,-0.5f, -0.5f,-0.5f,-0.5f, -0.5f,0.5f,-0.5f, 0.5f,0.5f,-0.5f } for(int i=0;i<24;i++) vertices[3*i+2]*=25; glEnable(GL_DEPTH_CLAMP); // when i comment stmt below, it draws triangle strips glEnable(GL_DEPTH_TEST); glClearDepth(15.0f); glClearColor (1.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glDrawArrays(GL_TRIANGLE_STRIP,0,6);
How to use depth test and clamping together?



Reply With Quote
