Hi JP,

2009/8/19 J.P. Delport <jpdelp...@csir.co.za>

> Hi Adrian,
>
> mmm, I'm not sure about the
>
> setRenderTargetImplementation(osg::Camera::PIXEL_BUFFER_RTT)
>
> Do you need to use this?
>

FBO is also ok.


>
> I've only used float render targets with FBOs and I know they work without
> special contexts.
>
> ITO quality I suppose you mean you want to find out if actual float values
> end up in the texture? If so, you can read back an image and print values
> out. Select values that cannot be represented in bytes, e.g. 1e-12 or
> negative values and see if they come out OK.
>
> There is a path in osgmultiplerendertargets that does this. Look at the
> code for the options --image and --hdr.
>
> You could also experiment with other formats specific to NVidia, on my
> laptop e.g. 32F_ARB does not work, but the others do. From the example:
>
> // Default HDR format
>            textureRect[i]->setInternalFormat(GL_RGBA32F_ARB);
>
>            // GL_FLOAT_RGBA32_NV might be supported on pre 8-series GPUs
>            //textureRect[i]->setInternalFormat(GL_FLOAT_RGBA32_NV);
>
>            // GL_RGBA16F_ARB can be used with this example,
>            // but modify e-12 and e12 in the shaders accordingly
>            //textureRect[i]->setInternalFormat(GL_RGBA16F_ARB);
>
>
i have to play with the different parameters

/thanks
adrian


>
> rgds
> jp
>
>
>
>
> Adrian Egli OpenSceneGraph (3D) wrote:
>
>> 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
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
> --
> This message is subject to the CSIR's copyright terms and conditions,
> e-mail legal notice, and implemented Open Document Format (ODF) standard.
> The full disclaimer details can be found at
> http://www.csir.co.za/disclaimer.html.
>
> This message has been scanned for viruses and dangerous content by
> MailScanner, and is believed to be clean.  MailScanner thanks Transtec
> Computers for their support.
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
********************************************
Adrian Egli
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to