Is your scene too clean? Here's my tesselated "Dust Layer" material function for you all!

EDIT 06/02/2018: Updated the links to the downloadable files throughout: DustLayerProject_4.8.2.zip & DustLayerProject_DIYfiles.zip

As requested, here is my Dust Layer Material Function (+ a simple Material Parameter Collection). I have also posted this to the UE4 reddit HERE. This is my first public offering, so please be kind :wink: Seriously though, all feedback (and your optimisations!) would be greatly appreciatedā€¦.

ā€¦ One of my biggest issues with Unreal is how ā€œcleanā€ everything is, particularly when trying to recreate anything old/abandoned. I have been working on a tesselated dust Material Function that is starting to look quite effective. In the before and after screenshots (in-editor) below I have added the material function to most of the materials in the scene (note how it only affects upward surfaces) - itā€™s a scene of an old storeroom that hasnā€™t been opened for 20-30 years:

http://i.imgur.com/qKIYRs9.jpg

http://i.imgur.com/BSvMc3L.jpg

http://i.imgur.com/wMfRuYD.jpg

Currently my function is quite over-complicated, as I was experimenting and wanted to make it highly-customisable so it would work with a variety of my master materials. As an example, I donā€™t think I have used the output modifiers yet in my whole scene, and the ā€œPass-throughā€ at the end was a last-minute hack. So please consider this an alpha version, as I intend to greatly simplify the entire function soon. There are a few other features I want to include as well, such as combining the two vertex-paintable scuff and scratch layers so that I can use the extra channel for a ā€œdebris build-upā€ channel that I can paint into the scene edges and corners (4.9ā€™s proposed ambient-occlusion query may be useful for this too, thanks /r/muchcharles).


INSTALL:
Either extract the files in the pack available for DOWNLOAD HERE](Dropbox - DustLayerProject_4.8.2.zip - Simplify your life) into your projectā€™s Content folder (4.8.2!), or follow the additional instructions below to re-create it yourself in your own project.

Import the texture file from the DIY file pack HERE](Dropbox - DustLayerProject_DIYfiles.zip - Simplify your life) into your project then, in each material in your scene, paste the function call/variables and vertex-painting section into your graph, and then intercede the switches right before the final material input node as shown below. For your convenience, this file pack also contains plaintext dumps of my clipboard for each of the paste procedures outlined below (just copy the text file contents and paste into your pre-prepared material graph). Be sure to set the variable defaults as shown (for now):

http://i.imgur.com/Rr8kOvf.jpg

(full-sized image is within the DIY file pack](Dropbox - DustLayerProject_DIYfiles.zip - Simplify your life))

Make a new material function, and re-create the example shown below, again being sure to set the defaults (but for the BaseMat and BaseNormal defaults, just use something of your own):

http://i.imgur.com/COvcfEY.jpg

(full-sized image is within the DIY file pack](Dropbox - DustLayerProject_DIYfiles.zip - Simplify your life))

Make a simple Material Parameter Collection with a single scalar variable called ā€œDustAmountā€, with a value of 1.

Then enable the dust layer in your material by setting the class defaults to something like shown below (plus enable vertex painting, if you wish):

http://i.imgur.com/zZwHLJu.jpg

USAGE:
Get a good starting coverage of dust on your individual materials and meshes first by adjusting the ā€œDusty_AmountModifierā€ and ā€œDusty_AmountToStartTesselationAtā€. I had the best results making the latter value about 0.05 less than the former.

The dust distribution can then be fine-tuned up or down by vertex painting in-editor into the red channel (add with L.click, reduce with Shift_L.click). Using low values of 0.1 for strength and flow in the vertex painting tool gave me the most fine control, and allows for painting in high-traffic areas and door scuffs, etcā€¦ Hint: have enough vertices on your meshes!

http://i.imgur.com/Ljyt8AF.jpg

(note the removal of the dust where the door swings in)

Scratches & scuffs in the dust layer can be vertex-painted in using the green and blue channels (higher strength and flow values are better for this).

Adjusting the ā€œDustAmountā€ value in your Material Parameter Collection will let you fine-tune the dust over your whole scene (or even adjust it at runtime). Setting the value to zero (edit: ?a small negative value is better) will bypass the function entirely so that the dust can be turned on and off at any time.


