GTC 2014

iray was presented in the keynote again:

mental ray blog

the mental ray team now also has their own blog:

3dsMax 2015 announced

Here is a short video about the active shade improvements for iray, including interactive lighting, camera view and material changes, along with the newly exposed LPE functionality through render elements (and of course much more):


Custom noise removal

Iray tries to remove spike noise from images automatically. But in some difficult scenes, some fireflies are left over. Conversely, users may want more control over the contributions that get filtered out. LPEs can help achieve this. For example, let us disable the firefly filter and separate all really hard paths from the rest:

  • "hard: L <TS> <RS>* <TS> .* <RS> D E"
  • "^$hard"

fireflieseverything else

Now, we can either keep the second buffer, or we can blur, photoshop, or attenuate the noisy contributions to our liking and then add them back to the first buffer. Because we are free to use arbitrary LPEs here, we can really narrow things down, including caustics caused by a named object and similar tricks. (I could have done a better job at excluding some benign contributions from $hard, but you get the idea.)


Get a grip (3): more complex color changes

In the second post of this series, we changed the color of one object. Now, let’s change multiple objects in different ways. For this example, we’ll change the diffuse and glossy components of our chair object individually, and we’ll also change the wall at the same time.

As a first approximation, let’s use the following expressions:

  • "wall : E .* 'back wall' .* L"
  • "chair_d: E .* <RD'chair'> .* L"
  • "chair_g: E .* <RG'chair'> .* L"
  • "^($wall | $chair_d | $chair_g)"

This yields the following images:

walldiffuse component of chairglossy component of chaireverything else

We can now merrily tint and add them, to get a number of results instantly:

not so awesome color scheme

Of course, the multi-bounce saturation issue described in the previous post also applies here. But there is another effect that we did not consider. There are paths that match more than one of the LPEs above. For example, a path that hits first 'back wall' and then 'chair' will end up in all three of the named expressions.

A perfect solution to this requires a larger number of buffers that then get tinted with different combinations of weights. In many cases, this will not be worth the effort. Fortunately, there is an easy way to determine this. The affected paths are exactly those that match more than one of the named expressions in the list above: "($wall & $chair_d) | ($wall & $chair_g) | ($chair_d & $chair_g)". While the error is more visible than before, we will still get away with ignoring this without introducing visible artifacts. incorrectly tinted paths


Get a grip (2): instant color change

In an earlier post, we looked at simple relighting effects created by separating light transport paths based on the respective light source. In the first post of this new series, we saw how we can distinguish between normal objects using handles, and we saw some compositing workflow examples. Now, we will combine these concepts to change the color of objects in post, without re-rendering, so that almost all global illumination effects are updated accordingly.

For example, let’s say we have our room, and we want to be able to tweak the color of one wall. And, we want to do it without rendering a new image.modified materials

First of all, we have to make some preparations. We have to attach appropriate handle to the object we want to change. Also, we should make its material white, so that we can later multiply it with the desired color. Note that we only want to change the tints, but we want to keep the structure of layered materials as much as possible.

Next, we design LPEs that filter out all contributions of our object, both from direct and indirect illumination. In our example, we are looking for paths that interact with object 'back wall', and paths that don’t. Using LPE variables and the complement operator, new features of Iray 2014, we can design our expressions as

  • "wall: E .* 'back wall' .* L"
  • "^$wall"

Note that in our previous examples, we chose paths where the desired object was directly visible. Now, we allow the wall to show up anywhere in the path. For instance, the wall is seen reflected by the floor and the base of the chair in the left image.

the wallnot the wall

Paths that interact with the wall on the left, paths that don’t on the right.

Now we can change the color of our wall simply by tinting the entire image on the left and adding the result to the image on the right. The result will be very similar to what we would have achieved if we had set the object before rendering in many cases. But we can now make any number of differently colored results without re-rendering.

color optioncolor optioncolor option

Examples generated from the images above. Note how the changed wall color affects reflections and color bleeding.

