This may have been asked before and with good reason.
I’ve been using Unity for some time now, and I really do like how it works, its an amazing piece of software, but for a while now, I’ve noticed there’s never been a decent way to implement decals into a project, weather it be blood, bullet holes, paint splatters, explosion marks, tire tracks, or any other number of things.
I’m well aware there’s assets on the store that somewhat accomplish this, but isn’t it a bit odd that we’re nearing Unity 5, and there’s still no built in way to apply decals?
I’m liking the improvements coming in future releases. But I’d love to see something related to decals getting in eventually.
The thing with decals is that they’re quite a game-specific problem.
Do you want simple quads? proper (clipped geometry) decals projected over uneven surfaces? deferred decals, for less CPU cost (at the expense of GPU, and of course unsuitable for mobile)?
Do you need highly dynamic decals (machine gun bulletholes, footprints from many characters, etc), or are you mostly looking to paint static decals on to a scene to add detail?
Do your collision meshes match your render meshes? - or are you using simplified collision meshes? Do you want anything more complex, maybe wound decals on skinned meshes?
Do you need to animate/fade decals? How do you want to deal with limiting the decal count/removing old decals - fade them out, or wait until they’re off-screen?
Do you need to light them? - with proper lights, or light probes?
Yes, decals are something that in some cases could benefit a fair bit from the performance of native code - but I’m not sure a ‘one size fits all’ solution is very feasible?
It seem unlikely. Mostly because there are a wide variety of approaches depending on needs, from simple to complex. One solution would be too expensive in some cases or limited in others. Really it is a game specific feature, and should be built/implemented to fit the needs of the game. Also, it a relatively simple thing to do, it seems way overkill to implement it on a engine level. It is a perfect fit for asset store solutions if you don’t have the ability to write it yourself.
It doesn’t matter if it CAN be achieved through either scripting, or an Asset Store asset.
In my opinion its something Unity SHOULD have by default.
Engines that are ages old have proper decal systems and I’ll give a few examples.
Source Engine (Almost 10 years old if my memory is correct)
GoldSource Engine (15+ years old)
Doom Engine (20+ years old)
Not to mention Unity’s competition, UDK, UE4, Cry Engine, and a few others I won’t mention right now.
They all have support for either texture/decal on model magic or other means of placing decals, such as blood, explosion marks, and other things.
I’m in no means an expert on Unity, and I have indeed made up my own sort of decal system in the past, but there were a lot of things I didn’t like about it.
Clarification on the above tweet: we aren’t working on built-in decals (just yet).
For Unity 5.0 I’m working on making the “rendering pipeline” much more extensible (via something called “Command Buffers”). One thing that it does allow to be built, is “deferred decals” (see this presentation). And a lot of other things.
We should make out-of-the-box decals too at some point, just so far everyone has been busy doing something else.
The major issue preventing our use of them is that they’re not rendered where there’s shadow unless another light is shining on them - which leads to some pretty unworkable situations in games with varying lighting or time of day.
Is there a way to fix this? We don’t mind using normals only or albedo only…
Right, after a chat with smarter people than I am, well it turns out you can’t do deferred decals in Unity.
The deferred AO implementation prevents it. I understand it’s done because need to support 21 platforms but I guess we will have to find other old fashioned ways of adding blood, scorch marks etc on the fly. The blog demo is not useful in changing lighting conditions.