[osg-users] GL_RGBA32F_ARB Pixel Buffer

Steven Powers osgforum at tevs.eu
Tue Mar 10 11:46:43 PDT 2009


I'm getting all 0s for my pixel buffer when I use GL_RGBA32F_ARB as the pixel format.
It works fine with GL_RGBA.

This is how I set it up:

                i = new osg::Image();
                i->setPixelFormat(GL_RGBA32F_ARB);
                i->setDataType(GL_FLOAT);
              camera->attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER0),i.get());
           camera->setRenderOrder(osg::Camera::PRE_RENDER);
           camera->setRenderTargetImplementation(osg::Camera::PIXEL_BUFFER);

Then when I try to retrieve the pixel values:

        if (_image.valid() && _image.get() && _image.get()->data())
        {

            float *tempData = (float*)_image.get()->data();
            for (int i = 0; i < sliceVPX * sliceVPY; i+=4)
            {

                    debug<<Debug::info<<"Pix ["<<i<<"] = "<<tempData[i]<<", "<<tempData[i+1]<<", "<<tempData[i+2]<<", "<<tempData[i+3]<<"\n";

            }
        }


I get all zeros. 

Can anyone help me out. again using GL_RGBA and GL_UNSIGNED_BYTE works fine.

I'm using OSG 2.2

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8184#8184








More information about the osg-users mailing list