Creating a Dirt Pass

I probably should have titled this "Adding the Grunge to your Ambient Occlusion Pass", because that's really what it is.  You now know how to create an ambient occlusion pass, so this is really just one more step.

I first start with a regular A&D shader and apply it to my scene.  In the diffuse node I applied an image that I created that looks like dirt, grunge, and scuffs.  You can scale the map by playing either with the scale in the map itself or by creating a UVW modifier to the scene.  I prefer the UVW modifier.  The reason I do this step first, is just to get the scale of the map looking right in my scene.

Then I create a mental ray material, and in the surface slot I add a mix map.  In the Mix Amount slot is where I add a Ambient/Reflective Occlusion map (I like to set my Max distance to 3' usually).  Now that the AO map is in the Mix Amount slot, Color #1 and Color #2 are being rendered but controlled by the AO map...so you can now put anything in either of the color slots.

Because I wanted to render a grunge/dirt pass, I copied and paste/instanced my map that I created into the Color #1 slot of my Mix map.  Now you can apply the shader to your scene and render.

This shader will only render the image in the areas that are occluded or in close corner areas of geometry, and give the effect of dirt and scratches that are in these tight spots, much like real life.


  1. very clever.

    Keep them coming:)

  2. Very clever idea. iLike!
    Do you know of a good way to get a dirt/grunge look as part of the final rendering and not as a separate pass? Like if i render an animation in a single pass.

  3. Try the Composite shader/material

  4. i actually use this idea with compositing shader..
    in mask section i use AO to mask section that i want so i can use any map i want ...
    then changing blending mode ....
    in my opinion its much more accurate ...
    i tried it several ways and i guess i came up with this idea...
    of course there is one way to achive this
    oh btw
    ur blog has really good tips and tricks :) i read almost all of them ...

  5. aowsame !!!!!!!!!!
    i wana do like that and mooooooore!!!
    so ...but i'm now her and i don't no anithing abut this plice >//<"
    and what the borgram did u do it?

  6. I have been reading a lot of stuff about it. but it is different presented, i loved to read this. keep it up.

    Email Marketing Software California, San Francisco

    Email Marketing Services California, Los Angeles

  7. awesome. thank you indeed! :)

  8. This is great. A good info for rendering. (http://www.123dview.com/

  9. Is there a place where you go over the way to do it with the composite shader and a mask?

    Also, this might be a terrible question, but I can't copy/paste my dirt material into the color slot. How exactly do you do that? Dragging didn't work, copying the material from the name type didn't work and saving to the library didn't work either. I can't paste into the color slot. Could you think of a reason this would happen? I'm on 2011 64-bit.

  10. Fantastic, I have been looking for a way to do this. If you start thinking about it the possibilities for controling dirt with this idea are almost endless. Can't wait to start getting into this. Thanks very much. Great site keep up the good work.

  11. You can scale the map by playing either with the scale in the map itself or by creating a UVW modifier to the scene.argumentative essay structure