PDA

View Full Version : NURBS surface with 2side light.



9ine
08-16-2004, 07:54 PM
I render simple 2D NURBS surface with 1-side lighting mode and it works nice, but when I turn on 2-side lighting both sides of the surface becomes dark as its back surface in 1-side lighting mode. Whats wrong?

dorbie
08-17-2004, 09:30 AM
With two sided lighting the winding of the surface is important in determining the direction of the light. This is the basis for the normal flip. Use glFrontFace to tell OpenGL which side uses the original normal and which uses the flipped normal.

You may also have found a bug. At least one face should have been illuminated but there may be something about your light and view position that just makes things look dark when normal flipping is on.

9ine
08-17-2004, 07:32 PM
I've done with it defining GL_FRONT_AND_BACK for materials colors, then both sides becomes properly lighted.