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:

  1. Assign your clean texture like normal, e.g. chassis_texture.

  2. Provide a dirty version of that same texture in your .txd file, with _dt added to the name:

    • chassis_texture_dt
  3. DirtFX will automatically detect the _dt suffix and blend between chassis_texture and chassis_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) image

🎨 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.