Hi Sergey,

what you want to achieve can be with the library I
have posted before, osgPPU. Take a look on
http://projects.tevs.eu/osgppu

There the problem you are speaking about is solved in
another way (take a look into example). I do use only
one camera, which renders the scene into an RTT
texture and afterwards you reuse this texture in
different FBO's (ok not really fbos but ppus with
shaders which do have different fbos).

As I have seen in your post you are using one
perspective camera and 3 camera's just to render a
quad, that is exactly what actually ppus do.
The resulting solution is the same, but you do not
have to handle with multiple cameras to achieve the
same result. 

Cheers,
Art


--- Robert Osfield <[EMAIL PROTECTED]> schrieb:

> Hi Sergey,
> 
> I'm not entirely clearly on your question as there
> was a lot of text,
> before anything that looked like a query.  I think
> the answer to what
> I think your question was... The OSG doesn't
> currently support reusing
> the same texture/FBO between multiple Camera as the
> rendering backend
> build the FBO automatically on demand for each
> Camera.
> 
> There is a possibility that you might be able to
> achieve FBO sharing
> by creating your own FBO an attaching it to the
> Camera's directly so
> the rendering back end simply reuses it.  I have
> never tried this
> though...
> 
> Robert.
> 
> On Jan 6, 2008 8:04 PM, Sergey Kurdakov
> <[EMAIL PROTECTED]> wrote:
> > 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
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 



      Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s 
mit dem neuen Yahoo! Mail. www.yahoo.de/mail
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to