Question about Normals and Vertices

Started by
1 comment, last by MJP 11 years, 7 months ago
So I am currently learning dx11. The tutorial I am currently looking at shows the Vertex structure being defined as having a Normal vector associated with it. However, say that I have a cube with 8 vertices and 36 indices. Wouldn't it make more sense to assign a normal vector to each face (or triangle?) as a vertex may be a part of multiple triangles each pointing a different direction? Maybe there's something I'm missing here.....
J.W.
Advertisement
A cube has initially 8 vertices, but will end with 8*3 vertices because you'll have to duplicate the vertices at each corner with each of the 3 adjacent face normals.
Typically you split vertices that have the same position, but require different normals or UV's. This comes from the fact that when rendering triangles on the GPU your vertex shader only works with per-vertex information, and can't pull in per-face information or output it in a meaningful way. It's actually possible to do this now with geometry shaders, but using a geometry shader can have a severe performance impact so it probably wouldn't be worth it.

This topic is closed to new replies.

Advertisement