DM Multimedia Ltd
 
 DM Multimedia - Studio 3D Max Tips and Tutorials - Production Shaders in Mental Ray

 Home Page
 MK1 Escort RS
 MK2 Escort RS
 MK1 Capri RS
105E Anglia
 MK IV Concept Capri
DALEK - Dr. Who
 3D CGI Work
 3D Tips & Tutorials
 Introduction / Menu
 1. RS Alloy (Capri)
 2. BBS Alloy
 3. Headlight - Spherical
 4. Puddle Texture
 5. mr Paint Techniques
 6. Brake Disc Mapping
 7. Mental Ray caustics
 8. Simple Tyre Tutorial
 9. Simple Metal Material
 10. Production Shaders
Scientific Illustrations
Client Work
Posters & Fine Art Prints
E-mail DMMultimedia.com
close Button Latest MK1 Image
 
close Button Latest MK2 Image
 
close Button Latest MK1 Capri Image
 
  3DS Max Tutorials - Using the Production Shaders in Mental Ray
 
 Part 1. Simple example using Mental Ray's Matte and Environment Production Shaders
 Part 2. Second part of the example using Matte and Environment Production Shaders
 Part 3. Variation of the above example using Matte and Environment Production Shaders
 Part 4. Extra tips and tricks and using the Advanced (hidden) Production Shaders

Mental Ray's Production Shaders in Studio 3DS MAX part 1

Production Shaders in actionThe new set of Mental Ray Production Shaders in 3DS Max enables a whole set of features to help with compositing 3D models into images/environments. An example of these shaders in action (created by Zap Andersson) can be found on YouTube here.

In this first example we will use the Environment/Background Switcher, Environment/Background Camera Map, Environment/Probe Chrome Ball and Matte/Shadow/Reflection shaders. This tutorial is constructed in Max 2009 Design - but it is possible to use these shaders (The shaders use slightly different names and gui layouts) in Max 2008.

In Max 2008 some of the shaders are "hidden" by default. To unhide them you will need to open the .mi files in a text editor and remove the ", hidden" from each declaration. See below.

For MAX 2008 owners:

Close Max 2008 - stop the program. Locate the 3ds_Max_2008\mentalray\shaders_standard\include\production_max.mi text file. MAKE A COPY and save it. Open the original production_max.mi file in a text editor and locate the following:

gui_mip_rayswitch_environment
gui_mip_cameramap
gui_mip_matteshadow
gui_mip_mirrorball

And remove the     ,# "hidden"    at the end of each GUI declaration. Resave the file.

Restart Max 2008. You will find some new shaders available in the material editor list.


SUPPORT FILES:      

IMAGES AND TEXTURES -  backgrounds.zip ~8 Mb zip filerequired for this tutorial

FURTHER RESOURCES: Master Zap's Blog - LINK TO FURTHER FILES TO DOWNLOAD

MENTAL RAY - Production Shaders PDF

Setup of textures for a simple scene using Matte/Shadow/Reflection shader

Tutorial 1 : Production Shaders

In this simple scene we will use the following shaders:

  • Environment/Background Camera Map, Shader to take the background image. In this example this is the image of the table. With this shader it is also seen to reflections, and also as a background to the Matte shader below.

  • Environment/Probe Chrome Ball, Shader to take a Chrome Ball or Probe image to use as the environment for reflections and lighting. It will unwrap the spherical image and use it as an environment map.

  • Environment/Background Switcher, This shader is used in the global environment slot. It switches between the Background Camera Map (for reflections coming from the rear of the image) to the Probe Chrome Ball for all reflections coming from behind the camera.

  • Matte/Shadow/Reflection, This shader is a Matte plane that will show the background camera map but also allow the catching of direct illumination shadows and/or Ambient Occlusion shadows.


Initial Setting up

Open a new scene.

Max2009 starts with Mental Ray selected as the default Renderer. If you are using Max2008 switch to the Mental Ray renderer.

We will work in a linear workflow, so adjust your Gamma to the following. This is explained in more depth in many articles but it is mainly to give a correct display on your monitor, so brightness is more linear. Go to Customise, Preferences and adjust the display, input and output to 2.2 - and enable the Affect Color Selectors and Affect Material Editor:

Adjust the Gamma settings in 3DS MAX

Units

By default Max 2009 uses metres instead of generic units. If you are using Max2008 switch to Metres by going to the main menu and selecting Customise, then Unit Setup. Click on Display Unit Scale, Metric. It is not essential in this example but good practice.

