Hi,

On 08/12/10 20:54, Thorsten Roth wrote:
Hi,

Am 08.12.2010 12:19, schrieb J.P. Delport:
Yes, a pass where the camera looks at a screen aligned quad. You just
fill in whatever you want into all the MRT buffers using glFragData. You
attach the same textures as for the second pass. Let me know if you need
more info.

rgds
jp


Best thing would be a code snippet, if you have one at hand ;-) ..tried
several things such as using a slave camera with a different clear color
today, but somehow that didn't seem to do the job, so I am quite
interested in your approach :)

It need not be a slave camera, it can just be a camera in your scene. We have some initial code for an image processing lib here:
http://code.google.com/p/flitr/source/checkout

have a look at:
examples/glsl_shader_pass/simple_shader_pass.cpp

for an example. This uses only a single render target, but the concept is the same for many. Just attach more textures to the camera output and push data into it with glFragData.

Attach like so e.g.:
// attach the output textures
        
Camera_->attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER0+0),
                                        OutputTexture_.get());
        
Camera_->attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER0+1),
                                        OutputShortTerm_.get());
        
Camera_->attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER0+2),
                                        OutputLongTermA_.get());
        
Camera_->attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER0+3),
                                        OutputLongTermB_.get());


You can also just chain passes together by attaching more passes to your scene.

I also recently posted an example with two cameras rendering over each other here:
http://article.gmane.org/gmane.comp.graphics.openscenegraph.user/62892/

rgds
jp


Thank you!

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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

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

Reply via email to