Page 1 of 2 12 LastLast
Results 1 to 10 of 14

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

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2002
    Posts
    10

    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. #2
    Senior Member OpenGL Pro
    Join Date
    Feb 2002
    Location
    Bonn, Germany
    Posts
    1,633

    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. #3
    Junior Member Newbie
    Join Date
    Apr 2002
    Posts
    10

    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. #4
    Member Contributor
    Join Date
    Mar 2002
    Location
    Figueira da Foz, Portugal
    Posts
    84

    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. #5
    Junior Member Newbie
    Join Date
    Apr 2002
    Posts
    10

    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. #6
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Nov 2010
    Posts
    2,466

    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. #7
    Junior Member Newbie
    Join Date
    Apr 2002
    Posts
    10

    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. #8
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    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. #9
    Junior Member Newbie
    Join Date
    Apr 2002
    Posts
    10

    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. #10
    Junior Member Newbie
    Join Date
    Apr 2002
    Posts
    10

    Re: How big exactly is 16bit depth???

    .

Page 1 of 2 12 LastLast

Similar Threads

  1. Trying to put 16bit Data in 1 channel
    By Ftored in forum OpenGL: Advanced Coding
    Replies: 24
    Last Post: 05-22-2008, 11:13 AM
  2. 16bit depth + FBO
    By zed in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 04-08-2006, 11:01 AM
  3. 16bit rgb image
    By chiwei in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 06-09-2002, 07:17 AM
  4. about 16bit texture
    By Nil_z in forum OpenGL: Advanced Coding
    Replies: 11
    Last Post: 01-17-2001, 08:26 PM
  5. about 16bit texture
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-17-2001, 10:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean