DirtFX - user-grinch/ModelExtras GitHub Wiki
π§Ό Overview
DirtFX brings your vehicle models to life by dynamically blending clean and dirty textures based on the in-game vehicle dirt level. As your vehicle gets filthier through gameplay, so does its appearance β no scripting, animations, or hacks needed. Just smooth, natural grime buildup. π
There are two main methods to activate dirt blending with DirtFX:
π§ Method 1 β Predefined Dirt Textures
For this method, simply use any of the following predefined textures in your modelβs materials:
π For Tyres:
tyrewall_dirt
π For Vehicle Body Grime:
vehiclegrunge_iv
vehiclegrunge256
vehiclegrunge512
These special textures are automatically replaced or blended depending on the vehicleβs dirt level. No extra setup needed β just assign them like normal materials in your model.
π‘ Note: These textures are baked into the DirtFX system. As the vehicle gets dirty, they progressively show their grungy variants. They are ideal for tyres and large dirty patches on bodywork.
π Method 2 β Universal Dirt Mapping (Clean + Dirt Texture Pair)
This powerful method allows any texture on your vehicle to support dynamic dirt blending β as long as you follow a simple naming convention and include the correct textures in your .txd
.
π¦ How it works:
-
Assign your clean texture like normal, e.g.
chassis_texture
. -
Provide a dirty version of that same texture in your
.txd
file, with_dt
added to the name:chassis_texture_dt
-
DirtFX will automatically detect the
_dt
suffix and blend betweenchassis_texture
andchassis_texture_dt
depending on the vehicle's dirt level.
π§ͺ Example:
door_diffuse
(clean)door_diffuse_dt
(dirty variant)
As the dirt level increases, the clean texture gradually mixes with its dirt counterpart for a realistic effect.
π Requirements:
- Both the clean and dirt textures must be present in the vehicle
.txd
file. - The
_dt
texture should match the clean texture's resolution and UV layout for a seamless transition. - Any texture can use this system β body panels, bumpers, even custom accessories!
- The both textures must be in Raw Raster (uncompressed - no DXT1/3/5 etc)
π¨ Tips & Best Practices
- π§½ Keep your dirt subtle β Avoid overly aggressive grime unless you're going for a junkyard aesthetic.
- πΎ Optimize your
.txd
β Dirt variants can increase file size. Consider keeping only the dirt textures and their clean variant without compression and applying DirtFx only to the main materials. - π§ͺ Test in-game β Watch how different parts of the vehicle blend as it gets dirty from driving. Fine-tune your textures for the best results.
βοΈ Behind the Scenes
DirtFX uses the gameβs internal dirt level system, updated based on driving behavior (e.g., off-road, crashes, weather). It then interpolates between the clean and dirty textures in real time using custom shaders.