Hi all,

I'm not sure the CPU cost is really the issue here, but it would be usefull to 
have that kind of methods :

executeCamera(osg::Camera*, osg::State*)
executeCameraAsync(osg::Camera*, osg::State*)

=> execute all needed code to render the sub graph of the camera, with async 
wait.
=> inputs are controled using the StateSet of the camera + subgraph
=> outputs are controled by the camera render target

So, we can do processing like that in a PostDraw/FinalDraw callback :


Code:
executeCamera(cameraBlur, renderinfo.getState());

if (something)
{
    executeCamera(cameraFX, renderinfo.getState())
}

float x = computeSomething();

cameraToneMapping->getStateSet->setUniform(x);
executeCamera(cameraToneMapping, renderinfo.getState())



with :

cameraBlur : a small graph : a render quad, a shader and main scene bound as 
input texture

cameraFX : similar, another FX

cameraToneMapping : similar, execute a tone mapping controled via uniform "x"

Here we can mix GLSL processing and CPU control code, for advanced processing 
it's very usefull.
It's also difficult to achieve using a standard graph, without playing a lot 
with callbacks and render order.

Aurelien

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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to