Main Menu

Zbit Depth Buffering

Started by kevin, January 06, 2015, 09:28:10 AM

Previous topic - Next topic

kevin

 Zbit Depth Buffering Library /demo

    This library demo was built in PlayBASIC using PlayBASIC2DLL for the final translation to machine code and shows a method of removing overdraw from heavily occluded scenes.    The methods boils down to keeping bit masks for each run of 32 pixels.   Rather than drawing pixels we insert our required fragment masks into the zbuffer and it works out if the fragment is visible or not.  Fragments that are occluded than aren't drawn.  This works best in scenes with lots and lots of overdraw, as there seems to be a break even point around 25 objects on my test system (9 years old).  You only have to render a few hundred and it's a lot quicker than brute forcing it.

    The attached source code (You'll need PlayBASIC V1.64P2 to run it) includes 2 modes , the first Zbit buffering mode and the second is the regular PlayBASIC camera scene version of it.  You can control the number of the objects in the source.    The blob in the front is made simply by overlapping lots of circles.  
 
   Related To:

        *  bit based z buffering  / occlusion


   Download Attached: