Skip to main content
GameDev.net gamedev.net
🔒 Locked

Quick vertex normal/ lighting question

Started by Drazgal Feb 2, 2004 at 4:30 AM 1 replies 600+ views
Original Post
Drazgal
Drazgal
I always thought for lighting that the normal of the face was used (never tried to implement lighting yet, only read theory), however I am currently writting a model fiel loader and found that the normals given were averages of the normals of the faces that the vertex is part of, aswell as this the guide for the fiel format I was using says that these values are used when the vertex is drawn. Is this average used so that the light blends well from one vertex to another (to avoid flat shading) or am I comletely wrong here?
Fidelio66
Fidelio66
It depends on what you want. Say you make a cylinder (a pillar) with 16 sides. If you use face normals, then each size would have 4 cornerpoints, 2 triangles/6 vertexes with in each vertex the same normal of the face. Then it would look like a 16-faced pillar, with the faces clearly defined.
If you use vertex normals, then every vertex would have a normal of the average of the two faces it shares. Then the pillar would look smooth and round when lit. They are called vertex normals because when you regard one face its vertexes have different normals. But in both cases the normals are in the vertex definition of course.

With vertex normal you can achieve smooth looking and round objects easily, even with just a few triangles.

If you make a sphere (ball), face normals would make it look like crap, so you wouldn''t do that and you would use vertex normals. The same for a wheel. But with a pillar, or an hexagonal/octagonal shape you might prefer face normals.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.