I've tried different approaches to make decals (bullet holes, blood splats, etc.), but performance wise, the best metod seems to be instantiating a plane on the hit point of the surface, be it a prefab plane or a runtime built plane mesh. It's working fine, but now I need to solve the infamous problem of decals around corners of a mesh, so I was wondering if there is an easy way to get this done.
I thought I could just check the hit mesh, and scale the decal plane if its bounds exceeds a corner on a wall, but I couldn't find an easy way to detect a corner on a mesh.
I have not tried doing it in the Unity yet.
But in games (like Quake) they use procedural meshes for decals. When you have found a face to put decal on you should clip your decal rectangle by target face edges. So your rectangle may become triangluated a bit.
Or you can just ignore decals which do not fit inside the target face entirely.
answered Nov 04 '10 at 08:47 AM