Z-fighting and tile-based rendering

When you draw two things exactly on top of each other, the GPU can't decide which one draws in front, and you get an effect called z-fighting. On most GPUs z-fighting manifests as an even pattern across all the affected pixels. But on the iPhone and iPad's tile-based GPUs, each tile has its own take on the pattern. It's like a quilt of roundoff error.

I was fooling with Degrees this morning, and I saw z-fighting where an asteroid was being drawn inside the solid part of a level. Tiles are just units of work for the GPU, so they're not supposed to be visible. But here they are. You can feel out how the inputs (shaded, clipped triangles) are different across each tile, and how that can have real consequences for how things are drawn.

Z-fighting is actually much more distracting to the player on tile-based GPUs than on standard GPUs. These patterns flicker and rearrange themselves if you rotate even a little, because the roundoff error resolves differently per title per angle. So the quilt has a time axis. It's a hyperquilt.

Actually I think it kind of looks grungy and cool, and I could use it as part of Degrees's style for occasional effects. But it's probably a health hazard for some players, so I'll pass.

PrintView Printer Friendly Version

EmailEmail Article to Friend

References (9)

References allow you to track sources for this article, as well as articles that were written in response to this article.
  • Response
    seiko ジウジアーロ
  • Response
    Response: heated gloves
    Degrees, a game in progress for iPad and iPhone - Development Blog - Z-fighting and tile-based rendering
  • Response
    Degrees, a game in progress for iPad and iPhone - Development Blog - Z-fighting and tile-based rendering
  • Response
    Response: Rival Knights
    Degrees, a game in progress for iPad and iPhone - Development Blog - Z-fighting and tile-based rendering
  • Response
    Response: elsalumni
    Degrees, a game in progress for iPad and iPhone - Development Blog - Z-fighting and tile-based rendering
  • Response
    Degrees, a game in progress for iPad and iPhone - Development Blog - Z-fighting and tile-based rendering
  • Response
    Degrees, a game in progress for iPad and iPhone - Development Blog - Z-fighting and tile-based rendering
  • Response
    Response: TheHoopsReport
    I really wanted to make a brief comment in order to appreciate you for these nice strategies you are giving out on this site. My particularly long internet look up has finally been compensated with reliable content to go over with my neighbours. I �d say that many of us readers ...
  • Response

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
« Things learned at ECGC 2012, part two | Main | The scaffolding approach and background loading »