glEnable(GL_DEPTH_TEST) resulting in black screen :(

can someone please help me? im fairly new to opengl and just followed some codes on the red book about lighting…

i managed to enable lighting and view my scene without enabling depth test (which is part of the init lighting code in the red book) but whenever i enable it i only get a black screen…

someone care to help a noob? :slight_smile:

do you request a depth buffer ? ie. in GLUT you need to do something like glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
do you clear your depth buffer ?
do you change the glDepthFunc default value ?

oh thanks, i just adjusted the value passed to glDepthFunc() and it works :slight_smile: