[osg-users] Executing subtree multiple times / repeater node?

antiro black antiro42 at gmail.com
Thu Sep 14 03:10:48 PDT 2017


Hi,

I am implementing a Gaussian blur effect by alternating between a horizontal and a vertical blur shader (in the implementation they are the same shader, switching based on a uniform).

In OSG I managed to implement this by adding the two shaders to geometry nodes containing a screen sized quad and having the camera configured for rendering to a texture. To get the best looking effect I want to execute this pair of shaders several times in a single frame. I can of course add the pair of nodes to the scene graph multiple times, but there must be a more elegant solution:

Is there some kind of "repeater" node which simple executes its subtree multiple times?

If not, how would I implement such a node? Should I write a new traverse method? How to handle the different kinds of visitors?

Thank you!

Cheers,
antiro

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







More information about the osg-users mailing list