[osg-users] updating osg::TexMat relative to camera position

Robert Osfield robert.osfield at gmail.com
Wed Mar 4 00:59:17 PST 2009


HI Peter,

The OSG is designed on the basis that you don't change state in the
cull/draw traversal.  The only exception to this is when you break
this rule is when you are single threaded and don't share state.  In
your case you are sharing state, and that state can't be in two states
at once... so it's not surprising that your having problems.

The way to address you problem to simply have two TexMat's one for each camera.

Robert.

On Wed, Mar 4, 2009 at 8:48 AM, Peter Wraae Marino <osghelp at gmail.com> wrote:
> Hi users,
>
> We are having some troubles setting the osg::TexMat relative to the current
> camera position.
> The problem arises when we have multiple cameras. We have for example a main
> camera and
> a RTT camera.
>
> We tried to use the setCullCallback expecting that before the object that
> uses the texture is drawn
> we could modify the osg::TexMat,... but... it appears that following is what
> happens (when running
> single threaded):
>
> -Camera Main: cull callback
> -Camera RTT: cull callback
> -Draw
> -Draw
>
> what we would like to have happen is
>
> -Camera Main: cull callback
> -Draw
> -Camera RTT: cull callback
> -Draw
>
> Apparently (of course we assuming here) this is how osg is designed.
>
> Can someone tells us if we understand this correctly now?
> and if someone has an idea how to solve this would be much appreciated.
> --
> Regards,
> Peter Wraae Marino
>
> www.osghelp.com - OpenSceneGraph support site
>
> _______________________________________________
> 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