Zeno
12-26-2003, 10:03 AM
In the OpenGL red book, this statement is made about two-sided lighting:
OpenGL reverses the surface normals for back-facing polygons; typically, this means that the surface normals of visible back- and front-facing polygons face the viewer, rather than pointing away. As a result, all polygons are illumnated correctly.
I tried to enable this normal-flipping in arb_vertex_program by doing the obvious:
glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE );
glEnable(GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
but it seems to only affect colors, not normals. How can I get that normal reversal based on facedness to happen in ARB_vertex_program? If it cannot be done automatically, is it even possible to detect triangle winding in a VP?
[This message has been edited by Zeno (edited 12-26-2003).]
[This message has been edited by Zeno (edited 12-26-2003).]
OpenGL reverses the surface normals for back-facing polygons; typically, this means that the surface normals of visible back- and front-facing polygons face the viewer, rather than pointing away. As a result, all polygons are illumnated correctly.
I tried to enable this normal-flipping in arb_vertex_program by doing the obvious:
glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE );
glEnable(GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
but it seems to only affect colors, not normals. How can I get that normal reversal based on facedness to happen in ARB_vertex_program? If it cannot be done automatically, is it even possible to detect triangle winding in a VP?
[This message has been edited by Zeno (edited 12-26-2003).]
[This message has been edited by Zeno (edited 12-26-2003).]