You’ll need to set material properties for the back face to make it black. Either that or move the light source
You have only set front material properties and the front face in two sided lighting is determined by the face winding.
The normal and material will be flipped based on whether the face is clockwise or counter clockwise.
If you get the winding wrong (w.r.t. your chosen frontface winding preference (glFrontFace(GL_CCW) is the default) the inside will have the outside material and may appear backlit due to the normal pointing the wrong way.
Your code only sets the front face material too so you should correct that. Materials have default properties, they are not simply black.
I’d advise you set ambient low and set diffuse to different colors for front & back materials. You may want to set emission to some color and everything else to black just to make sure you know what you’re looking at w.r.t. face winding just to start off with.
Originally posted by dorbie:
[b]You’ll need to set material properties for the back face to make it black. Either that or move the light source
You have only set front material properties and the front face in two sided lighting is determined by the face winding.
The normal and material will be flipped based on whether the face is clockwise or counter clockwise.
If you get the winding wrong (w.r.t. your chosen frontface winding preference (glFrontFace(GL_CCW) is the default) the inside will have the outside material and may appear backlit due to the normal pointing the wrong way.
Your code only sets the front face material too so you should correct that. Materials have default properties, they are not simply black.
I’d advise you set ambient low and set diffuse to different colors for front & back materials. You may want to set emission to some color and everything else to black just to make sure you know what you’re looking at w.r.t. face winding just to start off with.[/b]
Oh Yeah, I misunderstood how glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, 0.0) works.
I thought that setting it to 0 would turn off the lighting calculation on the back side…
However, to turn off completely the back side lighting was my goal (setting the back material to black doesn’t avoid the calculations).
Is it possibile ???