tchau83
09-26-2010, 08:18 AM
Hi,
I want to render a model using flat shading with per triangle normals and VBOs. However, VBOs do not support per triangle values. My model is dynamic, so this rules out using display lists.
I'm thinking of doing this. For each triangle, create an extra vertex which has the same position as the triangle's first vertex. The normal corresponding to this vertex will store the face normal for the triangle, and other normals will have dummy values. If I'm not mistaken, for flat shading, only the normal of the first vertex is read. Then, I'll render using GL_QUADS. Will this method work? Visually, there should be no difference between a straightforward immediate mode method for flat shading right?
Also, I'll be glad to hear any alternatives.
Thanks
I want to render a model using flat shading with per triangle normals and VBOs. However, VBOs do not support per triangle values. My model is dynamic, so this rules out using display lists.
I'm thinking of doing this. For each triangle, create an extra vertex which has the same position as the triangle's first vertex. The normal corresponding to this vertex will store the face normal for the triangle, and other normals will have dummy values. If I'm not mistaken, for flat shading, only the normal of the first vertex is read. Then, I'll render using GL_QUADS. Will this method work? Visually, there should be no difference between a straightforward immediate mode method for flat shading right?
Also, I'll be glad to hear any alternatives.
Thanks