NURBS surface with 2side light.

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?

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.

I’ve done with it defining GL_FRONT_AND_BACK for materials colors, then both sides becomes properly lighted.