2
\$\begingroup\$

I'm trying to create my own 3D objects from scratch so I can generate my own terrain for a game I'm making.

So I created a cube and realized the lighting was strange, I looked up the cause and found that each face needed multiple vertices so they could hold their own individual normal because face x's normal will be different to face y's normal, even though the vertices are the same.

So I re-made my cube this way and went on with my terrain generating code. Now that I'm getting into creating more sophisticated meshes the number of vertices and indices are getting quite high (atleast compared to my cube) and a big reason for it is because I have to replicate a lot of the vertices just to have a different normal.

I just wanted to ask if this is normal (I know, I'm so funny) and that I'm doing everything right? Or is there a simple way for a single vertice to hold multiple normals?

\$\endgroup\$
1
  • \$\begingroup\$ duplicate the vertex if it has multiple normals. \$\endgroup\$
    – concept3d
    Mar 2, 2014 at 14:56

1 Answer 1

2
\$\begingroup\$

The best way to think about it is whether the surface needs to be smooth at a vertex or whether it needs to create a sharp edge.

To create a smooth surface, the normal at each vertex must be the average of the normals of the triangles bordering the vertex. If you want this, you can have one single vertex at a given position that has a single normal.

To create a sharp edge, you're almost "cutting" the smooth surface. Because of this, there must be more than one surface normal at a given position along the edge. Hence, you need more than one vertex.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .