Decals mapped to custom geometry?

Tried asking this in the AnswerHub but didn’t get any response:

I’m pretty sure this doesn’t currently exist, but it would be terrific if we could author our own floating geometry for use with decal materials. Cryengine currently allows for this with their decal materials, and open world games like GTA5 use this technique quite a bit to allow special decal materials to be used on custom geo wrapping around corners of buildings and in thin, tiling strips for tire marks and lines of tar patchwork on roads. This also becomes exponentially more powerful in adding visual variety if those decal materials can have their alphas multiplied by the custom geometry’s own vert alphas so the same decal can fade in and out in different areas based on the geometry as well as its core material opacity.

Is there anything that would prevent this from a technical standpoint in UE4, or it just a matter of adding the user functionality to the engine? If it’s the latter, I’d like to suggest it be added at some point down the road as it would allow a lot of flexibility for world builders.

In the Visual Section there are Deferred Decals - that should be what you are looking for

Just deferred decals isn’t what I was referring to but rather using the deferred decal materials applied to custom geometry that would snug over other static mesh geometry. This is an older Crytek tutorial but the same things they’re doing with custom-built geometry for the decals works with their deferred decal materials in the latest builds:

http://docs.cryengine.com/display/SDKDOC3/Using+Decals+for+Destroyed+Structures

Notice how they build little floating meshes that wrap around the corners of the broken pillars or snake all the way around the edge of the concrete slab? That’s what I’m asking about in Unreal with their deferred decal materials (so you could have a decal that snakes around but only applies new normal information while leaving the diffuse and spec the same).

@Nick: Do you mean that a variety of projection techniques should be offered (like spherical, cylindrical, etc)? I just came across the same need in one of my projects. As far as I know, currently only planar projections are possible.

Kind of, but more than just different primitives, having the ability to make my own geometry that hugs the underlying geo I want to apply the decals to, and then assign the special deferred decal materials to that new custom piece. These shots from the Crytek documentation illustrate exactly the kind of things I’d like to do - note that these are older versions of their decal system that just use opaque materials and alphas, but newer versions of their engine allows full deferred decal materials to be applied to that kind of custom geo:

f64f132fbd92f479c59ede73ea5bb0504353a71e.jpeg
6cb76a5a013da6dea2bd207ab3ed19ace20630c4.jpeg

Interesting…Do you know how they do that? is it a projection or some kind of “layering” of materials on the surface itself?

It’s a year later, and I still haven’t seen or heard anything about decal improvements :frowning:

Just to clarify, the way CryEngine handles its decals allows artists to apply a decal material to any piece of geometry, which means artists can make their own decal planes or tiling decal strips by hand much more efficiently than placing a thousand splat actors in the engine.

As far as I’ve discerned, the decal material in CryEngine just overwrites the buffers of whatever channels it’s flagged to alter while ignoring/not contributing to the depth (combined with an 8-bit alpha that allows for decal opacity). This means artist can feather the edges of decals softly but don’t incur any of the expenses associated with alpha transparencies. You can even float geometry with decal materials applied far away from any other geometry and it will just look strange but it works fantastically if used correctly hovering just in front of a surface (contributing to color, roughness, normal, etc. while pulling the depth from the scene behind it).

This means an artist could have a single decal normal map, say a tiling one that represents worn/cracked edges for the corner of a building, and flag the decal material to only be used in the normal buffer. The artist could then wrap that tiling decal strip around any edge they wanted - vertical edges, horizontal, curved archways (good luck placing decal actors all around an archway curve right now), etc. and have that one decal be used to affect any underlying material. Underlying materials in this building example could include plaster, brick, paint, painted brick, concrete, etc. all using that one decal material.

This is how the P.T. game did the great looking worn/chipped edges on all the walls. They had a tiling strip strips of geometry with normals that created softened/weathered edges and simply wrapped those around all the hard 90° corners. If you’ve played the game, there’s an inlet in a corner with a curved archway inset that would be either impossible or wildly inefficient to recreate with the splat-actor-only decal system we’re currently stuck with.

Or if they had some kind of liquid smear decal, the artist may have generated alpha, normal, and roughness maps. They could then set up various decal materials that use these same maps but only affect certain channels to create different effects:

  • Decal using a red Color + Roughness + Normal = Blood
  • Decal using Roughness + Normal = Thick but clear liquid
  • Decal using Roughness only = thin wet area on surface

