Carsten Neumann ha scritto:

Thenk you very much for your help!
        
Basically you only have to create an FBOViewport and add multiple TextureChunks to it, they will be added as color attachments to the FBO and you can write them from a shader with gl_FragData[i]. I don't have any example for MRT handy, but there is Source/System/Window/testFboVp.cpp and Tutorials/29FBOTexture.cpp that demonstrate how to use the FBOViewport in general.

        Cheers,
                Carsten
I made some test using MRT in OpenSG but now the "only" triky part if to pass back the texture written to OpenGL for the next pass. I have a multipass algorithm composed by a first shader to be run in openGL and the second in OpenSG for each pass. This is wat i have done till now:

< From OpenGL to OpenSG > (works!)
- i just call glActivateTexture(GL_TEXTUREXYZ) for the three textures i need and bind it, then pass to the OpenSG shader, as uniform, the texture unit activated (setUniformParameter("samplerTex", XYZ));

< From OpenSG to OpenGL >
- my first attemp was to bind in OpenGL to the correct fbo with the three texture to be written - my second attemp was to use the FBOViewport and so to write to the texture attached to the FBOViewport (as you suggest).

I attache a simple chart to explain it better.
In both case the problem seams to be about make them to be read back by the OpenGL shader. I would like to find a good performance way to do it.
Any clue?

Thank you.
Have a nice day!

<<inline: example.png>>

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to