Hi there,
I'm trying to copy the render of a viewport into a texture with a
TextureGrabForeground to do some multipass.. here's my code..

        ImagePtr img = Image::create();
        addRefCP(img);
        beginEditCP(img);
                img->set(Image::OSG_RGBA_PF,1);
        endEditCP(img);

        TextureChunkPtr tex = TextureChunk::create();
        addRefCP(tex);
        beginEditCP(tex);
                tex->setImage(img);
                tex->setMinFilter(GL_NEAREST);
                tex->setMagFilter(GL_NEAREST);
                tex->setInternalFormat(GL_RGBA8);
                tex->setExternalFormat(GL_RGBA);
                tex->setScale(true);
        endEditCP(tex);

        TextureGrabForegroundPtr tg = TextureGrabForeground::create();
        addRefCP(tg);
        beginEditCP(tg);
                tg->setTexture(tex);
        endEditCP(tg);

is there something wrong in these lines? Cause the alpha channel is
1.0 everywhere.. even if the shader i used to render the viewport in
the previous step has a global alpha of 0.5!

Thanks,
Stefano

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to