- Home /
Decaling! how to! Help!
I was wondering if theres a decaling feature in unity. I need a way to put damage and burn decals on meshes, and I was wondering if theres a way to make them go with the mesh so its not a seperate part like a texture on it. I was also wondering if theres a way to do that on terrain? so its like when your painting it!
thanks
Answer by CJCurrie · Apr 08, 2011 at 05:59 PM
Currently there is no easy or efficient decal method. There are three* that are close, though, from worst to best:
1.) Using a projector will get you the closest result. Downside: it requires redrawing every object affected by the projector. E.g., if you project onto a terrain you'll be drawing the terrain once, then again for each projector.
2.) Use the Decal shader. You'll have to manually position and edit each material, which might be a pain and computationally expensive. Downsides: harder to work with, can't be managed as an individual object, and you'll have to edit the shader if you want a something a little cooler than VertexLit (which is what Decal is based upon).
3.) Placing a plane and texturing it will give you better performance, but will be flat. Put these in a higher drawOrder than the object being displayed upon, or they might be clipped by curved objects. It's an extra draw call still, but better than redrawing a terrain (which uses splatmaps). Downside: they'll be flat and won't curve with your mesh.
3.5) If you have the CPU cycles to spare, consider grabbing the target objects vertices and use procedural vertex sculpting to bend the decal plane to conform more closely.
*Third-party solutions notwithstanding
Answer by Bryan 4 · Apr 08, 2011 at 05:53 PM
Im making a decal heavy game right now, using the frameshift decal framework. The documentation for it is a bit rough, originally in russian and quite a few features do not work but it is a good starting point.
Your answer
Follow this Question
Related Questions
Set Vertices to Ground 1 Answer
Real time terrain deformation after explosion 2 Answers
Simple mesh load on demand for terrain 1 Answer
Deform Terrain With Mesh 0 Answers
64k vertices limitation 2 Answers