Baking lights and shadows in Maya using Mental Ray Renderer

I’ve written how to bake lights and shadows onto texture files using the Maya Software renderer before, but this post is for the more exciting Mental Ray renderer. (Yes, smooth shading, final gather, normal maps!)

Here’s a simple scene set up with a few spheres and lights.

This is the mental ray render that I want to mimic by baking the lights and shadows on the texture files.

Select one or more objects that have no overlapping UVs. In Polygons mode, Go to Color –> Batch Bake (mental ray) []. If it’s greyed out, go to Display Render Settings Window and change the Render Using: combo box to Mental Ray.

In the Batch Bake options, check the Use bake set override to use more options. Select Color mode: Light and Color, check bake to one map, and set the image file type and dimensions to what you want. If you check Keep original shading network, Maya won’t replace your texture files within Maya with the newly created image which is handy. I recommend checking Orthogonal reflection (explanation at the end). Make sure you’ve selected the right camera too.

Hit Convert and wait for a while as Maya calculates and exports the new texture file.

On the left is the original texture file and on the right is what Maya exported. It needs a bit of touch up, but it’s a great start for use with Papervision3D or other 3d engines.

Now, with orthogonal reflection, the baked lighting doesn’t look exactly the same as the render. Without orthogonal reflection checked, the pv3d scene looks very much the same as the render like below.

However, the texture file that Maya spits out without orthogonal reflection selected won’t work well if the pv3d scene is rotated.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s