Hi Art,

There are a number of render to texture (RTT) CameraNode, some of
these inherit the viewers projection and modelview matrix (like
osgdistortion) and others create entirely their own views such (such
as osgprerender, osgprerendercubemap, osgshadowtexture).

All of these examples don't require any subclassing of drawables or
nodes.  At most they have an update callback updating their camera's
view and project matrix.

Another possible way to tackle this is to hide the use of a RTT camera
entirely by using as an implementation details in a custom Node's
handling of update/cull traversals.  See osgSim::Impostor and
osgSim::OverlayNode for examples of this.

Robert.

ps In CVS CameraNode is has now been renamed osg::Camera.


On 12/1/06, Art Tevs <[EMAIL PROTECTED]> wrote:
Hi, folks!

I have a question regarding to the rendering to texture and camera setup.
Actually I do understand how to setup all the things, but I need some
technical design help.
I have a class A which has a camera node. The camera do render the scene from
another view into a texture. I can access the texture through this class.

So my question is:
What is the best way to implement this:

1) Derive the class A from osg::Node and update the view of the camera by
updateCallback method of the osg::Node class. I mean when osgUtil::SceneView
calls update() method, then probably the updateCallback-Method of the Node
will be called, and then I have to update my camera view.

2) Derive A from Drawable and update the view of the camera in the
drawImplementation of the Drawable class. But what if the camera is not in
the viewing frustum of the main camera. Should then the BoundingBox of this
Drawable be equal to the scene ones or just big enough to be always rendered.


What about culling of nodes which are not in the view frustum of this camera?
How I have to call the CameraNode to let it render the scene into the texture?

Thanks

MfG, Art


___________________________________________________________
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
_______________________________________________
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