> Should a scale in a transform affect the specular highlights on an
object?
> 
> I'm seeing a case where if I scale a transform node above a geometry
> node the specular highlights change (scale > 1 -> highlights get
> smaller, scale < 1 -> highlights get bigger, scale == 1 -> looks
normal).

Yes, a scale will change your normals to non-unit length which adversely
affects the lighting calculation.  You can ask OpenGL to rescale your
normals to unit length automatically.  From the osgTransform
documentation at
http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/
classosg_1_1Transform.html#_details:

Note: If the transformation matrix scales the subgraph then the normals
of the underlying geometry will need to be renormalized to be unit
vectors once more. This can be done transparently through OpenGL's use
of either GL_NORMALIZE and GL_RESCALE_NORMAL modes. For further
background reading see the glNormalize documentation in the OpenGL
Reference Guide (the blue book). To enable it in the OSG, you simply
need to attach a local osg::StateSet to the osg::Transform, and set the
appropriate mode to ON via stateset->setMode(GL_NORMALIZE,
osg::StateAttribute::ON);


Mike Wittman
[EMAIL PROTECTED]
___________________________________________________
Seismic Micro-Technology, Inc.
8584 Katy Freeway, Suite 400 / Houston, Texas 77024
Tel.  +1 (713) 464-6188
Fax. +1 (713) 464-6440
Web:  www.seismicmicro.com
___________________________________________________
Seismic through Simulation with KINGDOM, (RC)2, and SURE! - CONTACT US
TODAY for more information.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to