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(IVF HD dirt)vehiclegrunge256(GTA SA default)vehiclegrunge512(512x512 HD dirt)vehicle_genericmud_truck(Heavy mud / offroad)
These supported texture names are automatically replaced or blended depending on the vehicleβs dirt level. No extra setup is needed β just assign them like normal materials in your model.
π‘ Note: These names use DirtFX's built-in texture handling. 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 matching textures in your .txd.
π¦ How it works:
-
Assign your clean texture like normal, e.g.
chassis_textureorremap_body. -
Provide a dirty version of that same texture in your
.txdfile using one of the supported suffixes:_d(e.g.,chassis_texture_d,Tyre_D,remap_fica_d) β Industry & IVF standard_dt(e.g.,chassis_texture_dt,door_diffuse_dt)_dirt(e.g.,chassis_texture_dirt,interior_dirt)
-
DirtFX will automatically detect the dirt variant and smoothly blend between the clean and dirty textures across 16 dirt stages as the vehicle drives.
-
Vehicles with custom paintjobs / remap textures (e.g.,
remap_body+remap_body_d) are fully supported!
π§ͺ Example:
door_diffuse(clean)door_diffuse_d/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
.txdfile. - The clean and dirt textures should use matching UV layouts. Their resolutions may differ; DirtFX resamples them to a common size while generating blend stages.
- Any texture can use this system β body panels, bumpers, glass, wheels, or custom accessories!
- Compressed DXT1, DXT3, and DXT5 inputs are supported. For
_dand_dirtoverlays, alpha controls where grime is applied._dtis treated as a complete dirty replacement;_dand_dirtare alpha overlays.
π¨ Tips & Best Practices
- π§½ Keep your dirt subtle β Avoid overly aggressive grime unless you're going for a junkyard aesthetic.
- πΎ Optimize your
.txdβ Choose compression based on the texture and alpha needs; DXT1, DXT3, and DXT5 compressed inputs are supported. - π§ͺ 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 integrates with the gameβs internal dirt level system, updating dynamically based on driving behavior (off-road, crashes, rain, weather). It then blends the clean and dirty textures across 16 discrete levels in real time.