RayFire plugin

RebusFarm equips you immediately with 1700 CPUs for only 1.9 Cent/GHzh and provides the most easiest and affordable Render Farm


Texturing, Mental Ray

Creating procedural dirt in 3DS Max with Mental Ray

By Stig Atle Steffensen, June 21, 2011

Software used: 3DS Max, Mental Ray, Dirtmap shader


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

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:

Mi include files:

Installing the shader

Unpack the zip files, then copy these two files:

Into these directories:
C:\Program Files\Autodesk\3ds Max2012\mentalimages\shaders_3rdparty\mentalray\include\Dirtmap.mi
C:\Program Files\Autodesk\3ds Max2012\mentalimages\shaders_3rdparty\mentalray\shaders\Dirtmap.dll

Now, to make 3dsmax load the new shader we need to edit this file,
open the following file in notepad:
C:\Program Files\Autodesk\3ds Max2012\mentalimages\shaders_3rdparty\mentalray\3rdparty.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.

Page 1 | Page 2 | Page 3 | Page 4 | Next >


by PeterPanda - June 22, 2011 4:34 am

You could also use the warp texture map (by John Burnett) to make the dirt mapa bit more irregular and therefore, realistic…


by rs - June 22, 2011 11:02 pm

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.


by Luiz Eduardo Mihich - June 27, 2011 7:23 am

Couldn’t install this version of dirtmap in Max 2011.
Yes I edited the thirparty.mi etc…

by faik - July 5, 2011 3:36 pm

isnt it working for max design 2012, cuz it says there is a syntax error when openin the max.

by ricardo duarte - August 24, 2011 6:41 pm

tried to install in max 2012 x64

gave me the error:

MI 0.0 error 121001: .\shaders_3rdparty\mentalray\3rdparty.mi, line 18: syntax error

by ricardo - August 24, 2011 7:05 pm

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 Files\Autodesk\3ds Max 2012\mentalimages\shaders_3rdparty\mentalray\shaders\dirtmap.dll”
mi “dirtmap.mi”

by polygrinder - March 1, 2012 6:59 pm

Did anyone ever get the dirtmap to actually load?

by Jesse - April 10, 2012 11:20 am

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”

by jg - January 9, 2013 2:28 pm

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.

by Fernando - April 11, 2013 8:40 pm

3ds MAX 2010 64 bits.
Works fine. Thank you

Leave a comment


* Name, Email (will not be published), Comment and Captcha code are required. Comments are moderated.