Hi Paul,

The cull callback have a *reference* to the texture matrix.

Cubemap texture generation uses the normals to calculate the texture
coordinates in eye space.  That means the +Z face of the cubmap will
always face the camera.  To use cubemaps to simulate reflection you
have to rotate the cubmap from eye-space to world-space and this is
what the TexMat is used for.  In the osgvertexprogram the cubemap is
used for the skydome as well as the reflected/refracted sphere.  Both
objects have a TexMat state attribute that is updated in separate cull
callbacks.


Regards,
Brede



On 8/14/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
On 8/14/06, Paul Melis <[EMAIL PROTECTED]> wrote:
> Can someone (Robert :)) perhaps enlighten me of the function of the
> TexMatCallback() class in the osgvertexprogram example?
> Although it is set as a cull callback on two nodes, the result of the
> calculation in operator(), which is stored in _texMat, doesn't seem to
> be used anywhere...

I'll pass the buck to the author of osgvertexprogram... Brede ;-)
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to