Enabling mental ray


If you're accustomed to using the Default Scanline Renderer and you're wondering if the mental ray rendering engine is good for you, the answer is yes. Actually you should try a couple of test renderings first and play with the different settings, but in working with mental ray, I've been amazed at its results.

As a raytracing renderer, mental ray is very fast. It also includes support for global illumination without having to enable the Advanced Lighting settings. In addition, mental ray can use all of Max's existing materials without having to use a limited specialized material like the Raytrace material. Each material has a new rollout that lets you specialize mental ray settings.

mental ray also includes native support for Area Lights, Shaders, Depth of Field, and Motion Blur. It also includes some specialized lights that offer functionality, such as caustics, that are unavailable in the Scanline Renderer.

To choose mental ray as the renderer for your scene, simply select it from the list of available renderers in the Assign Renderer rollout of the Common panel of the Render Scene dialog box. You can set a different renderer for Production, the Material Editor, and the ActiveShade viewer. To make mental ray your default renderer, click the Save as Defaults button in this rollout.

Once selected as your Production renderer, you don't need to modify any other settings for the renderer to work. The mental ray settings in the Material Editor, Lights category, and Object Properties dialog box enable additional features that mental ray can take advantage of, but they aren't required to render the scene. The current mental ray version is 3.5.

NEW FEATURE 

Support for mental ray 3.5 is new to 3ds Max 9.

mental ray preferences

In the Preference Settings dialog box is a panel of global mental ray settings, shown in Figure 45.12. In this panel, you can select to Enable mental ray Extensions. These extensions add some additional controls to several of the various mental ray panels.

image from book
Figure 45-12: The Preference Settings dialog box includes a panel of mental ray settings.

When the Scanline Renderer renders a scene, it progresses one line of pixels at a time down the image, but mental ray renders the image by breaking it up into blocks and rendering a block at a time. The Show Brackets on Current Buckets option displays white brackets around the current block as the image renders.

Note 

Multiple white brackets may be visible if you're rendering across a network or using a com-puter with multiple processors.

The Show Visual Final Gather Progress option displays a rough approximation of the render scene as it is being rendered before waiting for a Final Gather solution. This gives a quick look at the scene before taking the time to compute a Final Gather solution. You can also select to clear the frame before rendering.

NEW FEATURE 

The Show Visual Final Gather Progress option is new to 3ds Max 9.

The Messages section lets you specify which messages are displayed as the file renders. Options include Errors, Log Information, Log Progress, Debug Messages, and whether to write this information to a file.

Understanding shaders

A shader is an algorithm that defines how light is reflected through a scene. Surface Shaders determine the light properties that are reflected off the surface of an object; Atmospheric Shaders change the light properties as they move through a volume. Shaders can be programmed and applied to objects and scenes, and renderers like mental ray render the scene based on these shaders.

mental ray materials and shaders

With the mental ray renderer selected, all materials include an additional rollout labeled mental ray Connection. This rollout, shown in Figure 45.13, is available only if the mental ray extensions are enabled in the mental ray panel of the Preference Settings dialog box. They let you override the existing shaders used by the Scanline renderer and enable additional shaders that the mental ray renderer will use.

image from book
Figure 45-13: The mental ray Connection rollout in the Material Editor lets you override the default shaders.

The lock icons to the right of the shader buttons are the default shaders used by the Scanline renderer. To select a new shader, simply unlock these shaders by clicking the lock button. If a material is opaque, you can speed up the rendering process by flagging the material as Opaque using the option at the bottom of the rollout.

If you want to get direct access to the shaders used by mental ray, use the mental ray material type, which presents all the shaders listed in the mental ray Connection rollout.

In addition to modifying the default materials to take advantage of mental ray, a number of mental ray materials and maps (shaders) are available from the Material/Map Browser, shown in Figure 45.14. These materials and maps show up only if the mental ray renderer is the assigned renderer and are marked in the Material/Map Browser with a yellow icon. All the mental ray materials and maps are split into different libraries, which are displayed in parentheses beside their name.

image from book
Figure 45-14: The Material/Map Browser includes many additional mental ray materials and maps.

Note 

Several materials and maps in the Material/Map Browser do not work with mental ray. These items are marked with a gray icon. You can hide all these items by disabling the Incompatible option in the Show section of the Material/Map Browser.