If we only want to change the glosssy contribution of our object, for example, we can also do this by changing the first expression to "wall: E .* <.G'back wall'> .* L". One caveat to consider is that automatic normalization of material layering and mixing of course does not work in post.

And there is another imperfection. Light that interacts with our object multiple times only gets tinted once, even though it should really receive a tint that is more saturated. The tint should in fact be equal to the color raised to the power of the number of interactions with the object.

We can extract the paths that are affected by this insufficient tinting using the expression "E ([^'back wall']* 'back wall' [^'back wall']*){2,} L". If this is significant enough to be disturbing, we can render out separate buffers with one, two, three… interactions and tint them accordingly. incorrectly tinted contributions In our scene, the difference would be hard to spot.


Video Channel

Watch flashy iray videos on vimeo!

Compositing with Light Path Expressions



Beauty rendering of the packshot

Light Path Expressions (LPE for short) in Nvidia Iray lead to new and creative ways of compositing. In this document I will show you a few techniques that enable you to fully take advantage of this feature to get the most out of your final image. Light Path Expressions allow you to render any interaction of any light with any object into seperate images that can then be composited. For this post I will focus on fundamental examples for compositing in Photoshop. There is no wrong and no right approach. All of those techniques shown lead to the same end result. Depending on the requirements of your image you might prefer one approach over other, depending on which workflow fits your needs better.

Linear space: Turn off the tonemapper before rendering

Before you render your images, make sure that no tonemapping is applied since we want our rendering in linear space. However, turning off the tonemapping completely might result in extremely dark or extremely bright pictures that are more prone to showing fireflies. The trick is to leave the tonemapper on with its parameters set so that it outputs an image in linear space with an optimal brightness that allows the firefly filter to work optimally. 

First make the tonemapper linear by setting it to the following values:

  • Burn Highlights: 1.0 
  • Crush Blacks: 0.0 
  • White point: 1.0, 1.0, 1.0 
  • Vignetting: 0.0 
  • Saturation: 1.0 
  • Gamma: 1.0

Finally adjust the brightness value so that most parts of your image are visible. Note that some details of your image will look too dark, others too bright, but that’s okay. Once you have the overal brightness right, this indicates to the firefly filter the reference brighness of the image, so it can work effectively. Your rendering will have less fireflies. 

The rendering using tonemapper settings that make it linear. Once you open your .hdr or .exr file in Photoshop it will look correct.


The scene

The scene is a typical packshot known from commercials: The goal of a packshot is to present the product as appealing as possible.

Rendering multiple layers of the packshot has the advantage, that it gives more freedom when assembling the final image, allowing for faster and more creative tweaks that save time boost your creativity.

I will show you several ways of compositing. Some techniques stay in the realistic realms, others go beyond realism and allow you to add your artistic touch to the final image. The compositing is done in Photohshop, but the approach shown here will work in other applications that allow linear compositing as well. I will not teach how to write Light Path expressions, however, I will write down the light path expressions used to render out those buffers, so you get the idea how they work.

The packshot is made out of six elements, to make everything easy to follow:

  • Left light source, tagged 'light_left'
  • Right light source, tagged 'light_right'
  • Top Light source, tagged 'light_top'
  • Bottle, tagged 'tube'
  • Container, tagged 'container'
  • Floor, tagged 'floor'

Compositing per light

You can render out your scene per light source – this allows you to adjust all your intensities in a post process, weighing them together. The three light sources in the scene are labelled 'light_left', 'light_right', 'light_top'.

Left light source. LPE:

Top light source. LPE:

Right light source. LPE:

In Photoshop create a new 32 bit RGB image with the resolution of your rendering.

  • From the main menu, choose “Layer > New Fill Layer > Solid Color“.

A popup window appears.

  • Under name type “background”. The color can be left white. Mode is set to normal and Opacity to 100 %. Click OK
  • Next you are prompted to choose a solid color. Under the 32bit bit value, type 0 for all three components and click OK.

