Dithering > clipping

Recently I made the camera zoom in while the player performs certain actions. This looked good in most cases, except when there are tall objects between the player and the camera. It’s looks very strange and immersion breaking when the game camera clips through objects.

So I wrote a dithering transparency function in my standard shader that adjusts the dithering amount based on the distance from the camera. It uses bayer matrix pattern and pixel discarding, so it’s not true transparency (which would be expensive). It looks so much better than unnatural clipping!

I think this is a standard technique for 3rd person games. When camera gets too close to objects, or when there’s an object between the camera and the player, objects become dithered or transparent. I noticed it while playing Sekiro recently, Super Mario Odyssey does a similar thing, and Uncharted 4 does it too. Thank you to Ming-Lun Chou for sharing this technique - it didn’t take me long to figure this out because I remembered reading about it on his postmortem.