I’m trying to understand what the “Overdraw” mode in Unity’s Scene view Control Bar is actually visualizing, because it doesn’t seem to visualize actual overdraw.
The common definition of overdraw is (link):
… which makes perfect sense to me.
In order to reduce overdraw, we use opaque materials and render those objects front-to-back. This causes the depth buffer to get filled and it’s used to reject pixels from objects that would be rendered next, behind those.
However, if I look at the overdraw visualization in Unity, it shows overdraw even for opaque objects that are rendered in front-to-back order. This does not make sense to me.
If overdraw is defined as “same pixel is drawn multiple times”, then the visualization seems to be wrong, because the pixel is not drawn multiple times in this case. The pixels’ depth value is tested multiple times, but the pixel isn’t written multiple times.
I did set up a test project and I double-checked it in RenderDoc. The area where the two opaque objects overlap, pixels are written only once.
Therefore, I don’t understand what the Overdraw mode in Unity is actually visualizing, because it can’t be how often the same pixel was drawn and I hope someone can shed some light into that.
I recorded a video where I go over these steps.