Hi everyone,

I would like to use osg PPU to compute very accurate data, about ten number behind the comma, to avoid numerical errors.

So I used 32 bits textures for the render to texture :
texture2D->setInternalFormat(GL_RGBA32F_ARB);
texture2D->setSourceFormat(GL_RGBA);
texture2D->setSourceType(GL_FLOAT);
                        
texture2D->setWrap(osg::Texture2D::WRAP_S,osg::Texture2D::CLAMP_TO_BORDER);
texture2D->setWrap(osg::Texture2D::WRAP_T,osg::Texture2D::CLAMP_TO_BORDER);
texture2D->setWrap(osg::Texture2D::WRAP_R,osg::Texture2D::CLAMP_TO_BORDER);
texture2D->setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::NEAREST);
texture2D->setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::NEAREST);


But I noticed, by exemple, when I put the value 0.012024048 in one shader (gl_FragColor = vec(0.012024048, 0.012024048, 0.012024048, 1.0);),
the value read in the next shader becomes 0.012023926.
I checked the values twice, once with the glsl Devil debugger, once with an UnitOutCapture.

Is there a way to have more precision for my data ?

Thanks in advance,
Josselin.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

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

Reply via email to