Mental Ray 101: Essentials
Mental Ray 101: Essentials
Mental Ray 101: Essentials
Jennifer O'Connor
Author, “Mastering mental ray”
11/30/2010
mental ray 101: The Essentials
Jennifer O‟Connor
[email protected] or [email protected]
The “mental ray Essentials” documents were the precursor to my new book “Mastering
mental ray” (Wiley/Sybex April 2010). The documents were originally produced for my
students at the College of Lake County and my 3ds Max user‟s group in Chicago, and have
been made available for public use via these PDF documents.
These documents were originally produced around 3ds Max Design 2009, and the
“Mastering mental ray” book was written for the beta of 3ds Max Design 2011 and has more
up-to-date information on 3ds Max/Design and mental ray, and about 275 more pages than
this document. If you like this PDF and want to buy the book please use the “Buy the book”
link on my web site www.mastering-mentalray.com and I make an extra $1.75. As any
author knows, there isn‟t a lot of money in writing books; however I enjoy learning and also
sharing what I learn and that is why these documents exist and why the book was created. I
hope you get something valuable that will help you in your work.
I am also available for personal and corporate training in 3ds Max/Design and mental ray,
both in-person at your location, at our facilities in Lake Villa Illinois, and via GoToMeeting.
Contact me at [email protected] for more information.
“Essential Settings” – the things that you should look for and learn first when learning mental
ray – will have Blue Bold text associated with them saying, cleverly, “Essential Settings”.
Although I do not cover all the settings of the renderer I tried to stick to the things I use the
most, and there are certainly things here that are aimed to the other geeks in the world.
I will also have Very Important Notes within blue-bordered text boxes. Other notes will simply
be offset with a bold “NOTE:” right before the important note.
Additional Reading
Please check out “mr 102: Lighting” available on the www.mastering-mentalray.com web
site. The Max scene files used are also at that site. The 'Light Gallery' scene provided is a
slightly modified version of a mental ray sample provided with 3ds Max. The “Mastering
mental ray” book includes over 4gb of sample files and pre-computed indirect illumination
files if you want more things to play with in mental ray!
mental ray is a registered trademark of mental images GmbH. 3ds Max/Design, Autodesk
VIZ and Maya are registered trademarks of Autodesk, Inc.
Contents
mental ray 101: The Essentials ..................................................................................................... 2
What is mental ray? .................................................................................................................... 4
Enabling mental ray .................................................................................................................... 6
mental ray General Settings....................................................................................................... 8
Distributed Rendering............................................................................................................... 10
Memory Management in mental ray........................................................................................ 12
Use Placeholder Objects ....................................................................................................... 13
Use mental ray Map Manager .............................................................................................. 13
Memory Limit ......................................................................................................................... 13
Conserve Memory ................................................................................................................. 14
Direct Illumination..................................................................................................................... 15
Indirect Illumination .................................................................................................................. 15
Indirect Illumination in mental ray ........................................................................................... 17
Final Gather ........................................................................................................................... 18
Visual Diagnostic Tool ........................................................................................................... 21
mr Sky Portals and Final Gather .......................................................................................... 30
Flicker-Free Animation with FG Lock .................................................................................... 31
Rendering Long Animations and High-Res Stills ................................................................. 32
Controlling FG Calculation .................................................................................................... 37
Global Illumination ................................................................................................................ 38
Caustics ................................................................................................................................. 39
Importons and Irradiance Particles ...................................................................................... 41
Quality Settings ......................................................................................................................... 44
Samples per Pixel (SPP) ........................................................................................................ 44
Spatial Contrast ..................................................................................................................... 45
Quality and Time.................................................................................................................... 47
Filters ..................................................................................................................................... 47
The default Scanline renderer in Max and VIZ work on an image pixel-by-pixel one horizontal
line one at a time, from top-to-bottom. mental ray, in contrast, renders scenes in „Buckets‟;
each processor core in your machine takes a small rectangular region of the rendered image
(a bucket) and processes that portion before moving on to the next available bucket.
Brackets appear around each bucket as it is processing, and when the bucket completes it
jumps to the next easiest bucket to render (by default). Here are some completed buckets,
and four that are in-process on a quad-core machine….
In the sample scenes provided with this document, mental ray is already selected.
In 3ds Max, F10 brings up the Render Scene dialog. Choose the Common tab, roll-down the
Assign Renderer section, and click the button '...' to choose mental ray:
You can also choose a Preset from the bottom of the Render Scene dialog (press F10) that
includes a few mental ray options:
Another way to set mental ray as your default renderer is to go to the Customize pull-down
menu, and select the "Customize UI and Defaults Switcher..." option, and then choose an
option with mental ray:
The right side of the dialog box optionally changes your UI. I tend to customize my UI quite a
bit, and if you do the same then be certain to save your current UI before switching things
here. The 3ds Max dialog has a few additional options over the VIZ version. The "DesignVIZ
mental ray" option is the default in 3ds Max 2009 Design.
Prior to Max 2009, if you do a region render, it will blank the area around the region when
the render completes, and you'll need to save the region to a separate file and use a
compositing program to paste that region into your original render. Adobe Photoshop or
Corel PhotoPaint skills are usually required in this field.
In Max 2009 mental ray does do Region without clearing the Rendered Frame Window,
eliminating the need for compositing regions in another application.
You can get a feel for what mental ray is doing while rendering by looking at the log that is
created. This also allows you to see any errors or warnings that are produced. Turn on the
„Show/Log‟ buttons (previous image) and press OK, and then go to the Render pull-down and
select the “mental ray Message Window…” option to see the messages as they are
generated. Usually I keep that closed, but it will open automatically if there are any errors
during the render. As you are learning mental ray it can be interesting and informative to see
what messages are being generated, including warnings you wouldn‟t know about otherwise.
This can help you to optimize and troubleshoot your scenes.
This is just one of the big advantages to using mental ray over the Scanline renderer, the
ability to use additional hardware to get your image completed faster.
When you click on the Render button your scene is translated into a format that mental ray
understands, a 'mib' format, and that translated scene data is passed on to the renderer.
3ds Max can optionally cache (store) the data to the hard drive for later reuse.
In distributed rendering, the translated scene data and associated bitmaps are sent to other
machines where each machine‟s processor core(s) will handle the rendering of an individual
bucket. The buckets are managed from the one copy of 3ds Max or Maya that you are using.
At the remote computers you need to have either a copy of 3ds Max installed, or the stand-
alone satellite version of mental ray. 3ds Max allows you to use 8 distributed CPUs without
purchasing additional stand-alone licenses..
To enable Distributed Rendering, you open the Render dialog in Max (press F10), and with
mr as your renderer, you go to the Processing tab and the Distributed Bucket Rendering roll-
down section:
NOTE: You must use the “Use Placeholder Objects” translator option when using DBR. More
on this option later.
Before it will work, you need to add the name or IP address of the remote machines to the
'rayhosts' list by clicking the Add button. Above I have six of my machines listed with five
selected for use (in blue), giving me five total machines that will be used for the render
(including my local machine). If you are running 3ds Max 64-bit, then the target machines
must also be x64.
Here is a matrix of the mr capabilities of 3ds Max and VIZ from Autodesk:
64-bit architecture N Y
Additional licenses are relatively cheap, and the pricing model seems more reasonable than
other third-party renderers such as VRay or Brazil, but you‟ll need to do some math on that.
Maya Complete 2008 gives two mr processor licenses, and Unlimited gives eight licenses.
NOTE: VIZ users that need a lot of mental ray power, or have very large scenes requiring
more memory, or want to network render mr scenes, should upgrade to 3ds Max rather than
use VIZ 2008. Since VIZ is now discontinued, an upgrade to 3ds Max is probably inevitable.
The additional functionality that 3ds Max brings to mental ray makes the upgrade a good
value, in my humble opinion.
NOTE: My experience so far is that Archvision RPC content may show up as red boxes if you
use distributed rendering. Archvision is aware of this, and hopefully this will be fixed some
time soon. In this case, use the Split Scanlines option in Network Rendering to use the other
computers.
NOTE: The bandwidth used on the network with distributed rendering seems pretty
reasonable, although we do use gigabit adapters with gigabit switches. I still tend to
Backburner network render to remote machines rather than use distributed rendering, and
use the Backburner “Split Scanlines” option for large images. Backburner differs from DBR
in that only the local copy of Max is used to render an image, or portion of an image in the
case of Split Scanlines”. With Backburner and Split Scanlines, multiple machines still work
on the one image, and progress is saved along the way if there are issues with a machine or
memory. The render „server‟ machines need Max installed, but do not need a license.
The use of this option causes the „Translator‟ – the mental ray process that converts your
scene into mental ray data – to only send to the renderers „bounding-boxes‟ (empty
placeholders) of the scene geometry. Once a bucket hits a piece of geometry that is
represented by a placeholder, then the actual translated geometry is passed to the renderer.
If needed, placeholders and their geometry can be removed from memory. This can save a
lot of memory for mental ray, and reduce network bandwidth, particularly if geometry is off-
screen or not something a distributed machine might render.
Turning this Off prevents mr from off-loading the bitmaps, and all maps are held in memory.
This can be faster, as 3ds Max also holds bitmaps between rendering jobs.
Because the algorithms used are slightly different between 3ds Max and mental ray, you
generally would not switch between these two methods for a particular image.
My experience with the mr Map Manager is that I can get ‘seams’ in some bitmaps, and I
cannot always use this feature. Turning down the bitmap‟s „Blur‟ setting fixes this, and an
alternative may be to use the 3ds Max Bitmap Pager instead.
Memory Limit
This is an Essential Setting.
This should be set somewhere near the available memory limit on your computer, figuring in
resident applications, 3ds Max and mental ray. This is the threshold where mental ray will
begin to remove placeholders (when used) and also bitmaps from memory to make room for
Conserve Memory
The „Conserve Memory‟ option causes mental ray to work harder to minimize memory use, at
the expense of additional time in the Translator reading-in placeholder objects and
reading/writing maps to the hard drive. Remember that the hard drive is an order-of-
magnitude slower than RAM, so having adequate RAM in all computers is essential to
optimal speed and efficiency in rendering.
We will cover other memory issues as we hit topics throughout the document.
Figure 2: Rendered in mr with only Direct Lighting from Photometric Spot lights in ceiling and a Photometric
Cylinder Area Light in floor lamp.
Indirect Illumination
Indirect Illumination is the light in your scene that is reflected off, and/or refracted through,
objects.
In the real-world, light strikes a surface, some of it is absorbed and the remainder will
become the color of that surface and is scattered to other surfaces. Some of it will pass
through objects and be refracted. The light is partially absorbed, reflected/refracted and re-
colored again and again until the light is fully absorbed by the surfaces. As it bounces, the
changed color of the light will affect the color of the other objects it strikes, so, for instance, a
bright red carpet will give you a pink tint throughout your room, and light refracted through
colored glass will become the color of the glass.
This image used the Indirect Illumination “Final Gather Medium” preset and Global
Illumination, and has identical exposure settings as the previous image.
As you can see, visible areas of your rendering that are in-shadow and not in direct light still
receive illumination bounced from all other visible surfaces. Those previously dark areas will
be illuminated to some degree, and your image is brighter. You also have light splashed off
of surfaces, and this is most noticeable on the ceiling.
Perhaps 80% of the light that illuminates a space is from Indirect Illumination, and
simulating this process is essential for producing the highest-quality images.
Caustics
„Final Gather‟, as we will see shortly, is a pre-process to a rendering that looks from random
points on surfaces out into the scene and collects illumination from other surfaces and light
sources, saving this information for the final render pass. At render time these FG points are
averaged around a pixel that is being rendered to add indirect illumination to that pixel‟s final
color.
„Global Illumination” is often used as a generic term for Indirect Illumination, but in mental
ray it is a type of indirect illumination. GI works in the opposite way as FG, and Photos are
shot out of light sources into the scene and bounced around to „paint‟ indirect illumination on
surfaces. Final Gather is used to clean-up and smooth the GI solution.
Caustics are the effect of light photons that have been reflected off of or refracted through
an object, and produces effects such as magnifying light through glass, or light reflection
patterns off of a water surface.
Ambient Occlusion is an Indirect Illumination effect produced inside of mental ray materials,
and are covered in Part 3. In mental ray AO is used for detail enhancement and helps to
produce contact-shadows and fine details in objects.
Without using methods of calculating indirect light, brighter and more realistic
renderings must be produced by adding lights to your scene to simulate that
missing 'bounced' indirect illumination.
So, why is Final Gather in the „mental ray 101: Essentials‟ document, and not a more
advanced chapter? First, it is easy to use and second, it adds greatly to your rendered
images and should be used for just about every scene.
FG works by taking the viewpoint of a point on a surface in your scene, it shoots random rays
out into your scene from that point, it collects the illumination and colors of the surfaces it
samples, and stores that FG data for when the surfaces are being rendered.
At render time mr averages points it finds in the area around a pixel, the averaged FG
illumination and color value are then added to the Direct Illumination to give a final
brightness and color.
FG is often used with the GI technology (described later) on interior scenes, and often used
alone for exterior scenes. However, Final Gather works very well by itself on interior scenes;
that said, for interior scenes, adding Global Illumination (GI) can greatly speed overall
rendering time and improve the brightness and quality of your images.
Final Gather does require your scene to be properly illuminated with some form of Direct
Lighting for it to produce results, and for a pleasing and accurate simulation you'll need
perhaps a minimum one-third to one-half of the scene lit with Direct Light.
NOTE: mental ray materials that use Self Illumination can produce indirect illumination when
used with FG.
Interior scenes that are lit through a small window, or have minimal lighting from small
directed light sources (a „film noir‟ scene lit from a desk lamp, for instance), may not produce
good results without some help. Even outdoor scenes that do not have a lot of direct light
(only skylight, for instance) may not work as expected, or/or may take a lot of time.
In this case, adding lights for Direct illumination, mental ray "mr Sky Portal" lights to windows
and openings, fill lights to help illumination, or (even better) just switching on GI, may help
considerably. We'll discuss these options in more detail later.
To try the FG feature yourself, first open the mr_LightGallery_Direct.max scene and render to
see Direct lighting. Then...
NOTE: If your final gather pass is taking too long, then turn down the preset to Draft, or
change the Diffuse Bounces to 0 or 1, or reduce the rendered image size.
The High and Very High presets take a Very long time, and I generally do not use them in
a production rendering. I use Medium for most final renders. If you do not get good
results with Medium on interior scenes, then see if you need mr Sky Portals, fill lights, or
the addition of GI. Proper lighting is always the first thing!
At render time mental ray averages the FG points in a small area around each pixel to give
that pixel an Indirect Illumination value. The more points it stores (Draft to Low to Medium,
and so on), and the more rays it shoots, the more accurate the FG solution and the closer to
reality the rendering.
One thing that you will notice when you render with Final Gather enabled is that it does the
rendering essentially in two passes. The first pass is the low-resolution Final Gather pass,
and after that completes, it goes back and renders the buckets for your final image using the
FG information to add indirect illumination to every pixel rendered.
This is what the scene looks like during the Final Gather pass.....
As you can see, with just the FG pass you get a pretty good idea how the overall rendering is
going to look, albeit in a low-resolution fashion. The higher the preset, the less grainy the FG
pass, but the longer it will take to produce.
One added benefit to the Final Gather pass is that it allows you to see a quick preview of
what the Indirect Illumination is going to look like (and your rendered scene) before
committing yourself to the actual Render pass. With the FG you can often times skip the
render pass when doing test renders, and you can cancel and go back to make adjustments
to FG settings, materials and lighting, if needed, without the long wait you would have for a
render pass.
The Draft FG Preset is great for test renders, obviously, and Medium and even Low give good
final results.
(Reference the image on next page…) With mental ray and Final Gather turned On and set
to Draft, go to the Processing tab in the render dialog (F10) and enable Visual Diagnostics
checkbox and choose the Final Gather radio-button…. render the scene...... and observe the
results……
Here are the Final Gather settings for the Draft preset:
At each green point shown, the FG process shot 50 rays randomly into the scene and
collected the illumination and color at those points. Because Diffuse Bounces is set to 2,
each ray propagated two more bounces and collected more illumination and additional color
information. The rays take into consideration the inverse-square decay of light over distance.
With Draft preset, for every pixel in the final rendering mental ray averaging the 30 nearest
FG samples into the indirect illumination for that pixel.
It is important to remember that each point is stored in 3D space, and is view dependent. I'll
discuss this shortly.
This diagnostic mode gives you a visual idea of where it is calculating Final Gather points;
areas that need more definition get more points; areas with the greatest change in lighting
values and contrast have the highest concentration of points, as do areas of high detail.
Just for curiosity‟s sake I rendered a half-size image at the Very High preset and Diagnostic
mode:
I could see rendering this Very-High setting FG pass at this small size and saving the FG data
to be reused in a large render. Otherwise, stick with Medium or less, and tweak the values
you need to tweak. Again, FG plus GI would be a good choice if you need the highest quality,
but GI takes some time to master.
FG View Dependency
Final Gather points are stored in 3D space and are View Dependent, in that it computes
points based on what it can see in the rendered viewport. Anything that is not seen is not
computed, so any change to the view (an animation or alternate camera angle) requires
everything to be re-computed for that new view. As we‟ll see later, there are ways to save FG
data, but remember that animations and alternate camera views requires additional
computing. The points are stored in 3D space, and can be re-used in other views, so that
only missing data needs to be added to those other views.
FG Settings
For those looking for the Essential Settings, choosing a Final Gather Preset is the way to go.
It is a great way to see what settings are changed from one to another, and what you might
want to tweak. If you need to, then dig into what each of these settings mean……
The main settings that are changed with the different Presets are:
Initial FG Point Density: quantity of FG points in the scene. The more, the better the FG
accuracy, but too high greatly increases render time without corresponding benefit.
Rays per FG Point: number of random rays looking out to the scene from each FG point,
collecting illumination and color. The more, the better. Since the rays are random you
need to have a good sampling to prevent FG points from being too dark or too bright.
The next setting helps with this, too.
Interpolate Over Num. of FG Points. A smoothing between the FG points. Too high
removes details in shadows and lighting, reducing contrast, and too low is splotchy.
A FG setting that is not changed with a preset is the Diffuse Bounces, which is the number of
times the light is bounced in your scene before mr calculates another ray. It increases the
brightness and accuracy of your scene, and values of 1 or 2 are usually sufficient, depending
on the time you have available to render. A value of 5 is about as far as I go. I tend to use
the lower settings as it produces an image with better contrast, in my humble opinion.
Interpolate FG Points
Since rays shoot out randomly, some will be overly bright because they randomly strike bright
surfaces/lights, and others will be dim for the opposite reason. Interpolation helps to level
the illumination in the FG solution.
This Interpolation setting is 30 FG points on Draft, and doesn‟t change until the Very High
preset, and is then 100. You can, of course, adjust this manually if you want to blend more
or less FG points to soften or sharpen the FG results, respectfully. Too high of a value will
reduce illumination detail in your scene as it will average over a larger area, and too low
leaves splotches.
It is a little like a Paint-Ball gallery now, a rendered version of the FG pass, and you are
seeing the individual FG samples, noise filtered, and added to the direct illumination.
You‟ll notice that in the Interpolate=200 side that there are few shadow details, particularly if
you look at the baseboard. This side also seemed to take a lot more time, as mental ray
must look for more points to interpolate for every rendered pixel.
Figure 9: FG Low Preset with Zero (right) and 5 (left) Diffuse Bounces.
Because this was Low preset there wasn't much of a time penalty with this scene, however
you may see your final-gather times multiply by the number of diffuse bounces. Adding
bounces does make a scene brighter, closer to actual lighting perhaps, but can also reduce
contrast in images.
Some diffuse bouncing is essential, and a setting of 2 is not unusual for many of my scenes
and gives good contrast. Leave at 0 for test renders, go to 2 for most renders, and go to 4 or
5 for high quality results. I recommend that, if you need high settings for FG bounces or
other high FG settings, then you may want to look at your lighting, whether you need to add
mr Sky Portals or fill lights in particular, or should add GI for a faster high-quality solution.
Changing the color watch tints the color of the Indirect Illumination, to perhaps tone down a
heavy FG „tint‟ from a saturated surface, or for special effects. Keeping it white, and
multiplier of 1.0, produces physically correct lighting.
Weight
You can reduce the effect that FG Diffuse Bounces have over indirect illumination by
adjusting the Weight setting. Weight is a value between 0.0 (no Bounced Light) and 1.0 (full
effect of Bounced light). This is different than Multiplier, which adjusts the primary FG effect
and not the additional bounces.
I generally do not adjust the Weight value. If you are getting too much splash off of grass on
an exterior scene, for instance, this can help tone that down, although you are better off
using an Arch & Design material and adjusting the FG effect for just that material.
Here are renderings with 2 bounces, and 1.0 and 0.5 weight settings respectively....
If your FG solution is splotchy or you have some random bright spots, then try switching to
High, and then go up from there. It does take more computation time.
For interior scenes, much of the splotchiness you may experience can only be resolved
by adding mr Sky Portals to the exterior windows and openings, and/or adding some fill
lights into the scene. mr Sky Portals also greatly increase the brightness of your interior
scenes.
This is similar to the Attenuation value for lights, and adds additional attenuation on top of
the inverse-square decay of light over distance.
If you need to speed up the FG process, this setting can help. Don‟t make it too small!
The default Final Gather Map „fgm‟ file location is in the '\sceneassets\renderassets\' folder
of your current project. This feature can also be enabled with the checkbox in the Rendered
Frame Window (RFW), in the center, below, with a default file name of “temp.fgm”:
When you enable the 'Read Only' checkbox or the Lock icon (RFW), the FG pass of each
frame's render take zero time.
Not only is the scene darker than what you would expect with a scene with a large window
and Daylight lighting, but the random nature of Final Gather causes some samples to see out
the comparatively very-bright window more often than other samples, and creates a very
uneven FG solution. Turning up the FG settings, turning up FG Noise Filtering, or using GI will
not resolve the situation.
The mr Sky Portal is covered in more depth in “mental ray 102: Lighting”.
NOTE: Flicker-free animation takes many factors to produce, from correct Sample Rate and
Filtering, to the Final Gather settings. This is only one part of the equation.
The technique for animations is to do a FG pass on every 5, or 10, or 25 or more frames with
the 'Read Only' checkbox Off, then render all of the frames with the checkbox On. In Max
2009 you can set the “Every Nth Frame” render „common‟ parameter to the interval you
need, and then use the “Generate Final Gather Map File Now” button. Max will then produce
only the FG pass for the settings you have in the Common tab.
What quantity to use for the Nth Frames setting depends on the speed of your camera and
how much new geometry is exposed per-frame. Remember that FG points are stored in 3
dimensional space and are View Dependent; only things that are viewable in the rendered
window are calculated and ultimately stored. By rendering every Nth frames, you should be
storing enough FG data that the Interpolation still gives you a smooth FG solution.
For long, slow, walking-down-the-street animations I‟ve used Nth Frame = 25, and for
interiors where the camera is panning while moving I‟ve used 5, and may even go back and
add a few FG passes for frames in fast areas. You can do different parts of the animation
with different Nth Frames settings, depending on your needs, just keep the lock Off and the
FG data will accumulate.
Once the FG pass is completed and the Lock option is used, NO FG calculation is done for
any rendered images. The pre-calculated FG data is re-used, and mr goes directly to the
render pass. Overall render times drop considerably as there is no FG pass, and this is
particularly true when high FG settings were used.
For still images, if you are rendering multiple camera views, you‟ll need to Read/Write any
missing information for each view.
If your rendering has dark or bright splotches that you cannot account for, then it may be
time to create a new FG map file. Remember that any bad or inaccurate information
stored in the fgm file is never replaced, and only accumulates until deleted.
NOTE: You need to remember to clear the FG data by pressing the or recycle button
when you make changes in lighting, or significant material changes that will affect the FG
solution.
NOTE: I have had random occasions where the FG file became corrupt, or one machine on
the network decided to recreate the file, thus destroying the FG data. It is good practice for
any critical .fgm file to copy it to another folder and keep it safe.
Switching to a combined FG and GI solution can help with memory issues, as you can often
get by with Low or even Draft FG settings just to clean-up the GI data. Using the new
Importons with FG and GI helps even more, as do Irradiance Particles (all in Part 4). As we‟ll
talk about in Part 4, high GI settings can crash your renderer, too.
The best way to manage this process is to use the Batch Render utility and set up each
camera, render preset, and file output that you need, both for a „FG Save‟ and a „FG
Locked‟ pass.
For determining your high-resolution print size, 3ds Max provides a „Print Size Wizard” that
will choose image resolutions, and dots-per-inch settings, for most common sizes of paper.
Choosing a file name in the wizard automatically chooses the „TIFF‟ file format, which is
preferred by print service bureaus and also will store the DPI information with the file.
Always remember that a pixel-for-pixel image is never required when doing large-format
printing, as the print device will dither (blend) between pixels. Any graininess seen on a
computer screen almost never translates to print graininess because of this smoothing,
and a billboard has huge pixels when seen up-close.
In the batch utility create two jobs for each camera; one with the FG preset “FG Save”, and
another with the render preset “FG Locked”. The utility will run the batch for the FG Save
pass, and then the high-res FG Locked „frozen‟ pass.
Batch jobs are rendered from top to bottom, and you can‟t rearrange them. If you have a
number of cameras then your batch list may get out of sequence, and you‟ll have to
enable and run the FG Save passes, then select and run the Locked passes separately.
The file names don‟t have to be different for each pass, but this protects each batch-run
image from getting overwritten in case you need it later. You don‟t want to overwrite a high-
res rendering that you might need with a future low-res pass.
Backburner is a great utility whether you have one machine or 1000. All you need is a
functioning network or an always-on Internet connection that gives you an IP address. See
the 3ds Max documentation for specifics.
The Split Scan Lines option is in the Network Job Assignment window. The „Define‟ button
allows you to choose how many strips will be created:
Rendering to Split Scan Lines can help machines with smaller memory sizes handle the
bigger images, as the Render Frame Window and associated buffers are only as large as the
strip. This combined with a lower-resolution FG pass, can help greatly with memory issues.
Turning off the RFW will also save memory and a small amount of render time.
The Split Scan Lines option has a few additional advantages in that it eliminates the need to
use Distributed Bucket Rendering (although you can use that) and with Backburner you can
use all your machines without mental ray license limitations and can render with 9,999
machines without additional licenses. DBR requires mental ray licenses beyond your 8
external processors.
Split Scan Lines also helps to protect you from losing a lengthy high-res render if a machine
crashes or cannot handle the full image after rendering for a while. It happens.
With Split Scan Lines, if a machine crashes all you‟ll lose is that one strip, nothing more.
It is an essential tool.
Right-click on an object and choose the Object Properties option in the quad-menu to get to
this dialog.
If you have an object that is far away or is animated, you may want it to receive FG but not
contribute to or affect FG, saving time and memory. It will get interpolated FG data. This is
also useful for objects like high-poly trees or polygon-based lawns, where you might pass-
through the calculation to a base object, but receive the FG illumination bounced from that
base.
In the mental ray “Arch & Design” material there is an advanced setting for controlling the FG
calculation for surfaces with that material:
Global Illumination
Figure 11: Daylight scene with Low FG and 0 Bounces, and Global Illumination.
With FG, mental ray took the point of view of the surface being rendered, looked out into the
scene, and computed indirect illumination from the rays it cast.
GI, in contrast, works from the light source and shoots Photons (rays of light energy and
color) into the scene and bounces them around to compute indirect illumination. The photon
method is closer to what happens in nature, and photons can trace through reflections, bend
through refractions, and are absorbed and reflected in a scene. Photons are needed to
generate Caustic effects, too.
Unlike FG, GI is not view-dependent and the entire scene and its light energy is computed at
once for all geometry and lights. This can be saved for reuse.
With GI you need Photon Generators (lights – ideally photometric), and objects enabled to
produce and use GI. Right click on an object and go to Object Properties, then the mental ray
tab:
I have not enabled GI in many scenes at this point, and have been sticking primarily with
Final Gather for my scenes. Ideally FG and GI would be used together for interior scenes and
certainly deserves consideration, but will need more space and time than I have to describe
at this point. This will be covered in Part 4 of this series.
Caustics
Caustics is an Indirect Illumination function, and uses photons to simulate the concentration
of light through transparent objects (refraction), and scattering of light off of reflective
surfaces. Examples would be magnifying glasses and light through the wavy surface of water
projected onto the ocean floor, and reflection of light off of the water onto objects.
Irradiance Particles
As a preview of "mr 104: Advanced Indirect Illumination", here is the Light Gallery scene
using Irradiance Particles as its only source of Indirect Illumination:
It is a much richer image from a color and lighting standpoint, in my humble opinion.
Especially notice the leather material on the couch, which now matches perfectly the
material as shown in the material editor, and not a somewhat hazy material. This is not a
photon or Final Gather based indirect illumination, but something new.
Looking at the diagnostic image for the photon map shows how it has cleaned up the
photons in areas where they do not add much to the details of the final image:
The colors show the Density of Photons in an area; High density is displayed in red, and lower
values render in increasingly cooler colors. This is as compared to the map without
Importons:
Basically, this is how hard mental ray is going to work at rendering a pixel, or group of pixels,
based on the composition of your scene. You have a Minimum and a Maximum setting to
limit how little, or how much, the rendered image is refined. This refinement is referred to as
“Anti-Aliasing”. Collectively the Sampling Quality settings are our main Anti-Aliasing settings.
„Aliasing‟ is, basically, the jagged edges of objects in your rendering.
The different Min/Max settings allow some areas of your rendering to get little attention
(environments and flat evenly-lit areas), and others to get more attention, particularly the
edges of objects that must anti-alias (blend) with nearby pixels. mental ray will progressively
subdivide the pixel until it gets to the Maximum SPP setting.
The SPP options are: 1/64, 1/16, 1/4, 1, 4, 16, 64, 256 and 1024. Settings below 1 are
considered „Under-Sampling‟, and greater than 1 is considered „Over-Sampling‟.
A SPP setting lower than One, 1/4 for instance, means that it starts rendering pixels in a
„Sample‟ group of 4 pixels. If the Sample (our 4 pixels in this example) have an intensity
(contrast) greater than the “Spatial Contrast” setting (described next), then we jump to the
next higher SPP setting.
In the example setting shown above, each pixel would be sampled (SPP=1) and if the pixel
(sample) next to it had a contrast (color difference) greater than 0.031, then it would
subdivide that pixel into 4 samples (the next in the list of SPP settings).
The SPP settings in Max jump by a factor of four because when the spatial contrast is
exceeded each sample is then split horizontally and vertically, subdividing each sample by
four,
The Rendered Frame Window has a slider for selecting some common presets. I‟ll use 1/4
and 4 for draft renderings, and will use 1 and 16, or 4 and 64, for many final renders. What
to choose depends on your scene, and if you are seeing any artifacts in the image (jaggies,
speckles, etc). Don‟t choose a higher setting unless you really need it, and 256 or greater is
RARELY needed.
NOTE: Don‟t make the Min and Max settings the same, and do not make them greater than
4 settings away from one another.
Spatial Contrast
The Spatial Contrast setting is the color difference adjacent samples must exceed before
mental ray jumps to the higher SPP setting. Higher settings cause the Minimum value to be
chosen more often producing a grainer rendering, and a darker color will force the higher
SPP.
Often times you can get a better image with a reduction in the Spatial Contrast setting rather
than going to extremes in a Max value. 0.052 is the default for this number across the
board. A setting of 0.09 will speed up draft renderings considerably. A setting of 0.02 can
be used for high-quality renderings, and you can even go smaller. Use Render Presets to
keep these settings readily available.
Here are diagnostic mode renderings illustrating where mental ray puts its effort into a
sample scene:
Above is the same scene with Sample Rates of 1 and 16, a moderate setting. The overall
coverage is gray instead of black – every pixel gets sampled once, and areas that need more
Without Diagnostic mode, here is a side-by-side of a rendered portion comparing the 1-256
(left) and 1/64-1 (right) settings:
Figure 12: Image with rate Max = 256 and Max = 1, respectively.
The portion of the image on the left is completely smooth in the shadow and object edges,
and have no unusual bright or speckled areas as compared to the right. The right is missing
some object details, and is pixilated. You can compare these regions to the diagnostic
renderings, and see how the brightness of the diagnostic equated to smoothness of the
rendered image. The higher quality image took 10 times longer to render, too.
For animations this may require you to render a segment of your animation and look for
scintillation in the edges of objects as you play back at full-speed. This may not be
noticeable in your renderings until you play the sequence, so don‟t bet on the settings for an
animation until you are certain and do some tests.
I find that settings of 1 and 16 work pretty well for DVD video, although high-def may need 4-
64 or higher. For still-images it can be anywhere from 1/4 and 4 to 4 and 64, or even 256 in
rare cases. In addition to the ropiness and scintillation is the issue of fine details
disappearing, and sometimes the higher settings are needed to allow those details to be
visible.
Filters
Basically, avoid the default Box filter and stick with Mitchell for the high-quality renders.
For draft-mode renders, use the Box or, better yet, the Triangle filter.
Box filter: Sums all samples in the filter area with equal weight. This is the quickest
sampling method.
Gauss filter: Weights the samples using a Gauss (bell) curve centered on the pixel.
Triangle filter: Weights the samples using a pyramid centered on the pixel. Great for
Drafts.
Mitchell filter: Weights the samples using a curve (steeper than Gauss) centered on
the pixel. Best mode for most scenes.
Lanczos filter: Weights the samples using a curve (steeper than Gauss) centered on
the pixel, diminishing the effect of samples at the edge of the filter area. Slowest
Method.
Different filters can add significant time to your rendering, so generally stick with Triangle for
Drafts, and Mitchell or Lanczos (slowest) for most final-renders.
If you have anything you feel should have been covered here in the Essentials document,
please let me know.
Thanks!
Thanks you for reading this! If you have any questions on the content, any corrections you
found, or if something isn‟t clear, please let me know. This is a work-in-progress for both my
benefit and yours, and I appreciate the help.
Namaste,
Jennifer O‟Connor
Adjunct Professor of 3ds Max and Architectural Illustration at the College of Lake County,
Grayslake, IL [email protected]