A complete list of the mental ray materials and maps appears in Table 45.1.

Table 45.1: mental ray Materials and Maps
Open table as spreadsheet

Type

List

mental ray materials

Arch &Design, Car Paint Material, DGS Material, Glass, mental ray, SSS Fast Material, SSS Fast Skin Material, SSS Fast Skin Material+Displace, SSS Physical Material

mental ray maps

3D Displacement, Ambient/Reflective Occlusion, Beam, Bump, Car Paint Shader, Combi, Contour Composite, Contour Contrast Function Levels, Contour Only, Contour PS, Contour Store Function, Curvature, Depth Fade, DGS Material, Dielectric, Dielectric Material, Distortion, Edge, Edge Shadow, Environment, Façade, Factor Color, Glass, Glow, Height Map Displacement, Landscape, Layer Thinner, Light Infinite, Light Point, Light Spot, Material to Shader, Metal, mia exposure simple, Mist, mr Physical Sky, Night, Ocean, Opacity, Parti Volume, Parti Volume Photon, Photon Basic, Reflect, Refract, Shader List, Shadow Transparency, shaveMRGeom and Hair, Simple, SSS Physical Shader, Stain, Submerge, Texture Remap, Texture Rotate, Texture Wave, Translucency Transmat, Transmat Photon, Transparency, Two-Sided, UV Coordinate, UV Generator, Water Surface, Water Surface Shadow, Wet-Dry Mixer, Width from Color, Width From Light, Width form Light Direction, Wrap Around, XYZ Coordinate, XYZ Generator

Using the Arch &Design materials

The Arch &Design materials are a set of advanced mental ray materials designed for architects to add to buildings and surfaces found in architecture renderings. All of these materials are based on physical properties that are typically found in environments lighted with global illumination.

NEW FEATURE 

The Arch &Design materials are new to 3ds Max 9.

Many of the Arch &Design materials are already defined and available in the Templates rollout. The available presets include Pearl Finish, Satin Varnished Wood, Glazed Ceramic, Glossy Plastic, Masonry, Leather, Frosted Glass, Translucent Plastic Film, Brushed Metal, and Patterned Copper.

For each template, several rollouts of parameters are available for defining the Diffuse, Reflection, Refraction, Translucency Anisotropy Fresnel Reflections, Bumps and Self-Illumination properties along with a full selection of maps. Figure 45.15 shows a sampling of the available materials.

image from book
Figure 45-15: The materials in the mental ray Arch &Design collection include a broad set of physical properties.

Within the Special Effects rollout are two specialized options that add to the render realism. Ambient Occlusion lights the scene based on how accessible ambient light is to scene objects. Areas that face a wall or that are blocked by other objects are recessed in shadow. Areas facing the lights are highlighted more. Using the Samples and Max Distance, you can control the contrast of the resulting image. Figure 45.16 shows an example of Ambient Occlusion.

image from book
Figure 45-16: Ambient Occlusion lets you light the scene by controlling the ambient light that get bounced around the scene.

The other useful special effect option is Round Corners. When applied to a mechanical object, the object's edge is rounded so the light source highlights the edge, but no change is made to the object's geometry. This creates a realistic soft edge without the time or extra polygons to create it using geometry.

Using the Car Paint material

When cars are painted in the factory, the paint is actually composed of two different layers that give the car its unique look. The under coat is called the flake layer and it shines through the top layer. The mental ray Car Paint material includes settings for defining both of these layers. Figure 45.17 shows a car painted with this material.

image from book
Figure 45-17: Cars rendered with the mental ray Car Paint shader use multiple layers just like real cars.

NEW FEATURE 

The Car Paint material is also new to 3ds Max 9.

Using the Subsurface Scattering materials

The four mental ray materials that begin with "SSS" are Subsurface Scattering materials used to shade human skin. Skin has an interesting property that allows it to become slightly translucent when it is placed in front of a strong light source. The ears in particular are a good example of this because they allow light to penetrate and highlight their features.

Mental ray lights and shadows

If you look in the Lights category of the Create image from book Lights image from book Standard Lights menu, you'll see two mental ray specific lights: mental ray Area Omni and mental ray Area Spot. These area lights spread light from a defined area in the Area Light Parameters rollout. By default, all mental lights use the Global Settings for their illumination values, but by using the mental ray Indirect Illumination rollout, shown in Figure 45.18, found in the Modify panel, you can override the global settings for the selected light.

