Home 3D Art Showcase & Critiques

WIP Realtime Smart Materials

polycounter lvl 5
Offline / Send Message
Mustache_Kid polycounter lvl 5
EDIT 07.06: Added an animated gif to show the effect.
WIP

Hey guys,

i'm working on a wear shader for painted metal objects. It's a part of a pipeline desing that allows making props using realtime smart materials. I'm aiming to reduce the production time and memory footprint by not having to make dedicated UVs/textures. All effects are done at runtime. Modelled in Max and rendered in UE4. 



Handpainted in UE4 realtime.



The set uses 2 main textures:

  • Masks
  • Normalmap


Additionally You can use:
  • Stencil textures
  • Paint Color Palette

The damage is driven by vertex color information. All layers are done proceduraly.

Alltogether there are 5 effects:

  • paint
  • rust
  • metal
  • dirt/AO
  • stencils
They affect all buffers meaning diffuse, normal, metalic and roughness. So for example rust has proper PBR values and shades differently than metal or paint.

Meshes are really simple shapes, nothing fancy. UVs are done automatically by box/cylinder projection, so they are messy in some places.




Here is a screenshot from Max. 


Currently I'm adding stencils functionality.

Hope You guys like it. :)

Replies

  • Ged
    Options
    Offline / Send Message
    Ged interpolator
    very cool, are you doing it like substance? near the bottom of the page here there is an image showing how they pack the edge wear etc masks into r g b a of a master mask texture https://www.allegorithmic.com/blog/next-frontier-texturing-workflows
  • Mustache_Kid
    Options
    Offline / Send Message
    Mustache_Kid polycounter lvl 5
    Thanks GED. The masks work in a similar way as with substance but are calculated in runtime rather than prebaked in a separate RGB texture. Because i'm using tilable material i'm driving the damage by vertex color information.

    I've updated my original post with an animated gif to show the effect.
  • d1ver
    Options
    Offline / Send Message
    d1ver polycounter lvl 14
    Nice progress Mustached_Kid!  Good call on rust being the transitional layer. Any ideas for surfaces other then painted metal?
  • MeshMagnet
    Options
    Offline / Send Message
    MeshMagnet polycounter lvl 9
    Nice...  Would you mind posting a screenshot(s) of your material setup?
  • Eric Chadwick
    Options
    Online / Send Message
    Neat stuff!

    It looks like paint is the base effect, with controls for overall color/metalness/roughness of the paint?. And you're using RGB vertex colors to control the 3 other effects (rust, metal, dirt)? How are you controlling how/where the stencils appear/disappear... vertex alpha?

    Curious how UE4 handles batching with differing vertex colors. There is some funkiness in Unity when you try to do this... edit vertex color on batched meshes.
  • Flakky
    Options
    Offline / Send Message
    Flakky null

    Curious how UE4 handles batching with differing vertex colors. There is some funkiness in Unity when you try to do this... edit vertex color on batched meshes.
    What batching? You mean instancing? Instancing does not support diff. vertex colors.
  • Mustache_Kid
    Options
    Offline / Send Message
    Mustache_Kid polycounter lvl 5
    Neat stuff!

    It looks like paint is the base effect, with controls for overall color/metalness/roughness of the paint?. And you're using RGB vertex colors to control the 3 other effects (rust, metal, dirt)? How are you controlling how/where the stencils appear/disappear... vertex alpha?

    Curious how UE4 handles batching with differing vertex colors. There is some funkiness in Unity when you try to do this... edit vertex color on batched meshes.
    Exactly, RGB for each layer. Stencils go with alpha. Though i'll probably get rid of stencils once UE4 gets Texture Array support. Alpha will go to selecting texture from an array.

    Eventually i want this to be a multimaterial shader. This will allow rendering meshes using multiple textures in one draw call. Also most if not all metal objects in the scene could use the same material.

    Flakky said:

    Curious how UE4 handles batching with differing vertex colors. There is some funkiness in Unity when you try to do this... edit vertex color on batched meshes.
    What batching? You mean instancing? Instancing does not support diff. vertex colors.
    Yea i'd be really surprised if it would. I think that it just creates another mesh and a separate draw call.
    d1ver said:
    Nice progress Mustached_Kid!  Good call on rust being the transitional layer. Any ideas for surfaces other then painted metal?
    Originally this was created as a painted wood materal. So yea it should work on things other than metal. The general idea was that when most simple materials get worn out they change the color, smoothness or surface detail. I wanted to find how far can You get by just modifying existing textures in the shader. Changing diffuse brightness, saturation, tint, offseting roughness and amplifying a normal map. Something that could have been easily done on existing textures. At first I've used a roughness as a mask which worked most of the time but the blending was prone to change if the roughness changed and also roughness is quite flat in tiling textures. I've added the paint layer to override diffuse If You would want to have multiple colors or some patterns. And surprisingly the results were better than expected. 

    This was not meant to replace meshes with beautiful dedicated textures. But games, especially open world ones, are mostly filled with content that 99% players don't pay much attention to. There is so much things going on on the screen that you'll never stop to admire that trash can, crate or metal floor. They should give You that cool realistic feel but don't draw Your attention. Seriously who ever looks at fire hydrants in a game that is not about fire hydrants? I just love The Division because they use so many simple materials that just do the job.
     Anyways what I like to take from all that is that they should be cheap on memory and easy to make. 

    Here's an update:



    You can find more at:

    https://www.artstation.com/artwork/yNnwK
  • Mustache_Kid
    Options
    Offline / Send Message
    Mustache_Kid polycounter lvl 5
    Short update:

    i'm writing a Maya plugin that calculates mesh convexity/concavity into vertex color. Right now it's a simple fire-forget python script but i'm putting it in a deformer so You can adjust the parameters live.

  • Ged
    Options
    Offline / Send Message
    Ged interpolator
    Thats a good idea, maya is strange sometimes when it comes to features. Like the vertex painting is alright but if you want to bake vertex painted colours (or vert ao etc ) to a texture theres no obvious option for that. All I could find were obscure workarounds. :expressionless:

    nice results on those smart materials
Sign In or Register to comment.