Vertex Normals, Loading Mesh Data
Posted
by
Ramon Johannessen
on Game Development
See other posts from Game Development
or by Ramon Johannessen
Published on 2012-09-24T01:17:58Z
Indexed on
2012/09/24
3:51 UTC
Read the original article
Hit count: 444
My test FBX mesh is a cube. From what I surmise, it seems that the cube is on the extreme end of this issue, but I believe that the same issue would be able to occur in any mesh:
Each vertex has 3 normals, each pointing a different direction. Of course loading in any type of mesh, potentially ones having thousands of vertices, I need to use indices and not duplicate shared verts. Currently, I'm just writing the normals to the vertex at the index that the FBX data tells me they go to, which has the effect of overwriting any previous normal data. But for lighting calculations I need more info, something that's equivalent to a normal per face, but I have no idea how this should be done. Do I average the 3 different verts' normals together or what?
© Game Development or respective owner