Creating procedural dirt in 3DS Max with Mental Ray
Author: Stig Atle Steffensen
Software used: Mental Ray (Max version), Mental Ray
Subjects: Texturing
Introduction

This ‘procedural dirt’ tutorial is something I wrote after I found myself needing a way to apply dirt to my scenes.
I did some research with Kristian Thuesen who is a good colleague at work (a 3D artist), and we found a non-procedural way of doing this, but I really wanted it to be fully procedural.
Many tutorials on this subject deal with ambient occlusion and baking, often you have to use scripts to find the edges of the models, then apply a vertex color that you can bake to a texture.
The reason why I don’t like the above ways of doing this, is because it consumes too much time. And also, when you work with many people in a team that have varying skill levels, it needs to be as simple as possible.
The only thing you need for this technique is 1 mi file, and 1 dll file, both of which are freely available.
Downloading the material and dll’s
Note:
I’ve written this tutorial assuming you are using 3dsmax2012 x64.
This is the only version I’ve got, but it should work for other versions too.
I’m also assuming everything is installed to the default locations.
So, if you use 3dsmax 2012 x64, download the following files and place them in a folder:
Dll’s:
http://www.shaders.moederogall.com/Muh64bitdlls.zip
Mi include files:
http://www.maxplugins.de/mr_files/animus_includes.zip
Installing the shader
Unpack the zip files, then copy these two files:
Dirtmap.dll
Dirtmap.mi
Into these directories:
C:Program FilesAutodesk3ds Max2012mentalimagesshaders_3rdpartymentalrayincludeDirtmap.mi
C:Program FilesAutodesk3ds Max2012mentalimagesshaders_3rdpartymentalrayshadersDirtmap.dll
Now, to make 3dsmax load the new shader we need to edit this file,
open the following file in notepad:
C:Program FilesAutodesk3ds Max2012mentalimagesshaders_3rdpartymentalray3rdparty.mi
We then need to add these lines so that the dirtmap.dll get’s linked to the dirtmap.mi shader file:
link “dirtmap.dll”
mi “dirtmap.mi”
Save and close the file.
Start 3dsmax.
You could also use the warp texture map (by John Burnett) to make the dirt mapa bit more irregular and therefore, realistic…
http://www.maxplugins.de/max2010.php?search=warptexture&sort=Author
You can’t use Warp because Dirtmap is a Mental Ray shader… there was/is a cool shader/modifier called Quickdirt for that, but it hasn’t been recompiled recently.
http://cuneytozdas.com/software/3dsmax/#QuickDirt
Couldn’t install this version of dirtmap in Max 2011.
Yes I edited the thirparty.mi etc…
isnt it working for max design 2012, cuz it says there is a syntax error when openin the max.
tried to install in max 2012 x64
gave me the error:
MI 0.0 error 121001: .shaders_3rdpartymentalray3rdparty.mi, line 18: syntax error
corrected after reading the3ds Max SDK Programmer’s Guide and Reference:
Full path to whom installed 3d max 2012 x64 in C:
link “C:Program FilesAutodesk3ds Max 2012mentalimagesshaders_3rdpartymentalrayshadersdirtmap.dll”
mi “dirtmap.mi”
Did anyone ever get the dirtmap to actually load?
I got the syntax error too, but solved it. The problem is the ” ” signs are different in your browser than they are in the 3rdparty.mi file:
link “dirtmap.dll”
mi “dirtmap.mi”
use these in stead:
link “dirtmap.dll”
mi “dirtmap.mi”
Hi guys, I can’t get the Dritmap to showup in my mental ray maps…
I haven’t recieved the error others have mentioned, but I did change my quote type as suggested.
3ds MAX 2010 64 bits.
Works fine. Thank you
Can’t get it to load. Tried the ambient occlusion shader with type as ‘inverted occlusion’, works great for dirt.
INSIDE THIS FOLDER:
C:\Program Files\Autodesk\3ds Max Design 2015\NVIDIA\shaders_autoload\mentalray
YOU’LL FIND 2 FOLDERS;
-INCLUDE
-SHADERS
COPY DIRTMAP.DLL TO THE SHADERS FOLDER
COPY DIRTMAP.MI TO THE INCLUDE FOLDER
RESTART 3DSMAX DESIGN 2015
this method should work on any version of 3dsmax or 3dsmax design providing you are inside the autoload folder of your installed version.
Works fine! (3ds max 2013) Thank you!