Hi,
I have some questions concerning the best approach to update textures using a 
pre-render FBO camera.  First I want to provide a little background before my 
questions.
  
For the project I'm working on I've been integrating a 3rd party vendor product 
(Scaleform) into OpenSceneGraph to pre-render Flash swf movies to texture, 
which are then mapped to objects in the main scene.  I have this successfully 
working in a prototype along with in-world mouse events being sent to the swf 
movies to interact with the Flash content.  The Flash movies I need to render 
update at a reasonable slow rate (10 fps) relative to the main scene render 
frame rate so I'm able to render just one Flash movie per render loop cycle to 
minimize the impact on performance.  I may be cycling through up to six 
different Flash movies at the same time and the textures that are the targets 
will probably include the following sizes (256x256, 512x512, 1024x1024 and 
possibly 2048x2048 (rarely)).  Also, I've derived a class from osg::Drawable 
which encapsulates the Flash movie rendering using Scaleform in the 
drawImplementation.  An instance of this class is attached to an instance of
  an osg::Geode which is then added as a child to the pre-render camera as the 
render scene.

To my questions:

Is it possible to use one pre-render camera which uses an fbo target 
implementation, then during a render loop cycle perform the following steps: 
(1) remove the last Flash movie geode child from the camera, (2) detach the 
last target texture, (3) set the viewport size based on the next target texture 
size, (4) attach the next target texture and finally (5) add the next Flash 
movie geode as a child to the camera in order to set up the camera for 
rendering the next movie?   
Or, would it be better (or necessary) to have separate pre-render cameras for 
each texture size, then attach the next target texture and Flash movie geode to 
the appropriate camera for rendering?  
Finally, where would be the best place to insert the updates to the camera(s) 
prior to rendering the actual movie during each cycle, Update callback, PreDraw 
callback, ...?

Thanks in advance for your help!

Cheers,
Glen Swanger

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=40055#40055





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to