Unreal 5 Material Dirt & Wetness System

Real-Time Character Dirt & Wetness Shading Framework

This project is a real-time character surface shading framework built in Unreal Engine 5 that supports dynamic dirt accumulation and rainfall-driven wetness using a combination of material functions, HLSL shader logic, Blueprints, and custom C++ tooling. The system is designed to be modular, artist-directable, and performant, enabling layered surface effects that respond to character interaction, environmental exposure, and occlusion.

Key goals were to demonstrate shader authoring, reusable material architecture, GPU-friendly masking techniques, and integration between rendering, tools, and runtime gameplay logic.

Cloth Asset


ZBrush – Wet Cloth High-Resolution Sculpt

To support a believable wet-cloth response, I sculpted a high-resolution wet wrinkle pass in ZBrush that emphasizes areas of tension where fabric clings and compresses against the body. The sculpt focuses on gravity-driven folds, compression zones, and stretched regions to represent how saturated fabric behaves when adhered to skin. This sculpt serves as the source for downstream normal map baking and shading detail.


Maya – MetaHuman Rig Wetness Blend

The ZBrush sculpt was imported into Maya and used to create a clothingWet blendshape that was integrated into the MetaHuman rig. This blendshape can be driven at runtime to reinforce the visual impression of fabric clinging to the body when wet, complementing the shader-based wetness response.

Texturing


Substance Painter – Wet Cloth Texture Authoring

Wet cloth textures were authored in Substance Painter to provide art-directed control over wrinkle definition, translucency, and contact darkening. These texture maps are later modulated by procedural shader logic inside Unreal, combining hand-authored fidelity with runtime control.

Bake Normals
(High Wrinkles)

The high-resolution wet wrinkle sculpt was baked down to a normal map and applied to the low-resolution mesh to preserve high-frequency wrinkle detail in real time.

Paint Opacity
(See-Through Areas)

Opacity was painted to define areas where wet fabric becomes more translucent, primarily in regions where the cloth adheres closely to the body.

Paint Darkening
(Contact Areas)

Additional darkening was painted in contact zones to represent moisture saturation and water pooling, which enhances depth and realism when combined with the wetness shader.

Marmoset Toolbag –
Baked Subsurface Lighting for Performance

To avoid the runtime cost of heavy subsurface scattering on cloth, I baked lighting and translucency response from the Substance shader into a standard PBR BaseColor texture using Marmoset Toolbag. This preserves the soft, translucent appearance of wet fabric while keeping the final Unreal material lightweight and performant.

Wetness Setup


Unreal – Custom HLSL Material Function
(Rain Wetness Reveal Mask)

For my wetness system, I wanted wet materials to be revealed by rainfall in a controllable and physically believable way. To achieve this, I authored a custom HLSL function inside Unreal’s material editor that combines multiple packed mask channels and procedurally blends their reveal using smoothstep-based thresholding. The shader takes two mask inputs stored in a single RGB texture and blends their progression based on a RainIntensity value driven by a Material Parameter Collection. This produces a stable 0–1 output that controls the dry-to-wet transition with adjustable edge softness, noise breakup, and intensity-based behavior, while remaining efficient and reusable across materials.


Input Masks

Wetness Reveal Mask

A grayscale Wetness Reveal Mask defines the order in which surfaces become wet across the character. Dark values represent areas that become wet first, while brighter values represent areas that become wet last. This allows rain exposure to feel directional and physically motivated, including delayed wetting in occluded regions.

Wetness Noise Mask

A secondary noise mask introduces breakup into the wetness pattern, preventing uniform coverage and simulating irregular raindrop accumulation and fiber absorption, especially visible on cloth.


Rain Volume Blueprint –
Gameplay-Driven Wetness Control

A Rain Volume Blueprint drives wetness intensity through a Material Parameter Collection. When a character enters the volume, a timeline controls the rate and progression of wetness, feeding the HLSL reveal mask function and distributing wetness across surfaces in an art-directable manner.


Character Blueprint –
Wetness Deformation & Hair Response

The rain volume also triggers updates on the character blueprint to drive the clothing wetness blendshape and adjust hair simulation and material parameters. Gravity, sag, roughness, and scatter values are modified to give the impression of heavier, damp hair and fabric.

Dirt Setup


Unreal – Custom C++ Plugin
(Vertex-Based Dirt Mask Painting)

I implemented a custom C++ plugin that exposes modular nodes for runtime vertex color painting based on contact with Dirt Volume Blueprints. When a character intersects a dirt surface, vertex colors are painted on the mesh and used as masks inside the dirt shader to reveal dirt accumulation in contact areas. This provides persistent, localized dirt buildup that responds directly to gameplay interaction.


Substance Painter –
Dirt Surface Texture Authoring

Dry and wet dirt textures were authored in Substance Painter to achieve distinct surface responses for skin and cloth. These textures are layered through the dirt shader using vertex-painted masks and wetness state.
3D human figure in shorts and a t-shirt covered in patches of brown dirt against a black background.

Dry Dirt
(Lighter Color, Soft No Normal, No Specular)

The dry dirt material represents powdery surface dust with minimal height and specular response.
3D model of a human figure with arms outstretched, wearing a textured shirt and shorts with wet dirt stains and patches on the arms, legs, and torso.

Wet Dirt
(Darker Color, Raised Normal, High Specular)

The wet dirt material represents clumped, saturated soil with increased normal intensity and stronger specular highlights.


Dirt Volume Blueprint –
Runtime Contact Mask Generation

The Dirt Volume Blueprint allows artists to define ground height and influence radius to control where and how dirt can accumulate on a character. When a character enters the volume, runtime logic triggers a paint tick that drives vertex color painting on the skeletal mesh at contact points. These vertex colors are then used as masks inside the dirt shader to reveal dirt accumulation only where physical contact occurs.

Separate volumes are used for body, clothing, and head to allow independent radius control and more art-directable results. This approach enables persistent, localized dirt buildup driven by gameplay interaction rather than static textures.
Unreal Engine Blueprint visual script showing nodes for dirt volume events that set volume parameters, activate paint tick for vertex color dirt mask on character parts, and stop paint tick on component end overlap.


Project Summary


• HLSL shader authoring inside Unreal materials
• Real-time character surface shading (wetness, dirt, cloth response)
• Modular material framework design
• GPU-friendly masking techniques
• Runtime vertex color painting
• C++ plugin development
• Blueprint-driven rendering systems
• Performance-conscious rendering decisions