PDA

View Full Version : Some kind of brighter diagonals in lighted quads??



jon_t
08-23-2001, 03:13 PM
I rendered a cube with quads in the usual way:
glBegin(...);
glNormal(...);
glVertex(...);
glNormal(...);
glVertex(...);
...
glEnd();

Then I put a light and faces of the cube seems to be lighted by separate triangles and they arent shaded correctly since faces have the diagonals brighter than the face itself. Is this usual??

When I put one normal per face I think it was correctly shaded, but this problem come when individual vertexes get involved, since the same thing happens if I dont do lighting but apply different colors to each vertex.

Rob The Bloke
08-25-2001, 06:17 AM
Yes this is correct. Most 3D cards (I would say all of them, but I can't be sure) turn quads & polygons into triangles. What you are experiancing is that in action. One way to reduce the problem is to subdivide the surface a bit so that the Gouraud shading is not so noticable. (or use register combiners etc to get per pixel lighting)

DFrey
08-25-2001, 06:29 AM
... or use lightmaps if the geometry is static with respect to the lights.

[This message has been edited by DFrey (edited 08-25-2001).]