If the decal smear was either tiled or a slightly elongated image, the artist could then take this one texture and map it to a curved poly strip to make it look like something had been dragged around. Telling visual stories becomes possible when the artist has control over the geometry being used with the decal material. The artist could draw figure-8s with a tiling decal strip if they wanted to using this system, or create large scale graffiti, set the decal material to fade with vertex color to give extra variation to the material and using their ability to cut in their own edges/verts/polys.

I just can’t believe we haven’t seen any real strides made in getting a decent decal system running, since any artist who’s ever dealt with large-scale level art - especially dealing with buildings/structural work and tiling textures, could tell you just how powerful a good decal system is to creating believable and unique details. Simply having square splat actors that have to be manually placed in the engine just isn’t very elegant and absolutely terrible if you ever have to go back and revise something (like say reduce the number of windows on a building from 4x5 to 3x4, meaning any ‘leaky drip’ decals you had placed under windows now have to be manually moved in the editor, rather than it being quick and easy for an artist to move in their 3d package).


Just to show exactly what I mentioned above, here are some of the other images from Crytek’s (now several years old) documentation on how powerful this system can be for artists. Note that there’s almost no way to do nice edge strips like this in UE4 right now without resorting to hard-pixellated masked materials (which would also have a fixed material and couldn’t be used on a variety of surfaces like plaster, concrete, brick, etc. like a normal-only decal material could) or expensive, incorrectly-lit transparency that has alpha sorting issues:

coming from cryengine I definitely agree that imported mesh decals are really great to enhance visual fidelity. I`m not sure regarding performance but as far as I can tell the cryengine way of handling decals seems to be much better suited for something like sticking dozens of stickers onto an asset whereas creating dozens of deferred decals seems as if it could possibly affect shader performance to a much greater extend.

I’m doing more less same thing but with no overlapping faces and masked textures - that’s because masked is very expensive for mobile. Let me explain:
I’m using something called Mesh Trim. It’s not adding another layer of faces on top of other faces with alpha channel. The parts that should have this “decal” effect are actually a part of the mesh.

Then I’m using 2 UV channels to map both, I don’t bother with the 1st one much:

cb7cbc3ed22d549e575ce2b08da1feaf1a979a5c.jpeg

But the second - here comes the trimming magic:

This way I can create nice trims for mobile devices as well - one mask based material is much cheaper then alpha material, and you don’t get Z-pass artifacts on low end devices.

c511c4da9fb16fa1c42c4ca3fef5bda49cd1379a.jpegb97fe8b1bfb0dfab22b15332a4627be2ff71b652.jpeg

But that’s just a different kind of story, as it serves a bit other purposes.

Well, I would like to add to this thread, simply because I’ve been asking for this since 4.0. It’s still amazing to me that nearly perfect engine like Unreal cannot do this very basic thing. I’m also coming from Cryengine and if you’ve used this technique before, it’s kinda hard to replace it with something else. Like, if you take Crytek’s assets from, say Crysis 2, you can see how extensively this is being used and how well this works. However, if you dig through Epic’s assets, it’s obvious that they rely more on mat blends and such.

But let me post an example task, which in my opinion is best solved with geometry decals. I would like to hear how would people do it without them:

  • You have a huge network of custom city roads (so predicting a modular texture approach is not really an option), and you need to add road markers to them. Obviously, for variety markers need to have variable opacity and color, plus project them on underlying surface (so masked material is not ideal, we need decal kind of shader). Now, with CryEngine I put down a plane with tileable asphalt, then use any custom shaped geo decals on top, varying them with Vertex Color and Vertex Alpha. Feel the main difference here: if I need to make a curved dotted line and I only have a square Decal Actor, I need a custom decal texture. If I can use geometry, I take my tileable dotted line and map it on bent piece of geometry. This flexibility is just immense.

And there are just countless other cases which are just best solved this way.

I know it sounds confusing (if needed I can post images demonstrating what I mean), but hopefully Epic guys would give us this functionality one day :slight_smile:

Cheers!

The issue with this approach is that it doesn’t work with normal maps at all.

I actually tried this solution much earlier and posted results in this thread showing the issue :frowning:

Nick, maybe you can try using world aligned normal instead? That way it would probably always have the correct orientation. But it’s obviously not gonna work in many cases.

Mesh decals and spline decals are sorely missing in Unreal Engine 4. The detail they add to environments and the flexibility of working with them cannot be replaced by the current ‘deferred decal actors’ system.
They are the best way to add local details to levels and environments.
GTA V has used this extensively to great effect.
I’m actually desperate to see this system implemented in UE4.

you should check out the dirt kickup particle effect in the advanced vehical demo, it has a smart decal system for the tire tracks