[osg-users] Constructing normals for osg::DrawElements
john.donovan at embryonicstudios.com
Tue Sep 18 02:37:53 PDT 2007
Cervantes Pintor Pedro wrote:
> I'm constructing a geometric object by hand. The way I'm doing it, is vertex by
> vertex and then polygon by polygon.
normals are really just a property of vertices, not faces. The way to get flat
faces with the fixed-function pipeline is to duplicate the vertices and give
them different normals.
If you're using (or prepared to use) vertex shaders, you could attach your
second normals to another stream, and write a vertex shader to choose the right
normal. How you do this is application dependent, but to emulate the standard
lighting calculations is well documented.
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
More information about the osg-users