Skip to main content

SurfaceDirt

Development preview — not yet released on Fab. This page describes the current local candidate.

SurfaceDirt adds patchy dust, mud and grime to materials. Its deposition mask combines a uniform contribution, upward-facing surfaces, a world-height band and an optional cavity mask that you supply.

Grime patches, low-height mud and top-facing dust in the Unreal Engine overview scene

The same scene with Amount set to zero:

Clean comparison with the three deposit effects disabled

Quick start​

  1. Open SurfaceDirt.uproject in Unreal Engine 5.0.3. The project opens SurfaceDirt/Maps/L_Overview.
  2. Assign an instance from SurfaceDirt/Materials/Presets to a static mesh.
  3. Adjust Coverage and Scale for the patch distribution.
  4. Use TopWeight for upward-facing dust, or HeightWeight, HeightStart and HeightFalloff for a low dirty band.
  5. Adjust Amount, effect color and effect roughness. Amount 0 disables the effect.

The overview uses a fixed camera in Play mode with the mouse visible. Material parameters are edited in the Material Instance editor. No first-person character or project ActionMappings are required.

Add dirt to an existing material​

The functions are in SurfaceDirt/Materials/Functions.

FunctionPurpose
MF_SD_MaskCreates a grayscale deposition mask from coordinates and distribution controls.
MF_SD_ApplyChanges Base Color, Roughness and Metallic using the mask, copying other attributes from the supplied base material.
MF_SD_WorldProjectionProvides optional planar world-space coordinates.

Connect your existing Material Attributes to BaseMaterial on MF_SD_Apply. Connect MF_SD_Mask → Mask, supply the desired effect color and roughness, then connect Material to your material output with Use Material Attributes enabled.

For a conventional graph, use Make Material Attributes and Break Material Attributes, or use the mask as a Lerp alpha for selected properties.

The mask defaults to the mesh UVs, absolute world position and the unperturbed world-space vertex normal. You may supply UV, PositionWS and NormalWS explicitly. Connect a vertex-color channel or texture to UserMask to restrict the effect.

Distribution controls​

ControlMeaning
AmountOverall strength, 0–1.
CoverageCoverage threshold for the patch field.
ScalePatch frequency in the supplied UV coordinates.
SeedRepeatable patch variation.
UniformNon-directional contribution across the surface.
TopWeightContribution from upward-facing normals.
UpThresholdWorld normal Z threshold for top accumulation.
HeightWeightContribution from the world-height band.
HeightStartWorld Z below which the height contribution is full, in centimeters.
HeightFalloffFade distance above HeightStart, in centimeters.
CavityAn artist-supplied mask. The example master uses this scalar to multiply CavityTexture.
CavityWeightStrength of the supplied cavity contribution.
GranularityFine breakup inside covered patches.
UserMaskRestricts the complete result; black disables it locally.

The distribution contributions are added and clamped. A strong Uniform value can cover areas that TopWeight or HeightWeight alone would exclude. Set unused contributions to zero when isolating a specific behavior.

Presets​

  • MI_SD_Dust — a light, rough deposit biased toward upward-facing surfaces.
  • MI_SD_Mud — dark dirt concentrated near a specified world height.
  • MI_SD_Grime — broken patches across the surface.
  • MI_SD_Cavity — demonstrates the included, explicitly authored cavity-mask texture.

Dust, Mud and Grime include Clean variants with Amount set to zero. The example master exposes base color, roughness, metallic, detail tiling, a detail texture and a tangent-space normal texture. M_SD_MaskPreview displays only the mask for placement checks.

Close view of dust accumulating on the upward-facing part of the smooth sphere

Cavity masks​

SurfaceDirt does not detect cavities from geometry. Supply a baked cavity map, a painted mask or another known source. White allows accumulation and black removes that contribution. Use the correct UV channel for your mask.

The included cavity texture is a simple authored joint pattern for demonstration. It is not an ambient-occlusion bake and does not conform automatically to an arbitrary mesh. Top accumulation also does not test whether another object shelters the surface.

World projection​

MF_SD_WorldProjection accepts world position, an origin and SizeCm, the size of one UV unit in centimeters. Axis selects 0 = YZ wall, 1 = XZ wall, or 2 = XY floor. Connect its output to the mask's UV input when a fixed world scale is useful.

The helper is planar, so it does not automatically wrap across corners. Height controls remain measured in world centimeters regardless of the coordinate input.

Migration and limits​

Migrate the complete SurfaceDirt folder through Unreal's Content Browser to the target project's Content directory. No other Surface Tools product or third-party runtime plugin is required.

The examples target opaque, Default Lit static surfaces. This is a material appearance system, with no particle deposition, geometry accumulation, automatic cavity baking or runtime cleaning simulation. Moving an object changes its world-height contribution; rotate it to change its top-facing contribution.

Built and visually checked in Unreal Engine 5.0.3 on Windows. A separate Windows load-and-cook check passed in 5.8.2. The supplied sample project's defaults target 5.0; for an existing 5.8 project, migrate the Content folder. Other engine versions and platforms have not been verified.

Documentation image