Shading problem

When I draw triangles using the following codes, the edges which are the intersection of two triangles are not shaded smoothly. The edges are shaded like saw. Please let me know
how to make shading triangles smoothly.


glNormal3f(0.0f, -1.0f, 0.0f);
glVertex3f(0.0f, 0.0f, 60.0f);
glVertex3f(-15.0f, 0.0f, 30.0f);

Hyungu Park

Sawtooth shaped intersections normally occur if your depth buffer precision is too low.

  • In the pixelformat request a depth buffer with 24 bits.
  • Use a projection setup which encloses the object you draw with the zNear and zFar planes as close as possible, that is, make the ratio of zFar/zNear as small as possible by pushing zNear out and zFar in.

Thanks you so much…I think I solved the problem with your help.