# Thread: How big exactly is 16bit depth???

1. ## How big exactly is 16bit depth???

Hi, I am using Windows 98 and when I set up the PIXELFORMATDESCRIPTOR I am tasked to tell OpenGL my depthbuffer, i searched around the net and found no answer but instead codes that put the number 16 on the depthbuffer field. So my question is, if I put 16 on the depthbuffer field, does it mean that my polygons could have the value up to 2^16??? Thanks in advance.

2. ## Re: How big exactly is 16bit depth???

You put your desired depth buffer bit depth (not a type) in there. You can also insert zero to let OpenGL make the choice for you.
16bit means your z values have 16bit precision, this has almost nothing to do with actual representation and values in the card's memory.
The actual range of depth values is controlled by the projection matrix.

3. ## Re: How big exactly is 16bit depth???

i'm sorry, but i don't understand...if i have 16bit precision, what does that mean? thanks. I'm obviously a beginner here...

4. ## Re: How big exactly is 16bit depth???

Normally the near clip plane has the value 0 and the far clip plane has the value 1 in terms of depth. The depth values of every pixel rendered are always between 0 and 1.

16 bits is just the precision of the floating point format used to represent that number. The smaller the precision, the more "rounding" is made when calculating the depth value of a pixel, so there are more chances of errors in such calculations.

If you don't know what a projection matrix is, you really should read the Red Book. It's not very easy to explain in a few words.

[This message has been edited by t0y (edited 04-21-2002).]

5. ## Re: How big exactly is 16bit depth???

oh...ok, thanks for the reply guys! i'll search the net for further info regarding this problem of mine...

6. ## Re: How big exactly is 16bit depth???

2^16 = 65,536
2^24 = 16,777,216

thus with 16 bit depth buffer u can only have approx 65,000 different depth values which shows that z fighting can easily happen (esp far from the camera)

a good description is available here http://www.sjbaker.org/steve/omniv/index.html
also check the faq
(16bit or 15?)

7. ## Re: How big exactly is 16bit depth???

ok, so far, here's what i understand, please let me know if I'm super-wrong!

when you have 16bit precision, it means you have up to 16 numbers after the decimal point of your floating number. Is this correct? thanks.

8. ## Re: How big exactly is 16bit depth???

You are on the right track. The number of bits decides the precision of the number, which is more or less the number of decimals.

If you have 16 bit's of precision, the smalles change in the number can be 1/(2^16) = 0.000015. That means you have about 4-5 correct decimals. Or to be correct, values, not decimals.

9. ## Re: How big exactly is 16bit depth???

i see, and since my near clip plane is 0 and my far clip plane is 1, the change in my z-values could be at a range of 1/(2^16)??? Ohh...I think I got it now...thanks!

Oh yeah, since I know that my change is z-value could be 1/(2^16), then does it mean that THAT value is the minimum value I could add (or subtract) to, say, another vertex so there's no z-fighting? Is this what 16bit depth buffer means?

a great thanks to those guiding me here so far!

10. ## Re: How big exactly is 16bit depth???

.

Page 1 of 2 12 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•