Hi,

[email protected] wrote:

Hi everyone,

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

I don't think you will reach this with single precision floating point.


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.

What video card do you have?


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

Two options maybe:

1) Double precision float path. You will have to first get hardware that supports it and I think you will probably have to look at CUDA. I'm not sure which cards do this, have a look at the CUDA documentation. Other problem is that I don't know of double precision floating point texture formats that will work easily with OSG.

2) If your data can be split (ito precision) across multiple colour channels you might be able to do some arithmetic in shaders yourself.

See also here:
http://www.gpgpu.org/wiki/FAQ

I don't have much experience with either of 2 options above, so if someone else has some concrete info I would also be interested.

rgds
jp


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

--
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
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to