Hello Vincenzo,

Vincenzo Marafioti wrote:
>> It seems you are using OpenSG 1.8, where you'd create an FBOViewport and 
>> some TextureChunks to write the multiple render targets. You then add 
>> the same TextureChunks to the material that also holds your SHLChunk and 
>> set the uniform variables as above.
>> Let us know if you need more details on any of these steps.
>>   
> 
> Thank you for the answer. I have some other doubts:
> 1 )
> when i have to pass OpenGL texture as a textureChunk (attached to the 
> material with the shl) i think i need some method to set texture chunk 
> data point to the currently OpenGL texture data already in memory 
> written from the previous openGL shader.

you can not pass an OpenGL texture into a TextureChunk. You create the 
TextureChunk, add an Image (but when calling Image::set() you pass Null 
for the data pointer). That gives you a texture that only resides on the 
graphics card.

> Texture chunk data can be an 
> image, loaded from disk but i do not know if it possible to make its 
>  data to point to an already binded OpenGL texture.

no, the TextureChunk has to have an Image, but for a texture that only 
resides on the gfx card you can have no data on the image (i.e. the 
pixels field is empty).

> I do not wat to save 
> OpenGL texture to disk and then load it as Image due to the poor 
> performance. How can i do?
> 
> 2)
> can you give me some example to make Multi Render Target in OpenSG? The 
> shader i will "run" in openSG has to write into 3 mrt (in OpenGL i used 
> glDrawBuffer(...) and then used gl_FragData[0], gl_FragData[1], 
> gl_FragData[2] in the shader).

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

------------------------------------------------------------------------------
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