Decals using depth buffer (soft particles)

Hi guys, has anyone ever thought of making decals using a depth buffer? I had the idea to invert the transparency and make the decals visible only near the surface. In this case, if the decal is on the edge of the model, then the part that goes beyond the limits will be invisible. What do you think?

Indeed. That’s actually explicitly how deferred decals already work! Though usually they use the depth to also calculate the UV.

But a form more similar to what you’re describing ere used extensively in Sucker Punch’s Infamous: Second Son for on-character decals. They did a GDC talk on this 11 years ago, here’s the section where they show of how they used it.

More recently, Tuatara posted an example with a minor tweak on the idea make these kinds of decals very cheaply look like they’re conforming to a surface.
https://x.com/Tuatara_Games/status/1887561903251333217

It’s also a common way to do faked real time lights or glows very cheaply.

Some of the first games to use “decals” at all in the way we think of them today were implemented in this exact way, usually for things like bullet holes. Monolith’s (RIP) F.E.A.R. had extremely impressive bullet impacts on surfaces. They’re likely most remembered for being one of the first implementations of parallax occlusion mapping, but they were also just quads that were up against the wall like many previous games… ones that used the depth buffer to make sure they wouldn’t be seen hanging off of corners, which previous games would have.

4 Likes

Thank you, so it’s not something new :sweat_smile: