Home Unreal Engine

[Technique Showcase] Unreal 4.13 Mesh Normal Map Decals

polycount sponsor
Offline / Send Message
Millenia polycount sponsor
Example:



https://www.youtube.com/watch?v=66IGMnPgEW0

Hit me with any q's about the technique.

Replies

  • Metall
    Offline / Send Message
    Metall polycounter lvl 5
    Yeaaaass! been waiting so long for this feature in UE4 :D thanks for the example
  • Zack Maxwell
    Offline / Send Message
    Zack Maxwell interpolator
    I'm confused. Why not just place those details directly in the texture? This seems like it would be less efficient, both to create and to render.
  • Mustache_Kid
    Offline / Send Message
    Mustache_Kid polycounter lvl 8
    Cool stuff right there. I think this is the same thing they've used in The Division.
    @Grimwolf
    Because this way You don't need the baked texture. Face weighted normals do the job just fine and You can make many different guns using the same material.
  • Bek
    Offline / Send Message
    Bek interpolator
    Grimwolf said:
    I'm confused. Why not just place those details directly in the texture? This seems like it would be less efficient, both to create and to render.
    Also consider object scale. You could have very large objects (like vehicles) which use tiling textures (and fwvn where it makes sense to do so) broken up with decals. So you get the benefit of super-efficient texture use while not being limited when it comes to adding unique details wherever you like.

    However — I've just noticed one annoying limitation with this method. The normals are overwritten, not overlayed. So if you're using say a detail normal map on your base object (which seems likely) you also need to use that map in your decal texture. But of course that will never match up perfectly (not really necessary because the detail will be quite small), but more importantly, if you had planned to use stretched UV's for your decals to make the most of your decal sheet (which also seems incredibly likely / almost certain) then your detail normal map won't match anyway. Though I suppose you can circumvent this issue by using two UV sets for your decal mesh; the second one containing the regularly scaled (matching your base objects texel density) UV's and plugging the detail normal map into that, as well as separating your decal meshes by materials if their dtNM differs. But that's not exactly ideal.
  • Millenia
    Offline / Send Message
    Millenia polycount sponsor
    What you could do for some sort of blending is cranking the intensity of the normal map waaaaay high up and lowering the alpha slightly so that it blends through a little bit, though this isn't a complete solution.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    you could "overlay" them by using the blend angle corrected normals node and an another uv channel .. But then you are back at the "matched uvs" method  so its not really efficient...
  • Millenia
    Offline / Send Message
    Millenia polycount sponsor
    I guess you could also use triplanar projection for the detail normal map in both the decal shader and the main shader to make sure they match up perfectly, though it'll be a bit costlier as well and you'll run into stretching issues at some angles.

    I'll probably just try and work around its limitations rather than making super complex shaders once we migrate to 4.13 at work.
  • akaChris
    Offline / Send Message
    akaChris polycounter lvl 6
    Adopting to 4.13 and mesh decals instead of projected 2nd uv channel decals comes with a lot of restrictions unfortunately. One of them is that in cases where you use Color (Albedo) in the decal shader, you override the metalness value of the underlying material. it's also not possible to do metallic decals since metalness is not available. same with bump offset. We still opted for mesh decals even losing all the benefits we had before as it's appears to be more robust (no need to project uvs in 3dsmax and no lightmap uvs/space required). Still would love to know more about these limitations, so I`m trying to get some response here: https://answers.unrealengine.com/questions/485322/mesh-decal-limitations-or-bug.html
  • agitori
    Offline / Send Message
    agitori polycounter lvl 7
    last time I have tried it, my ue4 have freeze... (after activating the settings)
  • Kobalt Kiwii
    Offline / Send Message
    Kobalt Kiwii polycounter lvl 6
    wait it doesn't overlay the normals? as far as i know the cryengine mesh decal shader does, isn't that what this was meant to emulate? I hope it does overlay the normals or at least have some transparency/dithering to blend between the normals i'll have to play around
  • Millenia
    Offline / Send Message
    Millenia polycount sponsor
    wait it doesn't overlay the normals? as far as i know the cryengine mesh decal shader does, isn't that what this was meant to emulate? I hope it does overlay the normals or at least have some transparency/dithering to blend between the normals i'll have to play around

    You can use the opacity mask to blend between them if you'd like. At 100% opacity it completely replaces the underlying normal.
  • furiouslul
    Offline / Send Message
    furiouslul polycounter lvl 4
    I've just been playing around with this - very cool, and thanks for the video @Millenia.

    Only question I have is, is it possible to have edge wear on these decals while keeping the underlying base colour of the main mesh (and using the base colour of the decal material as the texture for edge wear)? Wasn't quite sure if there would be some sort of trickery to blending opacity maps or some such.


  • BaekIronFist
    Hey Millenia! Thanks for this tut! Have you thought on doing this but with the POM technique like in Star Citizen?
  • Millenia
    Offline / Send Message
    Millenia polycount sponsor
    Not entirely sure how it would work with this method. I think Epic might have to add support for it.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Unfortunately parallax doesn't work...
  • turbinea
    Offline / Send Message
    turbinea polycounter lvl 7
    it is quite nice step towards what star citizen is using but there is still room for improvement. World aligned texture doesn't work if you set material domain as Deferred decal.
  • littleclaude
    Offline / Send Message
    littleclaude quad damage
    Thanks for the share, love it!
    Question, do you need to add a draw call to the decals when you view the object from a distance?
    I am going to give it a bash, looks like lots of fun :)
  • macoll
    Offline / Send Message
    macoll polycounter lvl 14
    Thanks for sharing your tips, great vid ;)
  • Jesse Moody
    Offline / Send Message
    Jesse Moody polycounter lvl 18
    Grimwolf said:
    I'm confused. Why not just place those details directly in the texture? This seems like it would be less efficient, both to create and to render.
    We used this method for a ton of assets on Black Ops 3. The benefit is you can get away with using and sharing a lot of generic tileable materials across your entire game that aren't unique to each asset saving a lot of memory on texture streaming, disk space, etc. 

    Then creating decal sheets of trims, vents, pipes, etc you can cut them out into decals and place them on models and depending on the shader setup they can contribute to the normals only (deferred method) or add to the entire material adding color,spec,gloss,normals,emissive,etc to the base layer under it. 

    Also because they aren't baked into the assets base normal map fine details like bumps, text, bolts, etc can be much higher res than they would be if you were to bake them into the base normal map and materials.
  • Trevelyan .
    Offline / Send Message
    Trevelyan . polycounter lvl 11
  • Kiory_Freeman
    Offline / Send Message
    Kiory_Freeman polycounter lvl 3
    Obscura said:
    Unfortunately parallax doesn't work...
    I beg to differ. :)

  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Obscura said:
    Unfortunately parallax doesn't work...
    I beg to differ. :)

    Can you please show me or explain how did you do this?
  • Synaesthesia
    Offline / Send Message
    Synaesthesia polycounter
    I've featured this thread on our company page. Keep up the fantastic work, Hans! :)
  • Ladygrace
    Offline / Send Message
    Ladygrace polycounter lvl 5
    Were any normals baked for the Object you are using?
    With using this technique i take it will reduce the amount of Textures etc loaded in since many objects will be using that one Normal sheet? Thanks for the video as well it was pretty neat.
  • Millenia
    Offline / Send Message
    Millenia polycount sponsor
    Ladygrace said:
    Were any normals baked for the Object you are using?
    With using this technique i take it will reduce the amount of Textures etc loaded in since many objects will be using that one Normal sheet? Thanks for the video as well it was pretty neat.
    No baked normals, just some custom vertex normals on the chamfers. You're right in that the main benefit of this technique is massively decreasing the texture footprint of your project, but it also works faster than having to bake unique normal maps for every single asset. You can also get much higher resolution results from a few tiling materials used in a smart fashion & one or two shared decal normal sheets.
  • littleclaude
    Offline / Send Message
    littleclaude quad damage
    Obscura said:
    Obscura said:
    Unfortunately parallax doesn't work...
    I beg to differ. :)

    Can you please show me or explain how did you do this?
    Does this help?
    https://www.youtube.com/watch?v=4gBAOB7b5Mg
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Thanks but no. The parallax function works fine with surface material domain, but not with deferred decal. At least not in this standard way. When I've set it to deferred decal, it had like a huge offset, and it really didn't look correct. I tried to play around with the depth and reference plane parameters but it didn't help. I tried this with decal volume and mesh decal as well.
  • littleclaude
    Offline / Send Message
    littleclaude quad damage
    Obscura said:
    Thanks but no. The parallax function works fine with surface material domain, but not with deferred decal. At least not in this standard way. When I've set it to deferred decal, it had like a huge offset, and it really didn't look correct. I tried to play around with the depth and reference plane parameters but it didn't help. I tried this with decal volume and mesh decal as well.
    I see, might be worth posting on the the Unreal forum as they are super active and refining the materials........or use Amazon Lumberyard  ;)

  • Snefer
    Offline / Send Message
    Snefer polycounter lvl 16
    Yeah, would also be interested in getting POM to work on decals. It used to give hard crashes, now it just doesnt work. 
  • Bek
    Offline / Send Message
    Bek interpolator
    Just wanted to copy akaChris's warning here:
    just a heads up: if you are using deferred decals don't upgrade to 4.14. Scenes containing deferred decal materials have become highly unstable resulting in frequent editor crashes. I`ve submitted a bug report which can be tracked here: https://issues.unrealengine.com/issue/UE-38709 Unfortunately Deferred Decals don't seem to be a priority for epic as stated on the answerhub thread: "Please be aware that this issue may not be prioritized or fixed soon."
    from: http://polycount.com/discussion/155894/decal-technique-from-star-citizen#latest

  • Tzur_H
    Offline / Send Message
    Tzur_H polycounter lvl 9
    Hi guys, any news regarding combination of this technique with POM?
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    agitori said:
    last time I have tried it, my ue4 have freeze... (after activating the settings)
    @agitori To revert this, having enabled Dbuffer Decals: go to the root folder of your project(as the option is per-project)>config folder>open defaultengine.ini>search for the line r. DBuffer=True and change it to False.

    Unfortunately, this is not a solution as you can't use the option in the project but, try again with a fresh project as this crashing behaviour should be rare enough.
  • NoRank
    Offline / Send Message
    NoRank polycounter lvl 3
    Is anyone experiencing some random textures flickering after activating the dbuffer decals?
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    NoRank said:
    Is anyone experiencing some random textures flickering after activating the dbuffer decals?
    It could be Zfighting. Is your pivot slightly below the mesh?
  • NoRank
    Offline / Send Message
    NoRank polycounter lvl 3
    NoRank said:
    Is anyone experiencing some random textures flickering after activating the dbuffer decals?
    It could be Zfighting. Is your pivot slightly below the mesh?
    Nope, actually the weird about the textures flickering is that it doesn't involve the textures in the models I am using the decals lol. It's a random texture which feels weird, seems like a bad topology problem tbh (it's not even my model, it's just a random scene in unreal), but before I click on "activate" on the dbuffer decals option and reset my editor it wasn't showing.

    Idk if it's related to the dbuffer decals been active but it was right after activating it, so yeah...
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    @NoRank Here's a list detailing where Mesh Decals are at at the moment. It's written by Tim Hobson at the UE answers forum. It seems to be a sort order/early Z-buffer pass issue.

    Here are the limitations that I'm aware of.

    Areas tested with mesh decals:

    • DBuffer and non DBuffer decals

    • emissive

    • WPO

    • Static and Skeletal Meshes

    • With and Without Baked lighting

    • Shader Model 4

    Areas not tested with for the initial implementation:

    • read normal in a decal material does not output to normal

    • Stereo/Split screen rendering

    • volumetric decals (shouldn't work anyway, but there may not be an editor error or warning about this)

    • tessellation (should work, though)

    These need a fix/feature implementation:

    • Sort order

    • Tangent Space support

    • Shader Overdraw/Overdraw functionality is missing

    Areas that need polish:

    • Automatic/adjustable DepthBias (currently you can do an offset in the mesh or use some WPO math in the shader)

    • Fade out the receiver depth is too far behind (currently you could do this in the material graph)

    • Sort by depth to avoid artifacts when many layers overlap

    • Sort with Deferred Decals

    • Better material editor preview

    • Correct instructions count

    There are a few other things that could probably be mentioned but this about sums up the major things. It's still experimental in a lot of cases and over time will have some of these if not all of them resolved, although I'm not aware of any timeframe for this. I hope this helps answer your question.



  • AlexandrL
    Offline / Send Message
    AlexandrL polycounter lvl 6
    Hi everyone! 
    Im pretty beginner to UE4 so maybe asking a dumb question but: after all, when all model will be covered with "details decals", does the bullet decals will work good? 
    And it is possible to put some big dirt decals (like big splat of blood, etc.) which will cover all other detail decals?

  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Depends on the blending mode setup and sorting order but yes, it should.
  • Geexile
    Offline / Send Message
    Geexile polycounter lvl 8
    Found a bug in mesh decals workflow for Unreal 4. Everything seemed to work fine , however i have in one room one very huge mirror . So i used planar reflections to make it look more correct and cool. However it appears that the planar reflection does not reflect any of my mesh decals on the opposite side wall. Someone else encounter that and found a solution for it ?
    Cheers
Sign In or Register to comment.