Unreal - Custom C++ Plugin
(Created Vertex Paint System For Dirt Masks)
For the Dirt System, I knew I needed to make a few custom C++ nodes to handle the dirt mask through vertex painting. I wanted this to be more modular by creating very specific nodes that I could package together. This required me to write a plugin. The "Vertex Paint System" I created pretty much allows you to add a Dirt Volume BP to your scene. You apply these plugin nodes directly to your character's BP, and it will paint the vertex if a mesh surface comes in contact with it. I then use the vertex paint to generate a mask I can feed into my dirt shaders to reveal dirt markings based on where the character contacts the dirt surface.

Input Overlay Textures w/ Opacity
These dirt textures were created in substance so I could art direct the look of the dry and wet dirt and how it looked on skin versus clothing fabric. I could of spent a lot more time creating something in Unreal that was a bit more procedural but I instead chose the more art directable route which allowed me to achieve a specific look without the worry of the dirt/mud looking generic.
Dry Dirt
(Lighter Color, Soft No Normal, No Specular)
The dry dirt look I wanted to be very powdery, like the character went over a dusty dirt surface. This dirt is lighter brown and almost has no normal or specular.
Wet Dirt
(Darker Color, Raised Normal, High Specular)
The wet dirt look I wanted to be more clumpy, like the dry dirt that was once on the character solidified into something a bit more solid. This dirt is darker brown and has a bit more height to the normal and is a lot more specular.
Dirt Volume Blueprint
The Dirt Volumes I created allow users to set the ground height and control the radius of how much dirt can affect the contact surface. This is all set through a volume manipulator that allows them to easily see how this will look in their scenes. Since the body’s arms and legs are the closest to the ground, they will receive the most dirt markings. Because I wanted my clothing and head to also be able to accumulate dirt, I created separate dirt volumes for those parts as well so I could increase each radius size. After these volumes detect an overlap, my custom nodes then execute a paint tick event, which then paints the vertex of the surface provided. I then use that to create the contact mask which feeds into my dirt shader.
