On 1/19/2011 10:09 AM, Paul Martz wrote:
On 1/19/2011 10:13 AM, Rob Radtke wrote:
Back to the original poster, then... Does this eliminate a need for a
transpose() function in the Matrix class?
I'm not 100% sure. My primary motivation for the transpose() function
was to
compute a normal matrix (so it could be passed to glsl as an osg
uniform:
osg_NormalViewMatrix).
Ah. I see. You don't want to do the math on the host, you want to do
it in the shader. You could swap the multiplication order to get the
transpose, but you'd still need to invert the model-view matrix, which
you probably don't want to do per vertex.
Yes, exactly. It would be nice to make osg_NormalViewMatrix and
osg_NormalViewMatrixInverse available as OSG global uniforms (similar to
existing global uniforms osg_ViewMatrix and osg_ViewMatrixInverse).
That was the primary purpose of my patch, but computing those matrices
involves also computing matrix transposes. Of course, we don't need to
make osg::Matrix::transpose() part of the public API, if we don't want
to. Do others agree that the new osg_NormalViewMatrix and
osg_NormalViewMatrixInverse uniforms would be generally useful? If so,
then I'll put together a different patch that doesn't include a public
Matrix::transpose() function.
Rob
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org