image from book
Figure 45.18: The mental ray Indirect Illumination rollout lets you define the light settings for individual lights.

Enabling mental ray Shadow Maps

In the Shadows drop-down list is an option to enable mental ray Shadow Maps. These shadow maps are more accurate than normal shadow maps.

Using mental ray Sun &Sky

If you want to quickly create an outdoor scene and render it using mental ray then the Daylight system that uses the mr Sun and Sky is an easy quality solution. Before adding the Daylight system to your scene, switch the renderer to mental ray in the Render dialog box. Then add the Daylight system to the scene and in the Modify panel, select mr Sun in the Sunlight drop-down list and mr Sky in the Skylight drop-down list. When you first select the Daylight system, a dialog box appears recommending that you use the Logarithmic Exposure Control with Exterior Daylight Flag enabled. Click the Yes button to enable this control. When your select the mr Sky option, another dialog box appears asking if you want to enable the mr Physical Sky environment map. Click Yes to this also.

NEW FEATURE 

The mr Sun and mr Sky lights are new to 3ds Max 9.

If you look in the Environment panel, you can see the mr Physical Sky material applied. This material defines how the sky and ground planes look. The default settings look pretty good.

The Daylight system includes controls for positioning the sun in the sky based on a physical location, day of the year, and time of the day. By changing these controls, you can manipulate the sun's position in the sky relative to the scene objects. If the sun appears in the viewport, it is rendered with lens flares, as shown in Figure 45.19.

image from book
Figure 45-19: The Daylight can be endowed with mr Sun and mr Sky.

Understanding caustics and photons

Light properties for the mental ray renderer include four unique properties: Energy, Decay, Caustic Photons, and Global Illumination (GI) Photons. You can find the settings for these properties in the mental ray Indirect Illumination rollout. Before learning about these properties, you need to understand what caustics and photons are.

Caustics are those strange glowing lines that you see at the bottom of an indoor swimming pool caused by the light refracting through the water. Caustics are common in nature, and now with mental ray you can add these effects to your scenes. Photons are small bundles of light energy and like the raytracing rays they are emitted from a light source with a given amount of energy. This energy is lost as the photon travels and as it hits objects in the scene.

The Energy value is the amount of light energy that each photon starts out with, and the Decay value specifies how quickly that energy dissipates. The number of Caustic and GI Photons determines the resulting accuracy of the lighting. More photons yield a better solution, but the greater number also increases the render time substantially. The Multiplier and color swatch lets you set the intensity and color of the caustics.

NEW FEATURE 

The ability to alter the caustics intensity and color is new to 3ds Max 9.

Figure 45.20 shows a swimming pool with caustics glowing on the side of the wall. The left image shows the pool scene with caustics disabled, and the right image shows them enabled.

image from book
Figure 45-20: This indoor swimming pool scene is rendered without caustics (left) and with caustics (right).

To get caustics to work in your scene, you need to add a Raytrace, Flat Mirror, or Reflect/Refract map to the Reflection map channel for the material that you want to generate caustics.

Tutorial: Using Caustic Photons to create a disco ball

When using the mental ray renderer, you can see the caustic photons as they are reflected around the room to help you determine the correct settings you need, but these photons themselves can be used to make a good disco ball effect.

To create a disco ball effect using caustic photons, follow these steps:

  1. Open the image from book Disco ball.max file from the Chap 45 directory on the DVD. This file includes a simple room.

  2. Select Create image from book Standard Primitives image from book Sphere, and click in the Top viewport to create a sphere positioned toward the top of the room.

  3. Press the M key to open the Material Editor, and select the first sample slot. Select the map shortcut for the Diffuse color, and select the Raytrace map type in the Material/Map Browser. Then drag the Raytrace map in the Map rollout from the Diffuse Color to the Reflection map, and select the Instance option in the Copy Map dialog box that appears. Then enable the Faceted option; set the Opacity to 50, the Specular Level to 95, and the Glossiness to 30; and drag the material to the sphere object.

  4. Select Create Lights image from book Standard Lights image from book mr Area Omni, and click in the Top viewport to create four lights that surround the sphere object. In the Modify panel, change the Multiplier value to 0.3 for each of these lights, and offset each light vertically from the others.

  5. Open the Render Scene dialog box (F10), and switch the Production Renderer in the Assign Renderer rollout of the Common panel to the mental ray Renderer. In the Indirect Illumination panel, enable the Caustics option and the Radius option, and set the Radius value to 1.0. Enable the All Objects Generate and Receive Caustics &GI option. Then click the Render button.