Thatā€™s it ā€“ have fun, and be sure to let me know how it goes in your own project! Iā€™ll be fairly busy over the next week, but I should have some time most days to help with any queries you may have.

Thanks,

Edit1: itā€™s probably fairly obvious to many of you, but the core of my function is based on Liaretā€™s pioneering ā€œtessellated snowā€ material from the wiki ā€“ thanks, Liaret(Lordink)!
Edit2: direct download links:
Project files for 4.8.2](Dropbox - DustLayerProject_4.8.2.zip - Simplify your life)
DIY file pack](Dropbox - DustLayerProject_DIYfiles.zip - Simplify your life) (includes the full-sized screenshots & paste dumps!)
Edit3: yes, it should be ā€œtessellatedā€ in the title, but I am sure you will get over it :wink:
Edit4: added the material settings example screenshot

That is pretty cool looking and brings the scene intoā€¦ OMG SO MANY WIRES! :stuck_out_tongue:
This really is cool though. Does the tessellation have any hit on the FPS?

Yeh, I was perhaps understating it when I said it was ā€œquite over-complicatedā€ :wink: Iā€™ll be putting up an optimised version with a simpler material function call sometime soon.

Regarding the FPS, I only lose ~1 FPS when the dust layer is enabled across the whole scene (I set up a simple keypress function that toggles the MPC DustAmount from -0.1 to 1 in-game). I have fairly old PC running a 770 though, so anything above that will probably not even notice the hit.

OMG spaghettiwar.
Ty very much for that very nice stuff.
:slight_smile:

Looks good mate.

Excellent work, thanks very much for sharing! :slight_smile:

Great stuff!
I really like that you give user possibility to decide where he wants the dust to concentrate and where not. Having dust where it shouldnā€™t appear is as bad as not having dust at all. What bothers me though is uniform distribution of dust across the surface. Typically most of dust particles accumulate in corners and less on plain surfaces. Not sure about technical feasibility of fixing that in surface shader but maybe distance field nodes coming in 4.9 will let you improve that.

Cheers!

The look I was going for in this scene is that of a room that has not been opened for 30 years. What you want with the dust accumulating in the edges/corners is exactly what I wanted as well, and if you use vertex-painting then this is easily achievable with my shader. If you look at the floor in my screenshots, you can see that the dust on my floor is lighter in the middle of the floor and heavier in the corners - it is just that I wanted some dust covering the whole floor as well for this particular scene. It is easy to entirely remove the dust from the traffic areas if you wish (look at the screenshot where I removed the dust where the door opens).

For realism, the dust covering your scene should be naturally lighter away from the edges, but you also should think about the prevailing air currents: dust will be extra-light under any open vents/windows/gaps as well as in any high-traffic areas. If you have tried my function in your own scene without being able to achieve this look, one thing to be sure of is that you have added enough vertices to your floor mesh! I had to add extra vertices to my original simple box floor mesh (8 vertices), and ended up putting a vertex about every 15cm in my mesh (they have about 1000 vertices now). With enough vertices and a deft touch with the vertex-painter, you can get very fine control over the distribution.

It shouldnā€™t be too hard to cut in some real-time footprints as well, but I am not planning on adding this features for some time yet. And yes, when 4.9 drops I will explore the possibility of using the new ambient-occulsion query to do some of the corner distribution automatically.

Good luck with it!

Is fantastic, watch out with the wires ones may get shock on it :slight_smile: I hope some day UE simplifies the way we have to create materialsā€¦Is sometime crazy all the wire to get a FX like this to me is ridiculous I can have the same effect in Max or Maya with way less parametersā€¦

Agreed. Even some reroute nodes for the material editor would help enormously. It has such a powerful effect on my scene though, that I consider the spaghetti effect well worth it for now :wink:

Not only at yours i bet, and yes it is worth it, for sure.
How long you need to create and setup things like that?

Thats the only backdraw for me.

Cant get this to work in 4.11 please fix before 4.12 comes out

Can someone please make a video or something on how to make it work?, i am trying already for 2 hours to make it work and i cant seem to even get close to it

Itā€™s good, but it seems hard to understand

I know this is old, but the download link seems to be broken. Can someone reupload this? Looks really cool :slight_smile:

Did u find any link ?

Hi all, I have updated the links to my dust layer project files in the OP. Enjoy!