Z-Buffer FAQ?

Discussion in 'Architecture and Products' started by Jimmers, Jul 6, 2004.

  1. Jimmers

    Newcomer

    Joined:
    Apr 29, 2004
    Messages:
    179
    Likes Received:
    6
    Location:
    ~/
    Is there a good explanation of z-buffer anywhere on the net?

    If not, here's what I'm asking about. I use RadLinker to get program specific driver settings. There's a pull down menu titled "Z-Buffer Depth", and it has the following options.
    - 16
    - 16,24
    - 16,24;8 bit stencil
    - 16,24,32
    - 16,24,32;8 bit stencil
    What do there different options do? Are these referring to FP16, FP24, FP32, etc?
     
  2. K.I.L.E.R

    K.I.L.E.R Retarded moron
    Veteran

    Joined:
    Jun 17, 2002
    Messages:
    2,952
    Likes Received:
    50
    Location:
    Australia, Melbourne
    Depth precision = Z/W-Buffer.

    Radeon's don't have a W-Buffer though.

    It has nothing to do with color precision.

    Stencil buffer is used for shadows/reflections.

    Some games have an option for 24bZ/32bZ.
    24b Z Buffer is the highest accuracy you can achieve, the extra 8-bits are for the stencil buffer.

    That doesn't apply for all cards, eventually we will see a 64b Z-Buffer + 24b stencil. ;)

    I'm just assuming you have an R3xx/X8xx.
     
  3. j^aws

    Veteran

    Joined:
    Jun 1, 2004
    Messages:
    1,909
    Likes Received:
    8
    A link to Z-buffer

    Edit:

    For what tech/cards are you referring to for 24 bit the highest accuracy? :?
     
  4. KimB

    Legend

    Joined:
    May 28, 2002
    Messages:
    12,908
    Likes Received:
    218
    Location:
    Seattle, WA
    The short of it:
    A z-buffer is a buffer that stores the depth (z) value of each pixel on the screen. This allows triangles to be sent to the GPU in any order, with those behind already-rendered triangles being thrown out, and those in front being rendered, updating the depth stored in the z-buffer at the same time.

    The different numbers associated with the z-buffer are precision values. More precision means objects can get closer before the hardware has a hard time figuring out which one is in front. When they get too close for the chosen precision, you'll typically get flickering. Ever seen a decal (explosion blast or blood) in UT or some other game flicker? Particularly when viewed from a large distance (i.e. through a sniper rifle sight)? That's a z-buffer error.

    The W-buffer basically acts like a z-buffer, but has a different spread of where the errors occur. Stencil buffers are typically connected to the z-buffer, and can be used for any number of effects. They have the same characteristics as a z-buffer (i.e. they can be used to accept or reject pixels on a per-pixel basis), but can be modified in many ways. One way is to render shadows, where the stencil buffer is used to determine whether a pixel is in shadow or not.
     
  5. K.I.L.E.R

    K.I.L.E.R Retarded moron
    Veteran

    Joined:
    Jun 17, 2002
    Messages:
    2,952
    Likes Received:
    50
    Location:
    Australia, Melbourne
    "I'm just assuming you have an R3xx/X8xx."
     
  6. KimB

    Legend

    Joined:
    May 28, 2002
    Messages:
    12,908
    Likes Received:
    218
    Location:
    Seattle, WA
    I'm pretty sure no consumer card currently supports higher than a 24-bit z-buffer. I do know that 3DLabs supports a 32-bit z-buffer, but consumer cards elect to pack the z- and stencil-buffers into one to save performance, which limits the possible precision.
     
  7. j^aws

    Veteran

    Joined:
    Jun 1, 2004
    Messages:
    1,909
    Likes Received:
    8
     
  8. KimB

    Legend

    Joined:
    May 28, 2002
    Messages:
    12,908
    Likes Received:
    218
    Location:
    Seattle, WA
    It's just 24-bit z and 8-bit stencil.
     
  9. j^aws

    Veteran

    Joined:
    Jun 1, 2004
    Messages:
    1,909
    Likes Received:
    8
    Thanks for clearing that up...the last PC card I owned was a 3Dlabs which had 32 bit z. Thought the industry had moved onto 32 bit z by now. :)
     
  10. KimB

    Legend

    Joined:
    May 28, 2002
    Messages:
    12,908
    Likes Received:
    218
    Location:
    Seattle, WA
    Nope. I think GPU manufacturers have decided the performance hit of separating the stencil and z-buffers isn't worth the increase in visual quality for games.
     
  11. DeanoC

    DeanoC Trust me, I'm a renderer person!
    Veteran Subscriber

    Joined:
    Feb 6, 2003
    Messages:
    1,469
    Likes Received:
    185
    Location:
    Viking lands
    There are also options for integer or float depth buffers. A float buffer using 1-z is very close to a w-buffer without the problems.

    Many modern cards support very few actual depth buffers options any more.

    D24S8 24 bit integer depth, 8 bit stencil
    D24X8 24 bit integer depth, 8 bit unused
    F24S8 24 bit float depth, 8 bit stencil
    F24X8 24 bit float depth, 8 bit stencil.

    Apart from bandwidth, another reason for sticking both buffers together is related to hierachical Z, seperate them and you generally lose hierachical stencil.
     
  12. Mendel

    Mendel Mr. Upgrade
    Veteran

    Joined:
    Nov 28, 2003
    Messages:
    1,350
    Likes Received:
    17
    Location:
    Finland
    I too recently installed radlinker and I was wondering especially about which to choose from these 3 modes?

    So could you please tell me in point by point fashion if there is any difference among them? As far as I could tell according to discussion here so far, they should all act the same, 24 bit z buffer + 8 bits for stencil but then again I'm confused.
     
  13. Simon F

    Simon F Tea maker
    Moderator Veteran

    Joined:
    Feb 8, 2002
    Messages:
    4,560
    Likes Received:
    157
    Location:
    In the Island of Sodor, where the steam trains lie
    Kyro has a 4 bit stencil. What might that suggest to you?

    Hmmm... I'm tempted to add a few comments and references to that.
     
  14. KimB

    Legend

    Joined:
    May 28, 2002
    Messages:
    12,908
    Likes Received:
    218
    Location:
    Seattle, WA
    Since the Kyro stores its depth buffer on-board, I see no reason why it has to link the two buffers at all. Regardless, I said, "currently." The Kyro is sufficiently defunct to not be considered a current consumer video card anymore.
     
  15. Simon F

    Simon F Tea maker
    Moderator Veteran

    Joined:
    Feb 8, 2002
    Messages:
    4,560
    Likes Received:
    157
    Location:
    In the Island of Sodor, where the steam trains lie
    Think about it.
     
  16. KimB

    Legend

    Joined:
    May 28, 2002
    Messages:
    12,908
    Likes Received:
    218
    Location:
    Seattle, WA
    Doesn't matter either way. It's not a current consumer card.

    Still, got a doc that states the depth accuracy of the Kyro?
     
  17. Quitch

    Veteran

    Joined:
    Jun 11, 2003
    Messages:
    1,521
    Likes Received:
    4
    Location:
    UK
    ChrisW is the author of RadLinker IIRC and he visits these boards sometimes. Might be worth sending him a PM (and let me know the result :)).

    Can someone explain the stencil concept a bit more. Right now I see there's no purpose to selecting a 32 option, that's either future proofing, or redundant registry values. However, what's the difference between selecting 24 bit and 24bit 8bit stencil?

    I also wonder, if you select a value too high for the card, what does it fall back to? Do the values above suggest that it tries 32, then 24 then 16?
     
  18. KimB

    Legend

    Joined:
    May 28, 2002
    Messages:
    12,908
    Likes Received:
    218
    Location:
    Seattle, WA
    Basically, you get to use the stencil buffer. You can increase or decrease the value in the stencil buffer, as well as perform a test against the stencil buffer (for example, throw a pixel out if the value in the stencil buffer is nonzero).

    This has been used for some time for shadowing, and Humus recently produced a demo that used the stencil buffer to implement a multipass dynamic branching technique.
     
  19. Quitch

    Veteran

    Joined:
    Jun 11, 2003
    Messages:
    1,521
    Likes Received:
    4
    Location:
    UK
    Does that mean that 24bit 8bit stencil indicates that 8bits of those 24 are being dedicated to the stencil buffer? Is that a good trade?
     
  20. Simon F

    Simon F Tea maker
    Moderator Veteran

    Joined:
    Feb 8, 2002
    Messages:
    4,560
    Likes Received:
    157
    Location:
    In the Island of Sodor, where the steam trains lie
    No, it means 24+8 so that it fits into a nice round power of 2.
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...