Paul Hsieh heeft op Ace's Hardware een interessant stukje gepubliceerd over tile-based rendering. Zoals langzamerhand de meeste mensen zullen weten heeft de ATI Radeon kaart een feature genaamd Hyper-Z om de geheugen performance wat omhoog te krikken. Hoe deze feature werkt heeft ATI ons niet verteld maar Paul Hsieh is hard gaan nadenken, en met de onderstaande manier op de proppen gekomen waarop Hyper-Z misschien is gebaseerd:
- If the triangle intersects with all four corners of the tile then the tile Z max is set equal to the minimum value of the tile Z max and the maximum triangle Z value.
- If the minimum triangle Z is greater than the tile Z max then the triangle is ignored and no updating occurs for this tile.
- If the maximum triangle Z is less than or equal to the minimum tile Z value, every point of the triangle in that tile will render "on top." Therefore rendering can be done in a "write only mode" (for both pixels and Z-values). Thus, the read-compare mechanism (which is ordinarily in the critical path of the rendering pipeline) can be turned off. The tile Z buffer is then updated with a new minimum tile Z value equal to the minimum triangle Z value. Of course, for Alpha blended pixels, the Z buffer and frame buffer are still read and combined as normal.
- If neither (2) or (3) occur then the tile Z min value is updated with the min(triangle minimum Z value, tile Z min). The triangle is then rendered in this tile as regular pixel-by-pixel "read Z from Z buffer, compute triangle Z, compare then conditionally write" (with the standard modifications for alpha blending).
- When the Z-buffer is "cleared," the corresponding tile Z values for each tile that is completely overwritten are set to the fill value. For partial tile overwriting, just the tile Z min value is set to the minimum of the fill value and the existing tile Z min value.
- If for whatever reason, there is a BitBlit to the Z-buffer (I have no idea why anyone would do this) the engine can either do a pixel by pixel analysis to find the tile Z values, or can simply default to the most conservative settings of setting the tile Z max value to the far plane value (or just the maximum legal Z value) and the minimum tile Z value to the near plane (or just the minimum visible/legal Z value.)