Figure 45.21 shows the resulting disco scene with thousands of lights visible on the walls.

image from book
Figure 45-21: This disco ball simply reflects the caustic photons around the room.

Enabling caustics and global illumination for objects

Another "gotcha" when dealing with caustics and global illumination is that each object can be specified to generate and/or receive caustics and global illumination. These settings are found in the mental ray panel of the Object Properties dialog box, shown in Figure 45.22. This dialog box can be opened using the Edit image from book Properties menu command. If your scene isn't generating caustics and you can't figure out why, check this dialog box, because the Generate Caustics option is disabled by default.

image from book
Figure 45-22: The Object Properties dialog box includes options for generating and receiving caustics and global illumination.

Tip 

The Indirect Illumination panel of the Render Scene dialog box includes an option that can be used to cause All Objects to Generate and Receive Caustics and GI. Enabling this option enables these options for all objects regardless of their Object Properties settings.

Controlling Indirect Illumination

In addition to the light settings, you can set many of the properties that control how caustics, global illumination, and final gather are computed in two rollouts of the Indirect Illumination panel of the Render Scene dialog box, shown in Figure 45.23. These two rollouts are the Final Gather rollout and the Caustics and Global Illumination (GI) rollout.

image from book
Figure 45-23: The Indirect Illumination panel includes settings for caustics, global illumination, and final gather.

The Final Gather rollout is split into two parts. The top part features a set of Basic settings with several Presets that take the guesswork out of the settings. Simply choose one of the presets from the drop-down list and all the key settings are automatically made for you. The preset options include Draft, Low, Medium, High, and Very High. The Multiplier and color swatch changes the intensity and color of the indirect light. The Weight value sets how much indirect light affect the final gather solution.

NEW FEATURE 

The Final Gather presets, Multiplier, color swatch, and Weight values are new to 3ds Max 9.

For caustics and for global illumination, the Maximum Number of Photons per Sample value determines how the caustic photons are blended. A higher value results in more blending and softer edges. The Maximum Sampling Radius value sets the size of each photon. This value is set automatically depending on the size of the scene. However, you can enable the Radius value and enter a new value manually.

The Volumes setting is used by Volume material shaders to set the photon's size. The Trace Depth settings determine the maximum number of reflections and refractions that a photon can take before it is ignored.

Photon maps can take a while to generate for a complicated scene, but once computed, they can be saved and reloaded. These files are saved using the .PMAP extension.

Final gather sends out rays to a scene that has computed caustics and global illumination already and computes the light at that location. All these rays are then combined to produce a total lighting picture of the scene and then blended to help fix any lighting abnormalities that may exist in the scene. The Samples value determines how many rays are cast into the scene. The final gather lighting pass can then be saved to a file after it is computed.

Rendering control

The core rendering settings for the mental ray renderer are contained within the Renderer panel of the Render Scene dialog box, shown in Figure 45.24. Using these settings, you can increase the speed of the renderer (at the expense of image quality).

image from book
Figure 45-24: The Renderer panel includes several rollouts of settings for controlling the mental ray renderer.

The Sampling settings are used to apply an anti-aliasing pass to the rendered image. These samples can be filtered, and you can control the details of the contrast between the samples. The Bucket Width is the size of the blocks that are identified and rendered. Smaller buckets do not take as long to render and provide quicker feedback in the Render window.

The mental ray renderer uses several different algorithms, and you can specify which ones to ignore in order to speed up the rendering cycle. If a needed algorithm is disabled, the features that rely on that algorithm are skipped. You can also set the Trace Depth for Reflections and Refractions and control the Raytrace Acceleration values.

Advanced mental ray

The mental ray renderer also includes many additional features that you can take advantage of, including Depth of Field, Motion Blur, Contours, Displacement, and Camera Shaders. The settings for these additional features are located in rollouts at the bottom of the Renderer panel.




3ds Max 9 Bible
3ds Max 9 Bible
ISBN: 0470100893
EAN: 2147483647
Year: 2007
Pages: 383

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net