Hi Steven,

Is this additional camera just a render to texture camera?  If so it
may well be most logical to keep it with the scene.

The question you should ask yourself, to qualify where you should place it is:

  A) is the RTT Camera an effect that the scene has i.e. a shadow or
reflective etc.
  B) is the RTT Camera an effect that the viewer has .i.e. distortion
correction, screen shot.

If A then the Camera is best placed in the scene, if B then the Camera
is best placed in the Viewer either as slave Camera or as its own View
within a CompositeViewer.

W.r.t traversal masks and node masks, the cull mask you'll want to set
is the viewer's main camera mask, as it's this that will be
controlling the traversal of its subgraph.

Robert.


On Jan 15, 2008 2:30 PM, Steven Powers <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
> I am using the second CameraNode to render to a texture that the main camera
> in the viewer will display.
>
>
>
> The second cameraNode uses a frame buffer object and shaders to generate a
> texture. It works fine other than the cameranode renders objects that only
> the main viewer should render.
>
>
>
> Should I be adding the camera node as a slave camera to the viewer rather
> than adding it to the scene graph?
>
>
>
> Steven Powers
>
>
>
>
>
>
>
>   Hi Steven,
>
> The CullSetting::setCullMask settings the traversal mask for the
> osgUtil::CullVisitor, but only once the Camera has been entered so
> only affects the traversal of the Camera's children.  The check of
> Camera's NodeMask is done against the CullVisitors traversal mask on
> entering the Camera::accept() method, at this point the traversal mask
> has the value set by the parental chain of the Camera in question,
> which in your case will be the viewer's Camera.
>
> Perhaps what you need to do is back up a little and work out what you
> are actually trying to achieve.  Having the viewer have a Camera with
> another Camera directly below it makes one of the cameras a bit
> redundent, why not not ditch the one in the scene graph and use the
> viewer one.
>
> Don't forget with osgViewer you have a few choices in how you manage
> your views of the scene - you can have one View managed by
> osgViewer::Viewer, or multiple View's managed by
> osgViewer::CompositeViewer, and in both cases you have build the View
> up from a single master Camera or multiple slave Cameras that are
> controlled relative to the master Camera.  So there is lots of
> flexibility in how you can put viewers together.  Since the osgViewer
> library uses exactly the same Camera class as the type you're used to
> put in the scene the code set up will easily map across.   The upshot
> of all this is range of problems that were really awkward in the 1.x
> series of the OSG, and now quite straightforward in the 2.x series.
>
> Robert.
>
>
> On Jan 14, 2008 9:27 PM, Steven Powers <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> > I am having problems with CullMasks using OSG 2.X.
> >
> >
> >
> > I have a CameraNode that I set the CullMask as setCallMask(0x10) and a
> node
> > that I set as setNodeMask(0x1).
> >
> >
> >
> > My understanding is that a node is evaluated like:
> >
> >
> >
> > CullMask & NodeMask
> >
> >
> >
> >  If the result is true it will traverse the node. This is not happening
> for
> > me. Unless I set the Node with setNodeMask(0) the node is traversed and
> > rendered.
> >
> >
> >
> > I am using osg::Viewer with the camera Node added to the scene graph below
> > the root node and before the scene.
> >
> >
> >
> > Is there something in my technique that is wrong or am I missing a
> function
> > call somewhere.
> >
> >
> >
> > Thanks in advance.
> >
> >
> >
> > Steven Powers
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to