Re: [osg-users] Rendering without calling osgViewer::frame
whenever you use rtt camera there are some other things tbd for resize to work check this thread http://forum.openscenegraph.org/viewtopic.php?t=8602 29.02.2012, 07:53, "Sean O'Connell" : > 3. I don't know if this is related, but when adding my camera to the 3rd > party app's osgViewer I am unable to change the color and depth buffer > resolution. Calling setTextureSize and Camera::setViewport will seem to > increase the size of the texture but the actual contents that get rendered > are clipped at the origin. So if the original texture size was 512x512 and I > increase it to 1024x1024, I get the lower left 256x256 area of the 512x512 > image in the bottom left of the 1024x1024 image (blown up to 512x512) and the > rest of the 1024x1024 image is blank. > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=45872#45872 > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rendering without calling osgViewer::frame
On 02/28/2012 10:49 PM, Sean O'Connell wrote: I'm currently working on a project where I have to integrate library into a 3rd party application's source code. The library consists of a custom osg Camera that takes 9 snapshots of the user's scene. The headache's I've run into are the following: 1. I cannot seem to turn off the 3rd party app's main camera in the osgViewer class. I set nodeMask(0) on the camera but then my camera doesn't render. Having the main camera enabled adds unnecessary overhead. So it sounds like your application has a single camera on an osgViewer::Viewer, and you're adding 9 slaves to it to handle your rendering. Is that correct? I'm wondering if you couldn't just grab the app's main camera, replace it with another camera that doesn't render anything (making it the new master camera for the Viewer), and then add the app's camera back to the Viewer as a slave. Then, add your other 9 cameras as additional slaves. This way, you could disable the app's camera without affecting your 9 other cameras. No idea if this is feasible or not (if there are manipulators or other controls for the app's camera, you'd need to move those over to the new master camera... things like that). 2. The process of taking the 9 snapshots has additional overhead from having to re-process and re-run the update, event, cull and render traversals for each snapshot. Since each view orbits about the same point in space, I'd like the ability to only run the update, event and cull traversals once and only call the render traversal for each snapshot. Event and update only run once as it is. Cull has to be run either per camera or per context, because the cull traversal is what sets up the various render objects that do the actual rendering of each context. Each view is potentially different, and thus has a different set of geometry to render. If you have access to the Viewer, you can try different threading modes (such as CullThreadPerCameraDrawThreadPerContext) to adjust how culling is done. --"J" ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rendering without calling osgViewer::frame
3. I don't know if this is related, but when adding my camera to the 3rd party app's osgViewer I am unable to change the color and depth buffer resolution. Calling setTextureSize and Camera::setViewport will seem to increase the size of the texture but the actual contents that get rendered are clipped at the origin. So if the original texture size was 512x512 and I increase it to 1024x1024, I get the lower left 256x256 area of the 512x512 image in the bottom left of the 1024x1024 image (blown up to 512x512) and the rest of the 1024x1024 image is blank. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45872#45872 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rendering without calling osgViewer::frame
I'm currently working on a project where I have to integrate library into a 3rd party application's source code. The library consists of a custom osg Camera that takes 9 snapshots of the user's scene. The headache's I've run into are the following: 1. I cannot seem to turn off the 3rd party app's main camera in the osgViewer class. I set nodeMask(0) on the camera but then my camera doesn't render. Having the main camera enabled adds unnecessary overhead. 2. The process of taking the 9 snapshots has additional overhead from having to re-process and re-run the update, event, cull and render traversals for each snapshot. Since each view orbits about the same point in space, I'd like the ability to only run the update, event and cull traversals once and only call the render traversal for each snapshot. [/list] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45871#45871 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rendering without calling osgViewer::frame
Hi Sean, In the coming OpenSceneGraph 3.0 Cookbook (will be published in March), I provide such an example that renders OSG scene graph using osgUtil::SceneView directly in GLUT. You may find the source code at: https://github.com/xarray/osgRecipes/tree/master/cookbook/chapter9/ch09_06 The source code are completely in public domain so you may choose to buy the book or not. :-) But as Jason suggested, this is not recommended in most cases as you can't make use of a lot of OSG features anymore. Cheers, Wang Rui 2012/2/29 Sean O'Connell > In my application I have a bunch of cameras that render to textures. Is > there a way for me to trigger them to render without calling > osgViewer::frame or going through the osgViewer class? Ideally I could > simply call camera->renderView() or something similar. Is this possible? > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=45868#45868 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rendering without calling osgViewer::frame
On 02/28/2012 06:20 PM, Sean O'Connell wrote: In my application I have a bunch of cameras that render to textures. Is there a way for me to trigger them to render without calling osgViewer::frame or going through the osgViewer class? Ideally I could simply call camera->renderView() or something similar. Is this possible? Hi, Sean, Short answer: In theory, it's possible, but I wouldn't recommend it. What are you trying to accomplish, in more broad terms? There's probably a better way to do what you're trying to do (have you looked at osgPPU yet?) Long answer: The main problem with this is that the cull and draw traversals are normally spawned off into separate threads, with the exact configuration depending on the threading model in use. If you look at the implementation of the frame() method (in the base class implementation ViewerBase.cpp), you'll see that it's a pretty simple method that calls: advance(simulationTime); eventTraversal(); updateTraversal(); renderingTraversals(); If you then look at the renderingTraversals() method, you'll see it's a lot more complicated, since it has lots to do, and it needs to be able to deal with each of the different threading models that could be in use. You might be able to write your own version of renderingTraversals() to handle your specific use case and only render the cameras that you want, but you're likely to run into all kinds of problems. As I said earlier, there's probably a better way to do what you're trying to do. If you explain your task at a higher level, someone might be able to come up with a solution for you. --"J" ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Rendering without calling osgViewer::frame
In my application I have a bunch of cameras that render to textures. Is there a way for me to trigger them to render without calling osgViewer::frame or going through the osgViewer class? Ideally I could simply call camera->renderView() or something similar. Is this possible? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=45868#45868 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org