Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / 3D Theory & Graphics / c-buffer & perfect sorting Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
sqtz

July 21, 1999, 07:45 AM

hi!!

i'm learnig about reduce overdraw using a c-buffer. My question is: is it true
that i can't do perfect sorting( i.e. z-buffer) decreasing the level of overdraw??
I have see some code that use c-buffer & z-buffer but i think this zbuffer is not used for
visibility check.

sorry my english & thx in advance!!

 
Parashar Krishnamachari

July 21, 1999, 01:43 PM

sqtz wrote:
>>i'm learnig about reduce overdraw using a c-buffer. My question is: is it true
>>that i can't do perfect sorting( i.e. z-buffer) decreasing the level of overdraw??
>>I have see some code that use c-buffer & z-buffer but i think this zbuffer is not used for
>>visibility check.

Z-Buffers basically work by having every pixel in every polygon tested against data already in the Z-Buffer. If this pixel being tested is nearer to the user (basically lesser or greater Z-value, depending on your axis alignment) than the one already in the Z-Buffer, then you put it in. Otherwise, you leave the Z-Buffer alone. This process involves interpolation of Z-values, and a comparison for every pixel that will appear on the screen. It doesn't really remove overdraw, because every pixel is processed anyway, right? It's just so simple that it's well-suited to hardware.
Technically, Z-Buffers are not 100% accurate. When we talk pixels, we've obviously already projected all points to 2d space. Z is not a linear quantity in 2d space... 1/z is. This is the same idea behind perspective correction tmapping. Anyway, to get it really accurate, you'd need a 1/z-buffer. The algorithm is still fundamentally the same, though. Really, neither is used for a visibility check -- it just happens to be a nice end result of the algorithm. It does help to perform visibility checks before Z-buffering, anyway, because it's so slow. You might as well reduce the number of polys to process.
S-Buffers were meant to solve the speed problems by instead of breaking everything down to the pixel... you break it down to the scanline level. Tremendous improvement.
Well, with C-Buffers you just simplify S-Buffers to a specific case. In the special case that the polygons are pre-sorted, every polygon covers up those to follow. So no distinction is necessary between which span has which characteristics. The polys can be drawn directly after processing into the C-Buffer. The C-buffer only needs to contain data about what parts of the screen are covered. (hence "coverage"-buffer).
In any case, they happen to really be visibility solutions in their own right if you assume the inclusion of clipping to screen space and such.

- C.P.I. / ASMiNC

 
This thread contains 2 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.