Sign in to follow this  
manur

Floating point issue

Recommended Posts

. I have created a volume texture from a set of slices of USHORT values. . The data in these slices had values from 0 to 65535. . I wrote a shader program which can get a particular pixel from the volume texture. . When the value of the pixel exceeds 2048 it does not give the right value. . I came across a site:- http://www.3dcenter.org/artikel/nv40_technik/index3_e.php where they said about a precision problem when the value goes above 2048. . I am using 7800 GTX card. Will my card also have the same problem? . What should I do to regain from this trouble??

Share this post


Link to post
Share on other sites
The only practical solutions are:

1) Convert your textures to 0.0-1.0 range floating point.
2) Scale your values from 0-65535 to 0-2047 range integer.

If you are trying to avoid causing compatibility conflicts with cards that cannot do floating point textures, you should also consider that those cards probably won't be able to render your volumetric scene at usable speeds anyway.

Even the clunkiest and least inexpensive of the 6200 line supports fp16 (to some degree).

For what runs at 10-20fps on my 6800GT only runs at like 2-5fps on my colleague's 6200. When the problem arose that the 6200 doesn't do linear blend on fp16 textures, I thought for a moment about implementing a nearest neighbour blend fallback, but decided against it: it would look like hell, and at 2fps. What's the point? :)

Share this post


Link to post
Share on other sites
I didn't get the sentence convert textures to 0 - 1.0
If I scale the values from 0-65535 to 0-2047 then probably i will get floating point numbers. These numbers when I use for creating textures may again cause loss of precision. Regarding the different cards to be used I am working at it

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this