Like in this video https://youtu.be/Sy_dUtFCAC4
This functionality isn’t built into Defold, so you’d have to implement it yourself. There are a few ways I’m aware of regarding how to do it:
- Dynamically create a mesh that represents the decal, and fit the mesh perfectly on top of whatever geometry the decal is supposed to be projected on. As far as I know, this is computationally difficult / tedious. Here’s an old blog post about how to do it: https://www.wolfire.com/blog/2009/06/how-to-project-decals/
- Fake it or approximate it by using a sprite that represents the decal, and placing it wherever it should be. This won’t work if the decal needs to be projected onto an uneven surface, or on an edge or corner.
- Draw the decal in screen-space, either as part of a deferred rendering pipeline, or a post-processing effect. Here’s a place to start reading, which contains links to other material: Decals (deferred rendering) | IceFall Games
I’ve been working on a deferred rendering pipeline that supports screen-space decals, and I’ll be open-sourcing it once I finish the docs (hopefully no more than a week from now).
3 Likes