VBO's and normals

In nehe tuts when they do lighting they only give one
normal per face.

But is this the same with vbo’s or must I give one normal per vert?

somebody tell me to use GL_FLAT but i don’t get good results.
Also, i would like know how to render in FLAT mode with VBOs

Not same, per vertext may be has more than one normals unless all primitives have the same coefficients of plane equation

VBOs are based on vertex arrays and if you have a normal array specified it has to have the same number of attributes as the vertex array, that is one normal per vertex (for all cases below:)

If you want to have face normals, you need to specify independent primitives (duplicating vertices if required) and all vertices of one primitive should get the same normal attribute in the normal array.

If you use glShadeModel(GL_FLAT), OpenGL uses only one normal per sub-primitive to calculate the color for the whole sub-primitive. Normally that’s the last normal of a subprimitive, except for GL_POLYGON where it’s the first.
Yeah, interpretation potential for GL_POINTS, I know. :wink:

The resulting image will not be the same because lighting in the “face normal” case (e.g. same normal for all three vertices of a triangle) will more accurately represent specular lighting and local viewer than glShadeModel(GL_FLAT).

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.