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 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
Edit4: added the material settings example screenshot