DV220-3:
Creating life-like images has never been easier with 3ds Max Design, using the newly
integrated iray rendering technology from mental images. Learn how iray enables you to more quickly
set up the scene, press render, and get predictable, photo-real results without worrying about rendering
settings just like a point-and-shoot camera.
Table of Contents
The Autodesk Subscription Advantage Pack for Autodesk 3ds Max Design 2011 software
integrates the latest state-of-the-art technology from NVIDIA and mental images who are
working with Autodesk to revolutionize rendering and simulation workflows. This exclusive
Autodesk Subscription only release features one of the worlds first physically accurate pointand-shoot renderers, the iray rendering technology from mental images. Creating realistic
images has never been easier with 3ds Max Design, using iray eliminates the need to spend
countless hours tweaking sample settings and other tedious render settings. Unfortunately for a
few of you this means fewer coffee breaks, but at least theres no more need to do the magic
numbers dance upon each click of the render button. The workflow is now simplified to the point
where you feel like you are rendering with a digital camera. You can now spend your valuable
time focusing on shot composition and more creative aspects of creating the imagery rather
than tweaking render settings, clicking render, go get coffee, chat with your cubicle neighbor,
drink more coffee, oh crap got it wrong, tweak some more settings, click render, go get coffee,
chat with your co-worker, drink coffee again, oh crap.., repeat until time to go home.
However, this new dawn of GPU accelerated processing brings a whole new set of technical
knowhow and hardware understanding. As some might have already experienced results can
certainly vary from machine config to machine config. This makes it difficult to provide more
general best practices, but hopefully after this class you will have a better understanding of how
iray might apply to your visualization workflow.
An easy to use point-and-shoot renderer that requires very little prior rendering
experience
Photorealistic results with physically-based, real-world lighting
To work with physically-based materials, or are importing CAD data with Autodesk
Materials already applied
Immediate feedback on the progress of the rendering and who can leverage the
appropriate GPUs for this.
Want complete control over material, light, camera and render settings
Have a deep knowledge or rendering technology and can already setup a scene to
product realistic results
Dont require global illumination effects and prefer a more non-photo-real look
Leverage advanced compositing and render element workflows
Require motion blur and other post rending effects often used in rendering animation
sequences.
Require the flexibility of fully programmable and customizable shaders
Architectural visualization
Automotive styling and marketing visualization
Engineering and CAD (styling & design)
Product styling and marketing visualization.
4
Supported Materials
When first learning iray you will be tempted to simply load a scene previously setup to render
with mental ray scenes and hit the make pretty button. This may indeed work, provided the
scene doesnt use materials, lights, or features not supported by iray. However you may be able
to make some adjustments to your mental ray scenes in order to get less noise and faster
results in your iray renders.
In general, iray supports only materials, lights and maps or shader features that relate to
physically based light-ray tracing. The main materials it supports in Max are the Arch & Design
materials and the Autodesk materials. The main lighting modes it supports in Max are direct,
point, photometric, HDR environment map, and mr Physical Sky. For supported materials and
lights, certain settings and parameters which do not have a physical corollary or are not needed
for the iray lighting simulation may be ignored. For example, the Arch & Design material settings
that concern Ambient Occlusion, Round Corners, or Final Gather are simply ignored by iray.
Similarly, non-physical falloff settings are ignored for light sources.
iray supports only certain material, map, and shader types. In particular, it does not support
programmable shaders in the way the mental ray renderer does. If your scene contains an
unsupported material or map, iray renders it as gray, and reports an error in the Render
Message Window.
Supported Materials
iray supports mainly the general-purpose mental ray materials:
Material Type
Arch & Design
material
Restrictions
iray ignores the Main Material Parameters Reflection settings
Glossy Samples, Fast (Interpolate), and Highlights+FG Only. It
also ignores the Main Material Parameters Refraction settings
Glossy Samples and Fast (Interpolate).
It ignores settings on the Special Effects and Fast Glossy
Interpolation rollouts.
It ignores most of the settings on the Advanced Rendering Options
rollout. The exceptions are Refraction Max Distance and Color
At Max Distance; and Advanced Transparency Options
Glass/Translucency Treat Objects As and Back Face Culling.
For bump maps, it ignores the toggle Do Not Apply Bumps To The
Diffuse Shading.
It ignores shaders specified on the mental ray Connection rollout.
Autodesk
Materials
Exception:
Autodesk Metallic
Paint is not
supported.
NoteReflections on
Autodesk
Materials,
particularly
materials with a
matte finish, can
appear differently
than they appear
when rendered
with renderers
other than iray.
Ceramic
Concrete
Plastic/Vinyl
Stone
Multi/Sub-Object
material
Restrictions
On the Coordinates rollout for a Bitmap, the coordinate type must
be set to Texture. iray supports the Explicit Map Channel, Planar
From Object XYZ, and Planar From World XYZ mappings. The Map
Channel value must be in the range 1 to 4. iray ignores the UV
Mirror/Tile check box settings, and the Blur / Blur Offset settings.
On the Bitmap Parameters rollout, iray ignores the Filtering, Mono
Channel Outuput, RGB Channel Output, and Alpha Source settings.
Kelvin
Temperature Color
map
Mix map
Noise map
iray ignores settings on the Noise rollout for any other map type.
For the Output rollout of various map types, iray supports only these
settings: Output Amount, RGB Offset, RGB Level, and Bump
Amount.
iray does not support the Output map itself.
Supported Lights
The speed at which iray can converge on a quality image is largely impacted by the complexity
of the lighting. For example: Direct light + no glass = less noise. Although not as physically
accurate, avoiding these complexities will enable you to produce great looking images in even
less time.
Photometric Lights
Lighting support in iray includes photometric lights. This includes mr Sky Portal, mr Sun, and mr
Sky.
Iray will ignore all shadow settings for lights. Shadows generated by iray are always physically
based: Lights always cast shadows, and those shadows are ray traced.
For the mr lights, iray also ignores the Indirect Illumination settings. For mr Sun, it ignores the
Sun Photon settings and Aerial Perspective; the Sky Model must be Haze Driven.
Sky Portals are supported however you will likely notice the impact on performance and lighting
output to be much less than what you are used when using mental ray. In most situations iray
doesnt have a significant need for them. Sky Portals however can be used in conjunction with
the mib_blackblody shader as a primary light source. In cases where a small window is used to
illuminate an interior, with the light coming from an HDR environment map, you will find that the
current version of iray will converge much more quickly if the light source is implemented as a
mib_blackbody for the sky portal, rather than relying on the actual light coming from the
environment map through the window. However, iray will properly render the latter case, it will
just take more time to converge to a noise-free image.
Before you can use mib_blackbody you must first unhide the shader by editing both the base.mi
and base_max.mi files in your root installation folder.
The files are located in:
C:\Program Files\Autodesk\3ds Max 2011\mentalimages\shaders_standard\mentalray\include
In base_max.mi, find the text gui_mib_cie_d, and place a hash mark (#) in front of the hidden
declarations for that item and the next item also, the giu_mib_blackbody. The section should
look like this
gui gui_mib_cie_d {
control Global Global (
# hidden
10
)
}
gui gui_mib_blackbody {
control Global Global (
# hidden
)
}
In the base.mi file, find the text Light utils, and add a comma, a space, and the word texture
after the words apply light in two locations. It should now look like this:
.
# Light utils
declare shader
color mib_cie_d (
scalar
temperature,
scalar
intensity
)
version 1
apply light, texture
end declare
declare shader
color mib_blackbody (
scalar
temperature,
scalar
intensity
)
version 1
apply light, texture
end declare
Restart 3ds Max Design to accept the changes. In the material browser, select Show
Incompatible to see the mib_blackbody shader.
11
12
Render Settings
There are really only 4 main settings you need to adjust prior to achieving great results with iray.
13
Output Resolution
Besides setting the obvious image output
size and pixel aspect ratio you can also
further control the depth of field effect here
by increasing the Aperture Width(mm).
The default is 36mm when in the Custom
group of settings and is adjustable,
however is a fixed value in other
groupings. In NTSC and HDTV it fixed at
20.120, for instance.
Render Duration
The fundamental difference of the iray render settings is
the time-based approach. You can specify the length of
time to render, the number of iterations (samples per pixel)
to compute, or you can simply launch the rendering for an
indefinite amount of time, and stop it when you are satisfied
with the appearance of the result.
Animation Sequences
You can render animation sequences with iray, to do so you simply set iray to render the same
number of iterations per frame and the results will be predictive frame to frame. You can also
specify time spent rendering per frame if you need to get results within a fixed time period. For
example: if you have a 2 minute animation sequence to render overnight (12 hours), then you
can set iray to render 12 seconds per frame. If you use Backburner to distribute the frames
across several machines you can then increase the time per frame to get better results. One
limitation to rendering animation sequences is that iray does not render with motion blur at this
time.
MAXScript Options
14
The iray MAXScript settings are exposed on the renderer. The easiest way to access these is
through the global property
renderers.current
An easy way to review a list of all MAXScript properties and functions for a given object is to use
the show command:
show renderers.current
This will list all properties, including legacy MAXScript and newer functions published
properties, but will not list functions for either.
showinterfaces renderers.current
will fully describe newer functions published interfaces, including properties and functions. iray
is exposed entirely through the new functions published exposure. The full iray MAXScript
description.
15
Hardware Requirements
iray will automatically take advantage of all CUDA-capable GPUs within the system as it does
with CPUs. You can also utilize a mixture of all classes of NVIDIA GPUs GeForce, Quadro,
and Tesla. In many cases the same GPU powering 3ds Max Design can also be used to help
accelerate iray. Rendering results are very predictable, so iray can be used in highly
heterogeneous GPU & CPU environments.
16
17
3ds Max Design doesnt provide a user interface for controlling how iray
uses CPUs and/or GPUs. However, there are MaxScript commands that
can be used to control which processers are used. Just enter these
lines in the MaxScript Listener to control what processors iray uses:
mental_ray_string_options.addoption "iray devices" "0
1"
Controls what GPUs iray will use. The last string states which GPU is in
use with meaning none, 0 being the display device, 1 being just
the secondary GPU, 0 1 being both GPUs, and so on.
mental_ray_string_options.addoption "iray threads" 4
Controls how many CPU threads iray will use. The last string
determines the number, with 0 not using the CPU at all and 4 being
typical for a quad-core. To set iray to use all available CPU threads
enter:
mental_ray_string_options.addoption "iray threads"
sysinfo.cpucount
*Be careful note to set iray devices to and iray threads at the same time because there will
be nothing for iray to use when you render.
For example:
Use only the CPU:
mental_ray_string_options.addoption "iray threads" sysinfo.cpucount
mental_ray_string_options.addoption "iray devices" ""
Use only the GPU (when you have 2):
mental_ray_string_options.addoption "iray threads" 0
mental_ray_string_options.addoption "iray devices" "0 1"
Use both CPU and GPU (when you have 2):
mental_ray_string_options.addoption "iray threads" sysinfo.cpucount
mental_ray_string_options.addoption "iray devices" "0 1"
or you can just try the free iray Manager tool written by Artur Leo
18
http://dimensao3.com/al/
Graphics Drivers
iray does support the use of different generation and types of CUDA-capable GPUs. You can
mix Quadro, Telsa and GeForce boards in one system. Mixing memory sizes is also supported,
but not recommended. For drivers, you should load the one driving your Windows display. Many
problems with iray rendering can be solved by simply loading the latest certified driver from the
NVIDIA or manufacturer web site.
The following graphics driver performance settings are recommended to be set within the
NVIDIA Control Panel:
19
The recommended 3ds Max Design display driver is Direct3D, this is the most feature rich
graphics mode for 3ds Max Design. However, if you are reaching graphics memory limits when
rendering you can switch to OpenGL to avoid system conflicts between the 3ds Max Design
viewport and iray.
The NVIDIA Quadro products include a 3ds Max Performance Driver for additional performance
when using Direct3D. Using this driver should result in much smoother performance of the 3ds
max Design viewport. You can download the NVIDIA Quadro Performance Driver for 3ds Max
here:
http://www.nvidia.com/object/maxtreme_workstation.html
Tesla boards have minimal graphics API support and are not recommended
for driving graphics applications such as 3ds Max Design. Tesla products
based on the Fermi architecture have DVI ports, but this is solely to make it
easy to load the NVIDIA driver (earlier Tesla products had no video out).
NOTE: In preparing for this class I noticed a problem with 3ds Max Design failing to start when
a 4th GPU was added. It was later discovered that enabling the ECC setting in the graphics
driver was causing this failure. Currently only the latest Quadro and Tesla Fermi generation
boards support ECC, using it will decrease the performance of iray, so it is recommended that
ECC is always turned OFF when rendering with iray.
Memory usage
The entire scene must fit into GPU graphics memory in order for iray to take advantage of GPU
acceleration. If the scene does not fit unto into a GPUs memory, that GPU is ignored and all
processing takes place on the CPU and using system RAM resulting in much slower rendering
20
performance. If the scene exceeds the systems RAM limits, then iray will use virtual memory
and run more slowly yet.
If your scene does fit into GPU graphics memory 3ds Max Design will still use system memory
for processing the scene, and iray will also use it for utilizing the CPU. When iray is rendering,
the CPU and GPU will be consuming a similar amount of memory in graphics and system
memory (respectively).
For workstations where there are multiple NVIDIA cards installed the entire scene must fit
entirely into GPU memory on each GPU in order to use that GPU for processing. For example, if
you have three NVIDIA cards with 1GB of graphics memory each the maximum scene size is
1GB, and scenes over 1GB would be rendering exclusively on the CPU. If one of the NVIDIA
cards has more memory, say 3GB, then that single card will be used to accelerate iray
rendering along with the CPU.
For estimating memory usage, budget about 1 GB per 8 million triangles, to which you must
also add 3 bytes/pixel for any referenced bitmaps.
Motherboard requirements
SLI certified motherboards are not required to use multiple GPUs for iray rendering. iray will use
whatever GPUs it sees within the system, regardless of whether the motherboard is SLI certified
or the boards are placed in SLI mode.
It is also not very important to factor in Gen1 x8 PCI Express slots versus in a Gen2 x16 PCI
Express slot at this time. For operations that are constantly updated, like viewport interactive
graphics, Gen1 is much slower than Gen 2. For compute-intensive operations that keep the
GPU very busy before sending its results across the bus there is nearly no difference between
the two PCIX types. In the case of iray and GPU ray tracing, you might see a GPU render faster
on a Gen2 slot when the scene is very simple, but nearly no difference on a Gen1 slot when the
scene is reasonably complex.
21
Performance
Performance for iray should scale nearly linearly between the same type of GPUs as it is
across CPUs. Therefore the more GPUs and CPUs the faster your rendering results will be.
Many of the rendering algorithms iray uses are highly optimized for GPU computing. This will
vary between the GPUs and CPUs being compared, but between newly purchased, top-end
processors, a Tesla GPU is roughly +6X faster than a single quad core CPU for pure compute
purposes. Results can depend upon the algorithms used to compare, but given that a new GPU
is worth numerous quad-core CPUs, its far more cost effective to add an additional GPU rather
than a CPU for increasing iray rendering speed.
NVIDIA GPUs vary in their compute performance according to the number of CUDA cores they
have, the GPUs clock speed, and the GPUs architecture. The GPU card brand will not impact
iray performance beyond these characteristics. Put into formulae, GPU ray tracing performance
looks like this:
22
23
24
Network Rendering
RealityServer
RealityServer is a platform product for Web developers to create server-based applications that
employ 3D Web services that enable Web clients to interact with 3D data remotely.
RealityServer provides numerous rendering modes for processing server-side data, with its iray
mode being compatible with the iray renderer within 3ds Max Design. This commonality allows a
RealityServer application to accept 3ds Max Design scenes (prepared for iray, .mi files) and
deliver a result that is identical to what a 3ds Max Design session renders. While RealityServer
provides a unique and powerful option for processing 3ds Max Design content remotely, it is in
25
no way required for 3ds Max Design users to render with iray across their LAN using Autodesk
Backburner.
Backburner
Animation sequences or a series of individual image frames can be rendered across multiple
machines on your network using Autodesk Backburner. GPUs on the networked machines can
be used in the same way that CPUs are when called upon to render individual frames with iray.
Reference Materials
Teapot DOF image courtesy of Marco Dabrovic (marko@3lhd.com) and Jennifer O'Connor
(jenni@max3ds.com)
Using mib_blackbody/Kelvin Temp Color shader and the mr Sky Portal, Jennifer O'Connor
(jenni@max3ds.com)
http://www.mastering-mentalray.com/blog/?p=145
Iray Benchmark Scene, by Jeong-Ho Kim
http://forums.cgsociety.org/showthread.php?f=6&t=924164&page=1&pp=15
Optimize interior scenes for iray, Jeff Patton
http://jeffpatton.net/2010/10/27/optimize-interior-scenes-for-iray/
26
27