Hi,
I'm trying to understand how to use glDrawElements to draw an object that has lots of shared vertices (like a cube) but that needs to use a different surface normal for each vertex depending on which face of the cube is being drawn. It seems to me that it's not possible to re-use vertices in this way if each face has a complete different surface normal. Or am I not understanding something here?
That is correct. You can reuse vertices only when all the components of the vertex format are identical. If there's a discontinuity in one of the components (whether it's the normal or tex-coord or whatever), you have to duplicate vertices. A cube by definition has different normals for each face, so there's no point using vertex indices.
Quote from: spasi on March 17, 2012, 13:13:07
That is correct. You can reuse vertices only when all the components of the vertex format are identical. If there's a discontinuity in one of the components (whether it's the normal or tex-coord or whatever), you have to duplicate vertices. A cube by definition has different normals for each face, so there's no point using vertex indices.
Got it; thanks!