Lighting of previously backface polygons

Have anyone experienced the following problem: when rotating a lighted object, the polygons whcih are backface in object space coordinates are not lighted at all, regardless of the orientation. The light position is defined prior to any rendering, so the light source shouldn’t be rotated togather with the object. I also check its position using the ‘glGetLightfv()’ function, and as long as I can count on it, the light source is always static indeed.
I have also tried to redefine the light source position every time the object is rendered, and I’ve got a very strange phenomenon: the backface polygons are lihgted, but have no specular reflection, and only the polygons that are not lighted (e.g. black) are the ones which intersect the YZ plane (again, in object space coordinates) .
I’ve also used
‘glLightModelf(GL_LIGHT_MODEL_TWO_SIDE,true)’
but is didn’t help. Any suggestions?

  • Did you set materials for both front and back faces?
  • Is the winding of the polygons consistent?
  • Are you using GL_POLYGON? Are the polygons convex?
  • Does it work with another OpenGL implementation (Microsoft GDI Generic OpenGL)?
  • Do you have some matrix which inverts a coordinate axis orientation? (Otherwise I have no idea about the YZ plane thing.)

Relic,
Thank you for your response. Answering your questions:

  • Material properties are specified
  • All polygons (triangles) have the same orientation.
  • I’m using GL_TRIANGLE. Naturally, triangles are convex.
  • No invertion of coordinate axis orientation. I’m even not suer I know how to do that.

Ilya

  • Haven’t tried any other implementation of OpenGL yet (where can I get it?)

Relic,
Thank you for your response. Answering your questions:

  • Material properties are specified

  • All polygons (triangles) have the same orientation.

  • I’m using GL_TRIANGLE. Naturally, triangles are convex.

  • No invertion of coordinate axis orientation. I’m even not suer I know how to do that.

  • Haven’t tried any other implementation of OpenGL yet (where can I get it?)

Check which vendor you get with glGetString(GL_VENDOR) first. It should name your graphics board vendor.
Then try specifying PFD_GENERIC_FORMAT in the dwFlags of the pixelformat and start again. It should say Microsoft. Now you run on a different OpenGL implementation (SW only).
(Not sure about Win9x, I only use NT/2000).

You might try this:
glLightModeli( GL_LIGHT_MODEL_TWO_SIDE, 1 );