Re: [Algorithms] Depth-Sorting Axis-Aligned Boxes
Brought to you by:
vexxed72
|
From: Bert P. <be...@bp...> - 2009-08-03 15:03:11
|
metanet software schreef: >> Unfortunately, this is the classic polygon sorting problem. > > This is what I was afraid of; aside from the cost of building a BSP every frame, the more fundamental problem is that the graphics are sprites and not really amenable to arbitrary splitting. I was hoping in the worst case that I could split them up to have one sprite per face (top, front, side, etc), but it would appear that even that is too coarse. > > So, I'm screwed? If what's stopping you from using a ZBuffer is memory or performance, you can try a span-list based system; at every scanline, you keep track of which poly's overlap it, then you analytically compute the spans of pixels that are visible due to every polygon edge or intersection. See quake1. If the sprites in turn have an alpha mask, you can still make it work by converting the sprites into several spans (ie. RLE compression; see, uh, 'Divinity'). bert |