Hello,

I have the following application –

1) I have multiple RTT ( for blum shader )  and set them the following way

 Root

   + Camera1: draw scene, RTT to texture1 (PRE_RENDER)

   + Camera2: draw scene with another shader to texture2 ( on a quad
covering the screen (ortho2D absolute proj
matrix), textured with texture1, RTT to texture2 (PRE_RENDER)

   + Camera3: draw a quad covering the screen, textured with texture2,

RTT to texture3 (PRE_RENDER)

   .........

   + Camera(4): draw a quad covering the screen, textured with
texture4, no RTT (POST_RENDER)


camera1  – draws   scene to texture1

camera2  draws the same scene to texture2 with shader  which makes
dark parts to be darker

camera3 blurs texture2 ones to texture3
camera 4 – combines texture3 with texture1

this works OK.

2) now for CameraNode3 I'd like to have multipass to make several pass
of blur shader. Multipass uses osg Groups and attached states so that
 bin2 uses as input texture from bin1

in case of such an arrangement
                  camera3
                   |
                 ----------------------------------------
                 |                                             |
    Group - new StateSet (bin 1)  Group - new StateSet (bin 2 )
                 |                                             |
                 ---------------------------------------
                          |
                     SubGraph to render





Only one pass is executed



Now if the arrangement is

                    Camera3
                   |
                 ---
                 |
    Group - new StateSet (bin 1) ----
                 |                                    |
   Group  - new StateSet (bin 2 )     |
                 |                                    |
                 --------------------------------
                          |
                     SubGraph to render


The result is the same – only one pass is rendered ( depending how I
will assign numerical values to  bin 1 and bin 2 ).


What could be fixed here so that I could reuse the output texture from
one rtt several times ?


Also as it is related

I know that Ben Cain developed a code

On Dec 19, 2007 11:00 PM, Ben Cain

Wrote


 > I've written some classes that implement RTT and post-filtering using OSG



And this code might help me.


it looks like he shared his code with some developers but it is still
not in wiki, or did I miss something ? Could anyone help to get it,
please ?


Best regards
Sergey Kurdakov
sergey.forum(_AT_)gmail.com
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to