Archive for the ‘compositing’ Category

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.

This is a feature that was newly introduced with Max 2009 and is worth mentioning. Along with the render region, crop, and blowup options is a render selected button. Unlike the other options, this option is only located in the render frame buffer window:

-The Rendered Frame window in the top left corner (as long as you don’t have it collapsed with the Toggle UI button).

This option is a quick easy way to create a rendering of just certain objects while still being able to receive reflections lights and shadows from the scene. It’s useful for rendering dynamic animations of people moving, or that rug with tons of displacement.  Unlike, Selected, with the box on, mental ray only renders what is selected.

Before you render, be sure to hit the Clear frame buffer button (the X icon on the top left), so you don’t have anything else in your frame.

Then select the objects in your scene that you want to be rendered, switch the Area to Render mode to Selected, and hit render.

This is a great way to create masks or passes and blend them in your favorite compositing program. A couple of things to note: If you want the light information to be seamless with your beauty pass, be sure to save your FG and GI maps first.

started thinking: hey, having a volume pass would be helpful for my compositing.  Then I thought “can you even create a volume pass with mental ray”?  Still not sure officially as there is no sign of creating a volume pass in Max’s documentation anywhere.  I’m sure there are other ways, but I’ll show you how I create one.

A volume pass with mental ray

To create the above effect you have to use the Parti Volume shader.  If you don’t know how to use it check my posting on Parti Volume.  To get the render to work properly, I create a black material with a diffusion, reflection, refraction all  of 0.0. Then  plug this material into the Material Override slot in the Process tab of the Render Settings.  To get the control of the volume light itself, turn off any Indirect Illumination you may have.  Also turn off your exposure.  For rendering speed, you can also turn off any shadows you have on your lights.  Lastly, in the Parti Volume shader settings, be sure to check the Lights box.  This will only create volume light for lights that are listed in this list.  You can add as many or as little lights in your scene as you like.  To control the intensity / brightness of the volume in the render there are two factors.  The intensity of the lights themselves, and the brightness of the Scatter color in the Parti Volume shader. With these settings, they should produce an image similar to what is above.

Ok, I have my volume pass, now what do I do with it?  In Photoshop, or another image editing software of your choice, open your beauty pass (the regular render) and your volume pass.  Put the volume pass on-top of the beauty pass, and set the blend mode to Screen.  This will force everything that is black in the image to be transparent and everything that is white to be opaque.  If the volume is too subtle you can increase it by pumping up the contrast.  You can also change the color of your volume with playing with the Hue/Saturation and Colorize.