Jump to content
  • Advertisement
Sign in to follow this  
absriram

Bit planes and Precision

This topic is 5041 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello Guys, How many bits of precision can I have for the color plane. Can I have just one bit plane and more precision for my framebuffer? For eg. instead of having RGBA format with 8-bits in each plane, can i just have the red plane with 32 bits of precision. Also, in decimal representation, what is the precision of 24 & 32 bit floating point representations? Thank you, Sriram.

Share this post


Link to post
Share on other sites
Advertisement
Guys!

Can anyone tell me what precision do I get for color values with RGB having 8-bits each. In other words, is 0.345785 same as or different from 0.345789 if I have an 8-bit Red plane?

Thanks

Sriram

Share this post


Link to post
Share on other sites
I don't really understand what you mean.

An 8 bit component has a dynamic range of 256 values, and can therefore represent values from 0 to 255, inclusive. This is integer, as the standard opengl framebuffer is integer only.

On newer hardware, you can request higher precision render targets, with pretty much user defined layout (integer or floating point). You might experience a performance hit with those, sometimes a heavy one.

If you just need a single high range component, then you can combine the individual rgba components into a single 32bit channel in a fragment shader. This trick (packing) is commonly used to do cubic shadow mapping, for example.

Share this post


Link to post
Share on other sites
What I meant was, in OGL when usually specifying the colors using glColor3f function, we specify the colors as a floating point value between 0 and 1. So, in case of float values, what is the precision?

Thanks,

Sriram

Share this post


Link to post
Share on other sites
The colour resolution in the 0.0-1.0 range is of course just

1 / 255 ~= 0.0039 between intensity levels in each channel.

Share this post


Link to post
Share on other sites
Quote:
Original post by posit
The colour resolution in the 0.0-1.0 range is of course just

1 / 255 ~= 0.0039 between intensity levels in each channel.

Thats not correct, the precision is much higher on modern a GPU. The values specified using glColor are usually stored and processed as 32 bit floating point numbers. The floating point precision is kept through the entire vertex shader, although the actual floating point accuracy may vary from one GPU to the next. 17 bit are the minimum required by the specs, but full 32 bit (= single precision float) is common.

When transfered over to the fragment stage, resolution is reduced. On older GPUs, such as the GeForce3 and 4, precision is clamped to 9 bit integer values. On FX and newer Radeons, floating point precision is kept right into the fragment shader. Precision will usually be lower than in vertex programs, but the details depend on the GPU.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!