[osg-users] glCopyTexImage2D or Frame Buffer Object

Robert Osfield robert.osfield at gmail.com
Tue Apr 19 08:03:03 PDT 2011

Hi Martin,

FBO's do support multi-sampling - but the setup is different from the
frame buffer set up of multi-sampling, instead you you provide the
settings when you call Camera::attach().  The relevant methods are:

        /** Attach a Texture to specified buffer component.
          * The level parameter controls the mip map level of the
texture that is attached.
          * The face parameter controls the face of texture cube map
or z level of 3d texture.
          * The mipMapGeneration flag controls whether mipmap
generation should be done for texture.*/
        void attach(BufferComponent buffer, osg::Texture* texture,
unsigned int level = 0, unsigned int face=0, bool
            unsigned int multisampleSamples = 0,
            unsigned int multisampleColorSamples = 0);

        /** Attach a Image to specified buffer component.*/
        void attach(BufferComponent buffer, osg::Image* image,
            unsigned int multisampleSamples = 0,
            unsigned int multisampleColorSamples = 0);

As for anaglyphic stereo, this is managed currently by
osgUtil::SceneView for frame buffers where it sets up two traversals
one for each eye, and sets up the color write mask to render the cyan
and red for the left and right eye traverals.  A straight render to
texture Camera won't use this higher level feature, if you want to
implement stereo within a render to texture camera you'll need to
manage the left/right eye passes as a subgraph of the Camera, or have
two Camera and share the same FBO.


2011/4/19 "Martin Großer" <Grosser.Martin at gmx.de>:
> Hello,
> Few month ago, I got an application, which realized a "render to texture" with glCopyTexImage2D(GL_TEXTURE_2D,0,...) and the antialiasing and the anaglyphic works well. Today I tried the render-to-texture with the frame buffer object as render target for the osg::Camera and in this case the antialiasing doesn't work. Also the anaglyphic view doesn't work.
> Why did antialiasing and anaglyphic work with glCopyTexImage2D?
> I have read that the frame buffer object doesn't support antialiasing, is it true?
> Thanks
> Martin
> --
> GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit
> gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

More information about the osg-users mailing list