Hi Carsten,
what I need is a copy of the pixel data. Your proposed method implies an
fboviewport->setReadBuffer(true) (with an heavy glReadPixels!), which would be
too slow for my needs. Is there any faster method like a glCopy that I could
use out-of-the-box? Or I should extend the fboviewport functionality myself?
Thanks for your help,
Stefano
Scrive Carsten Neumann <[EMAIL PROTECTED]>:
> [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);
>
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
-------------------------------------------------------------------------
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