[osg-users] VRML Normal Issue

Ben Axelrod baxelrod at coroware.com
Fri Mar 27 08:32:16 PDT 2009


I think we are agreeing with each other.

I agree the simplest thing for a user is to specify normals in the file for the best control over shading.  And I agree that in order to support the crease angle property, we will have to duplicate vertices.  Despite the crease angle being a "kludge", I do think that it should be implemented.  That is why I submitted the code, in case anyone wanted to implement the crease angle, I think that would be how to do it.

Before, you said that duplicating vertices would lead to artifacts.  Can you elaborate on this?  I don't see how it would when we are in the sharp edge case, and we give it a proper normal, and point the proper face index at the new vertex.

Thanks,
-Ben

-----Original Message-----
From: osg-users-bounces at lists.openscenegraph.org [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Jan Ciger
Sent: Thursday, March 26, 2009 5:07 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] VRML Normal Issue

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ben Axelrod wrote:

> Can normals per primitive and normals per vertex both be used in a
> single shape?

Not that I am aware of.

>
> If not, the only way I can imagine having a shape with some smooth
> and some sharp edges is if there is one normal per vertex per face.
> Just like the diagram in the VRML spec shows, if a vertex has 2 faces
> connected to it, it needs 2 normals for a sharp edge, and either 1 or
> 2 for a smooth edge.

That's right, however, if you do not specify the vertex normals
explicitly in the model, the vertex normals are calculated from the
*face normals* using the crease angle. If the face normals have an angle
smaller than the crease angle, the vertex normals will be an average of
the two face normals. For sharp edges you will indeed have to duplicate
the vertices to accommodate the different face normals (as explained
here: http://www.songho.ca/opengl/gl_vertexarray.html)

On the other hand, if you want only sharp edges, you can bind normals
per face and save yourself this whole escapade.

Honestly, it is simpler to export the vertex normals from whatever tool
you are using to produce the data than to fidget with the crease angle -
it is only a kludge to let the program guess the model author's intentions.

Regards,

Jan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFJy+5tn11XseNj94gRAvHGAKCZxOcaPU9FnL73O06533yTtpSalwCg6GFc
Kz6Y4w31hZgcHRjbDyna/jY=
=dKWV
-----END PGP SIGNATURE-----
_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



More information about the osg-users mailing list