Using Deferred Decal Blend mode on a Mesh

Hello! I’ve been doing some research into the “Star Citizen Decal” Workflow and want to know if it is possible to do in UE4? (as seen in the Polycount thread here : Decal technique from Star Citizen - Page 2 — polycount)

The standard decal components + a material with deferred decal domain selected yield some of the desired results.
You can have just normals/roughness/color project, so I assume it is possible to apply this rendering process to a static mesh.

Unfortunately it is not a feasible solution to have hundred or even thousands of decal components hand placed on an object in the blueprint editor.

It would be ideal to recreate something very similar to what BAC9-FLCL has done in Unity with a custom shader.(http://i.imgur.com/V99Zlwt.jpg).

The decal material can be blended over any number of underlying materials, and then selectively contribute/override Color/Roughness/Metallic/Normal properties.

Is it possible to re-purpose the DecalComponent projection method (FDeferredDecalProxy?) and materials and somehow apply that to a mesh overlay?
-Or-
Would creating a custom Unreal shader (.usf) be a more appropriate solution?

Thanks for your time!

Star Citizen never being finished jokes aside, I wouldn’t use UE4 decals for what you want to do. I would bake the desired options into texture(s) (think channel compressed offset sprite) and use coordinates to select which feature to show. If you just want to do colors, try substance instances (free) or simple mulitply vector colors on white masks then blend as desired. Decals are extremely expensive in the grand scheme of things. Hope this helps.

Well I believe that the method he is trying to use is not decal based but using planes with projected normals. His question is concerning the custom shader needed to blend the plane’s normal and other texture information with the mesh underneath it.

Thanks for the reply! I don’t want to use decal actors/components necessarily. I would like to requisition some of the features from the material domain they use , and apply that to a mesh that overlays and properly blends with another mesh just beneath it.

The whole reason we are pursuing this workflow is due to the gross texture size and resource cost of the assets we are currently working with. Using the more traditional art pipeline is already becoming an issue. (We are using hand painted masks and baked texture maps for our vehicles).

The end goal would be to have a vehicle that really only uses tile-able materials for it’s base (Substance materials or otherwise) with the additional decal detail mesh that adds rivets, stickers, panel seams, vents, etc… on top of those materials.

I would like an answer to this as well please!

I am super interested in get more information about this matter. I am currently researching more info about this topic.

Thanks!!

I see some explanation in the referenced thread but that might also be a guess on how it was implemented. In a deferred renderer this can be made without looking up the base material. Either framebuffer blending or a masked material can be used. I started that a few weeks ago - we call it MeshDecals (might change) and it provides all Decal material functionality on meshes (static mesh or Skeletal Mesh). It framebuffer blends GBuffer properties (non DBuffer decals) or DBuffer properties (DBuffer decals). The content creator needs to make sure the decal mesh is not floating too much but there has to be some offset to avoid z fighting. Is that what you want? I hope to get back to that task in the near future.

Thanks Martin!
MeshDecals sound like exactly what we’re looking for!
I was hopping someone would point us towards a good starting point to get something like that working in engine, but it seems Epic is already on the case :).
Superb!

I think the decal system described in the thread above will be invaluable for high quality hard-surface modelling/materials in UE4.

It sounds like the feature is currently backlogged?

It’s not backlogged, I just have a few other things to do before that.

When could we potentially see this implemented? I was surprised to learn that unreal engine 4 did not support mesh decals. As the studio I work for has used them as an integral part of our pipeline going back 5 years in an engine that is about 10-15 years old.

We are currently moving over to unreal and this has been an issue trying to find a work around to the limitations of the engine. As hand placing decals in the engine would be impractical. As well as not being able to wrap decals around meshes or over corners and curved surfaces has meant decal actors are a poor replacement.

When could we potentially see this implemented?

When we find the time - sorry - we have to juggle many priorities.

I was surprised to learn that unreal engine 4 did not support mesh decals. As the studio I work for has used them as an integral part of our pipeline going back 5 years in an engine that is about 10-15 years old.

Before deferred engines Forward list Mesh Decals was the only option and maintaining this code and it’s performance and quality issues can be a problem (we had it in UE3 and happily removed it). We now want to have deferred MeshDecals - avoiding some of the problems while making good use of the deferred benefits (lighting happens once per pixel, no limitations on light count / shadowing).

