Hi all,

How can i test the GL_RGBA32F_ARB render to texture quality. i don't know
whether i did a mistake in programming or my Nivida quadra fx 570m with
windows vista driver doesn't support it.
Or do i have to generate an own graphic context for enabling this feature?

/regards
adrian


// texture
    _RTTInfoPreprocessingBackFront._texture = new osg::Texture2D;

_RTTInfoPreprocessingBackFront._texture->setTextureSize(_RTTInfoPreprocessingBackFront._resolution_x,
_RTTInfoPreprocessingBackFront._resolution_y);
    #ifndef USE_FOR_RTT_FLOAT_IMAGE
        _RTTInfoPreprocessingBackFront._texture->setInternalFormat(GL_RGBA);
    #else

_RTTInfoPreprocessingBackFront._texture->setInternalFormat(GL_RGBA32F_ARB);
        _RTTInfoPreprocessingBackFront._texture->setSourceFormat(GL_RGBA);
        _RTTInfoPreprocessingBackFront._texture->setSourceType(GL_FLOAT);
    #endif

_RTTInfoPreprocessingBackFront._texture->setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR);

_RTTInfoPreprocessingBackFront._texture->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);

_RTTInfoPreprocessingBackFront._texture->setResizeNonPowerOfTwoHint(false);

    // camera
    _RTTInfoPreprocessingBackFront._camera = new osg::Camera;

_RTTInfoPreprocessingBackFront._camera->setClearColor(osg::Vec4(0.0f,0.0f,0.0f,1.0f));
    _RTTInfoPreprocessingBackFront._camera->setClearMask(GL_COLOR_BUFFER_BIT
| GL_DEPTH_BUFFER_BIT);

_RTTInfoPreprocessingBackFront._camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
    // set viewport

_RTTInfoPreprocessingBackFront._camera->setViewport(0,0,_RTTInfoPreprocessingBackFront._resolution_x,_RTTInfoPreprocessingBackFront._resolution_y);
    // set the camera to render before the main camera.

_RTTInfoPreprocessingBackFront._camera->setRenderOrder(osg::Camera::PRE_RENDER);
    // tell the camera to use OpenGL frame buffer object where supported.

_RTTInfoPreprocessingBackFront._camera->setRenderTargetImplementation(osg::Camera::PIXEL_BUFFER_RTT);
    // image
    _RTTInfoPreprocessingBackFront._image=new osg::Image;
    #ifndef USE_FOR_RTT_FLOAT_IMAGE

_RTTInfoPreprocessingBackFront._image->allocateImage(_RTTInfoPreprocessingBackFront._resolution_x,
_RTTInfoPreprocessingBackFront._resolution_y,  1, GL_RGBA,
GL_UNSIGNED_BYTE);
    #else

_RTTInfoPreprocessingBackFront._image->allocateImage(_RTTInfoPreprocessingBackFront._resolution_x,
_RTTInfoPreprocessingBackFront._resolution_y,  1, GL_RGBA, GL_FLOAT);
    #endif

_RTTInfoPreprocessingBackFront._camera->attach(osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER),
_RTTInfoPreprocessingBackFront._image.get(),0,0);
    _RTTInfoPreprocessingBackFront._camera->setPostDrawCallback(new
WriteCameraPostDrawCallback(_RTTInfoPreprocessingBackFront._image.get(),"RTTInfoPreprocessingBackFront.png",false));

_RTTInfoPreprocessingBackFront._texture->setImage(0,_RTTInfoPreprocessingBackFront._image.get());


-- 
********************************************
Adrian Egli
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to