# OpenGL glNormal

This topic is 3694 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

So I made a square composed of triangle strips and now I want to give it some lighting/shading. Can someone please explain to me why the heck I need to explicitly define the normals for every surface of my square? OpenGL already knows what is the front and backside of the triangles else it would not be able to do the backside culling. Also a triangle is ALWAYS in a plane. Can't it calculate the normals based on that information? Basicly why do i need to provide double information in this case. Its not a curved surface. Is there an easier way?

##### Share on other sites
Two examples:

A square, which has sharp edges. Lighting on this should be sharp and clear.

A sphere, which is rounded. Lighting on this should be smooth and continuous. There should be no jumping from light to dark.

Now, if openGL just assumes that all verticies should have a normal pointing directly away from the face, then the square will look right, but the sphere will also have sharp, discontinuous lighting (particularly if it has few triangles). On the other hand, if you specify the normals of the spheres so that OpenGL interpolates between the different normals for the verticies, it gets rid of the sharpness. You do this by giving verticies on the same triangle multiple, different normals. And, in the case of the sphere (and most other things), you give each vertex, regardless of which face it's being used as a corner of, the same normal. On the square, you give the same vertex different normals depending on which face you are using it in.

To sum it up, if you couldn't specify normals, then everything would look much more like Darwinia. (Which is fine, if you want that look!)

[Edited by - Ezbez on November 1, 2008 1:53:54 PM]

##### Share on other sites
Thanks for the explanation and example, perfectly clear now :D

1. 1
2. 2
3. 3
4. 4
Rutin
13
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633701
• Total Posts
3013434
×