A black layer is created.

  • From the layers panel, drag and drop the layer called ‘background’ to the bin symbol to delete it since it is not needed.
  • From the file menu, choose “File > Place…” and open the first file.

The file is opened as a smart object (which allows for lossless processing with filters. See the Adobe help for further description).

  • Place the other required files as well.
  • In the layers panel, select each player that you placed and set the blending mode to “Linear Dodge (Add)”.  


Now all layers are set up correctly. When opacity of all layers is 100%, your image will look the same as your beauty rendering. You can relight you image by setting each layer to the desired opacity. To make a layer even brighter than it was before, you can add an ‘exposure’ adjustment layer. See “Adjusting a layer using an ‘exposure’ adjustment layer” at the end of this document.


You can also use Photo filters to change the tone of a layer. In the image below you can see the result after tinting the light from the right red, the light coming from the left blue and the intensity of the light shining from the top was increased using an exposure adjustment layer.

Image after tinting the left and the right lights and increasing the top light intensity using an exposure adjustment layer

Layers in the Photoshop document

Per Illumination component Approach

The next steps show you, how to composit the diffuse, glossy and specular components to get a full image.

wall Diffuse LPE: L.*<RD>Ewall Glossy LPE: L.*<RG>Ewall Specular LPE: L.*<RS>E

  • Create a new 32 bit RGB image with the resolution of your rendering.
  • Create a black solid background layer as the only layer of your image.
  • To place an image, use “File > Place…”, browse to the folder with your renderings and open the desired image.
  • Repeat the previous step to open the diffuse, glossy and specular components that you rendered.
  • Set the blending mode of all your layers to “add” and control how their weight using the opacity of each layer.



To increase the brightness of a layer, use an “exposure” adjustment layer that will control the exposure of the given layer. See “Adjusting a layer using an ‘exposure’ adjustment layer” at the end of this document.

Artistic compositing of an image

Compositing often seeks effects that do not look real. We want beauty that is beyond realism – that’s why Photoshop was invented ;) Next some techniques will be shown what else can be done when employing more exotic light path expressions.

Subtracting an object’s reflection from the beauty image

In the next example, reflections of the bottle and the container were rendered separately – which allows us, to subtract those contributions from the original image. Instead of using “Linear Dodge (Add)”, we subtract the reflections from the beauty image.

wall Bottle reflections LPE: L.*'tube'REwall Container reflections LPE: L.*'container'RE

  • Create a new 32 bit RGB image with the resolution of your rendering.
  • Create a black solid background layer as the only layer of your image.
  • Use “File > Place…” from the main menu to place the beauty render of your image as the first layer.
  • Next the reflections of the container are placed above the beauty rendering layer and its blend mode is set to “subtract”.
  • Next the reflections of the bottle are placed above the beauty rendering layer and its blend mode is set to “subtract” as well.

wall The beauty render LPE: L.*Ewall Beauty with reflections subtracted in Photoshop

wallThe Photoshop layers

You see, how the reflections have disappeared from the image. You can adjust the strength of the reflections by adjusting the opacity of the reflection layers.

Adding glow to the image

In the example we see that he bottle has very bright reflections, as it is directly reflecting the area light that shines on it. So one might feel tempted to tweak that as well. The bottle has specular reflections on it, this makes it easy to isolate them: The bottle is tagged with the handle ‘tube’, so the Light Path Expression to just get the specular reflections can be seen in the image below.

wall Bottle specular reflections LPE: L.*<RS'tube'>E

Use the techniques shown in “subtracting an object’s reflection from the beauty image” to adjust the brightness of the layer.

  • Place the specular reflections from the bottle above the beauty layer of your image using “File > Place…”.
  • Set the layer mode of the new layer to “Linear Dodge (Add)”
  • Apply a “Filter > Blur > Shape Blur” which allows for more fancy looking blur shapes. (Of course, Gaussian Blur will work as well)  


Adjusting a layer in Photoshop using an ‘exposure’ adjustment layer

If you want to make an image brighter than it was originally, this can’t be done using the opacity slider of the layer. Instead you create an exposure adjustment layer that controls the brightness of the layer underneath.

