Hi Stefano,

[EMAIL PROTECTED] wrote:
 >> Hi there,
 >>    i was looking for some kind of method to copy a FBOViewport
 >> GL_COLOR_ATTACHMENTX TextureChunk into another TextureChunk..
>> something like
> TextureChunkPtr copiedTex = TextureChunk::create();
> fboviewport->copyToTexture( GL_COLOR_ATTACHMENT0_EXT, copiedTex );
>                                                       ^^^^^^^^^
> sorry for the typo. Also, in case I'll have to extend the FBOViewport myself,
> what could be the best opengl command to use?

do you need a copy of the actual pixel data of the texture (e.g. because 
you want to change them without affecting the original data) or do you 
just want to use the data in another texture?

For the first case you would have to create a copy of TextureChunks Image:

ImagePtr        texImg    = fboviewport->getTextures[0]->getImage();
ImagePtr        copiedImg = Image::create();
TextureChunkPtr copiedTex = TextureChunk::create();

beginEditCP(copiedImg);
     copiedImg->set(texImg);
endEditCP  (copiedImg);

beginEditCP(copiedTex);
     copiedTex->setImage(copiedImg);
endEditCP  (copiedTex);

For the second case just add the image to a second TextureChunk:

ImagePtr        texImg    = fboviewport->getTextures[0]->getImage();
TextureChunkPtr copiedTex = TextureChunk::create();

beginEditCP(copiedTex);
     copiedTex->setImage(texImg);
endEditCP  (copiedTex);

        Hope it helps,
                Carsten

>> but unfortunately there's nothing like that :) Is there any high-level OpenSG
>> tecnique I could use to achieve this result or do I have to extend
>> FBOViewport myself?



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to