Bit planes and Precision

Started by
4 comments, last by imaginary 19 years, 4 months ago
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.
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
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.
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
The colour resolution in the 0.0-1.0 range is of course just

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

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.

This topic is closed to new replies.

Advertisement