First method of creating an exposure adjustment for a layer

  • Select the layer that you want to control using an exposure adjustment layer
  • In the main menu, choose “Layer > New Adjustment Layer > Exposure”

A popup window appears.

  • Check “Use Previous Layer to Create Clipping Mask”. This has the effect that only the layer underneath the exposure layer will be controlled.


  • Click OK

Now you can control and tweak the intensity of the layer using the exposure slider.

Second method of creating an exposure adjustment for a layer

  • In the layers panel, click the create adjustment layer icon.

A new adjustment layer is created.

  • Then, hold down the ctrl key and click the bar between the adjustment layer and the layer underneath.


After that step, an arrow indicates, that only the layer underneath will be controlled. Select the exposure layer and user the sliders in the adjustments panel to control the intensity of the layer.


- Rüdiger

Hinge Digital Dreams up a Yummy Food Scape with Iray and Maya

Foodscape 4

Hinge Digital based out of Portland, Oregon wanted to put Iray to the test to see how it performed in their production workflows at their production studio.

They signed up for the early beta program of the 0x1 IrayforMaya plugin and started to work on a concept for a 30 second short animation flythrough. According to Hinge, “We already knew that Iray excels at creating photo-realistic hard-surface scenes, but creating believable food is a trial for any renderer. We decided to test the alpha release with a food-intensive scene, and asked Art Director Tyler Kenworthy to come up with concept art that would truly challenge the software”.

They came up with Foodscapes. Iray stood the test and shined especially with its LPE and MDL features. Check out their making of and behind the scenes of this project and learn how Iray fared with fitting into their production pipeline:

Foodscape 1

Foodscape 2

Foodscape 3

The final animation can be seen here:


Get a grip (1): separating objects using LPE handles

This is the first part of a series of slightly more advanced posts about Light Path Expressions. We will start out simple and work our way up to a more involved example.

It is often useful to render different objects into individual frame buffers.

For example, this makes it easier to replace objects or change their color in post production. So far, it was possible to achieve something similar by using the "object_id" buffer as a mask. However, this approach is not automatic, because users manually have to apply the mask to the rendered image to extract the desired information. More importantly, since every pixel only receives a single ID, object edges look jaggy unless rendering and compositing are done at a much higher resolution and then scaled down for the final result.

the complete image

Iray 2014 allows the use of handles (i.e. arbitrary names) everywhere in LPEs. This means that it is possible to tease out contributions from any given object on a per-sample basis so that the result of the separation is subpixel accurate and even works with motion blur or depth of field. The added advantage is that LPE handles are more readable than integer IDs.

As an example, the expression "E 'newton' .* L" extracts all light transport paths which immediately fall on the desired object.

Newton's cradlenot Newton's cradle

Images generated with this approach can simply be added together to yield complete results. There is no need for an alpha channel.


Cinema 4D Video Tutorials

The people at at2, who offer the iray and mental ray plugin for Cinema 4D, have created an extensive set of video tutorials ranging from the basics of rendering, modelling and lighting all the way though iray bsdf and mia material settings to finally physical sun & sky and the mia photographic camera tag. Check them out here:


Explorer Desk part III

3. Materials and Texture maps

Some materials were more tricky than others. For the books, I wanted to have a great leather-like material for the cover along with the golden lettering. Therefore I’ve created black and white masks allowing me to have different materials on the same object.



Overall experience

This project took me about three weeks since everything was modeled and textured from scratch. The whole thing was really fun to do. I definitely loved playing around with MDL and get such nice results in the end. I think it’s great to work on that detail level, to be able to get really close to the objects and still feel that something is going on.


Update: Watch the animation:

Alexia R.

Explorer Desk part II

2. Lighting

The lights had to be both realistic and have a warm and soft look. I ran some tests using HDRI maps.


Once I had found a map that matched the contrast and the luminosity I wanted for the image, I’ve added a bit of orange to it to have just the right lighting.


Alexia R.