DMMultimedia

3D Graphics, Tutorials and Tips
Using 3DS Studio Max and Mental Ray

Latest Capri MK IV updates
Latest Cortina updates
Latest Escort MK1 updates

DMMultimedia | 3d tutorials | Production Shaders in Mental Ray | Using the Chrome Ball Shaders

mr Production Shaders
Quick Links 3D Tutorials
Latest RS500
Latest RS500
Latest BMW F32
Latest BMW F32
Latest Escort MKII
3D Studio Max Mental Ray Tutorials - Using the Production Shaders - Chrome Ball I

Introduction : The 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: Zap's Production Video

This set of tutorials will show how to incorporate your models into photographic locations - using a mirror ball approach and a 360 degree HDRI environment and applying this all to incorporate a 3D car into an environment.

Tutorial 1 : Production Shaders

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

In this first example we will use the Environment/Background Switcher, Environment/Background Camera Map, Environment/Probe Chrome Ball and Matte/Shadow/Reflection shaders to create the image below. 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.

Tutorial 1 : Production Shaders

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

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 Browser 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 : Using the Chrome Ball Shaders II.