2010-04-06

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.

16 comments:

  1. very clever.

    Keep them coming:)

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

    ReplyDelete
  3. Try the Composite shader/material

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

    ReplyDelete
  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?

    ReplyDelete
  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

    ReplyDelete
  7. awesome. thank you indeed! :)

    ReplyDelete
  8. this is really helpful!!! thanks!

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

    ReplyDelete
  10. 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.

    ReplyDelete
  11. Good post....thanks for sharing.. very useful for me i will bookmark this for my future needed. thanks for a great source.
    Affordable Coursework Help

    ReplyDelete
  12. 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.

    ReplyDelete
  13. This is my Good luck that I found your post which is according to my search and topic, I think you are a great blogger, thanks for helping me outta my problem..
    Dissertation Abstract Help

    ReplyDelete
  14. 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

    ReplyDelete