Exposure Control

By default Max 2009 opens a new blank scene with the mr Photographic Exposure selected. If you are using Max 2008 go to the Environment panel (the 8 key) and select the mr Photographic Exposure. In Max 2009 and Max 2008 setup the values as shown below.

A very important selection we are making is the Physical Scale should be set to unitless. If we were using correctly scaled photometric lights or the mr Sun/Sky we would choose Physical units. We will use standard lights (normally set to value 1.0 by default) so we will use the unitless settings. (It is perfectly possible to use the physical settings but we would also need to boost a lot of shaders shadow maps, intensities etc. to real world values - it is simpler using unitless)

Setting mr Photographic Exposure settings
mr Photographic Exposure settings

Setting up our Material Editor Slots

Select the first material slot and click on the Get Material icon.

Get Material 3ds Max Material editor
Get Material for first material slot

In the Material/Map Browser scroll down past the Materials to the Maps and select the Environment/Background Switcher (mi) Map (this may be called something slightly different in Max 2008).

Mental Ray Environment Background Switcher Map
Material Map Broswer showing Environment Production Shaders (Max 2009)

With this Map in Material Slot one rename it to Environment. This has slots for Background and Environment/Reflections. We will now create the maps for placing in these slots - leave these empty for now.

Select the second material slot and click Get Material again. This time select Environment/Background Camera Map (mi) from the Material/map Browser (shown above). Rename this to Camera Map. This is our background image. Click on the map slot and load in the image Garden.jpg shown below . The Multiplier value can be increased if you want a brighter image when balancing the mr Photographic exposure and background image.

Garden backplate image
Garden Backplate Image

One VERY important value we have to change is the Reverse Gamma Correction value. As we are using a linear workplace and most LDR JPEGs have a gamma of 2.2 we need to change this value from 1.0 to 2.2. While JPEGs mostly have a gamma of 2.2 take care if using PNGs as these can have different values of Gamma (And it can cause problems as it is not read correctly). An exception to this Gamma Value is for HDRIs which should have a Gamma of 1.0. Almost all commercial or freely available HDRIs have a Gamma of 1.0.

We are using a JPEG so set this value to 2.2 as shown below.

Mental Ray Camera Map
Mental Ray Environment/Background Camera Map (mi)

Now we select the third material slot and load an Environment Probe/Chrome ball (mi) map and rename it Chrome Ball. This is the map that will produce the environment for reflection that is behind the camera by using a chrome ball or spherical probe image. Click on the map slot and load the Garden_mirrorball.tif image (shown below).

Garden Mirror Ball Image
Garden Mirror Ball Image

Again set the Reverse gamma Correction to 2.2. And this time we do boost the environment a little by setting the Multiplier to 1.3.

Mental Ray Environment Probe / Chrome Ball Map
Mental Ray Environment Probe/Chrome Ball

Go back to material slot 1 (we named Environment) and drag the Camera Map into the Background slot, and the Chrome Ball map into the Environment/Reflection Slot as shown below as Instances.

Mental Ray production Shader - Environment Switcher
Environment/Background Switcher with Background and Environment/Reflection maps added

Open the Environments and Effects window (key 8) and add the Environment shader we created above to the Environment Map slot as shown below.

Add Envrionment Switcher to the Environment swatch
Environment/Background Switcher added to the Environment Map

Select the fourth material slot and again click the Get material icon. Select the Matte/Shadow/Reflection (mi) shader as shown below.

Mental ray Production Matte/Shadow/Reflection (mi) Shader
Select the Matte/Shadow/Reflection (mi) material

Rename this to Matte Material and use the default settings (we will explore these settings later). Drag the Camera Map from material slot 2 to the Camera Mapped Background as shown below. Make this an instance. This is what is seen through our transparent Matte material.

Mental Ray Matte/Shadow/Reflection (mi) shader
The Matte/Shadow/Reflection (mi) material with added Camera Map

With the basic environment shaders defined we can move on to setting up the geometry in part 2.

This Tutorial is copyright © www.dmmultimedia.com and must not be reproduced in ANY form without prior written consent.

 

 

© Copyright 2005 DM Multimedia Ltd. - All respective trademarks acknowledged. All remaining information, images and text on this web site are the sole property of DM Multimedia Ltd. Unauthorised use is strictly prohibited.