A creative artist can create a masked material using in a thin shell on top of the opaque mesh to achieve a similar effect. Instead of blending you can output the dithered result and together with TemporalAA you can get nice soft transistions.

As Martin Mittring suggested above. In my projects when we need decals like you want. We either:

  1. Have it as a mat param
  2. Have a few thin layers on the mesh that can be paramed

Thanks for replying Martin.

I found your info on decals interesting, I’m not entirely sure if the decal shader we use is deferred since our engine is so old. Though a lot of features were added into it just before I joined the studio and maybe a deferred renderer was implemented as we do have a deferred post shader for thin geometry.

I’m just assuming it’s a deferred mesh decal shader as it does behave very similar to a deferred decal shader in unreal but its applied to geometry and it not only blends to the mesh below it but also to the world objects behind it. So we could use the shader to float decals on top of an object in 3DS Max to put rivets, bolts, etc. on it or we could create a mesh plane and put a texture on it and place that on walls/objects in the game world to decal it to surfaces below it. We didn’t have the decal actor method in our engine.

I understand this may not be a huge priority, though I am glad you guys have something in the works.

I only hope we can use these features once they are implemented into unreal as we plan to lock our engine version at some point. My understanding being that only certain specific features will then be pulled into our build of the engine after we lock down our version. Though I’m not involved in that part of development, only an artist here, so not sure how or when that would happen. Though I’m sure we’d make an exception for this as it would be extremely useful.

I’ve been playing around trying to figure out your dithered method. I believe you were referring to the technique used in the Stylized Rendering Materials section of the documents on the UE4 site this looks cool but I’m not sure it can be used to achieve what I’m looking for as I would like hard edges on my decals. I’m still new to Unreal Engine 4 so I’m probably wrong there.

I’m not sure I’m doing it right either. I have an opaque mesh and then on top of that planes and looped planes for bolts and seams to be decaled on to the surface of the opaque metal mesh.

I gave the decals one material ID and the opaque mesh a second material ID, this ID has a simple metal material applied to it. I’ve then created a material for the decals which has blend mode set to masked and dither opacity mask checked. I can’t really see a difference between having dither opacity mask on or off. I also tried pluging in the dithertemporalAA node into the material but that made everything slightly translucent and also grainy.

The main issue you get using masked blend mode is the surface below picks up the geometry and tries to reflect or cast shadows on the surface below, ideally that surface would ignore the floating geometry. I’ve not found way to disable this.

Sorry for the long reply. :stuck_out_tongue:

Thanks again!

I would like hard edges on my decals

This material function wants to create a soft transition. For a hard transition you don’t need anything. Simply use a masked material and output a OpacityMask in 0…1 range to cut/clip some parts of it.

dither opacity mask checked

That is doing almost exactly the same as the material function.

I can’t really see a difference between having dither opacity mask on or off.

If your output is almost always 0 or 1 you don’t see any transition - in that case it is expected to looks the same.

I also tried pluging in the dithertemporalAA node into the material but that made everything slightly translucent and also grainy.

It should look kind of the same - there are some parameters you might have to have different values. You don’t need it.

reflect or cast shadows on the surface below, ideally that surface would ignore the floating geometry. I’ve not found way to disable this.

To not reflect I would put it more near to the surface and make sure it’s single sided. You can disable shadow casting on that material (or material section?).

I’m recently moving from Cryengine and I’m very happy with Unreal so far but I have to say I was also surprised that this feature is not available in unreal since my project in cryengine would rely a lot in it to add details in meshes.
The better way to explain the feature is the ability to hide corners in destroyed assets for example. Here on this page you can see very good examples of the feature:
http://docs.cryengine.com/display/SDKDOC2/Using+Decals+for+Destroyed+Structures
As you can see is a very powerful tool and that’s only one use for it. It’s nice to know Epic is working on it, sadly it is apparently not available yet on the 4.12 release.

Just chiming in that I, and many other artists on polycount, desperately want this feature. I know there are many other priorities that the dev team has, and I don’t know what sort of obtsicles and technical hurdles are in the way, but just know that it is a wanted feature with many applications and uses that will absolutely be utilized by the user base. :slight_smile:

some news on that: