Matte Objects in iray

Today we’re introducing the latest iray feature to be released: matte objects. 

Overview

Let’s start with quickly going over what matte objects are all about. Say you have a photograph (which we’ll call the backplate):

image

… and you want to add some synthetic (computer-generated) objects to it. In our case, we want to add some lumber that’s been left behind on the pier. The obvious starting point is to model the lumber and drop it in the scene, where it seems to fit:

image

 … but that’s not right, the lumber is floating in space! And is the right part in front or behind that wooden post? This is where a renderer’s matte objects feature comes in. The goal of such a feature is to faithfully combine synthetic objects with the backplate, to make it appear as if the whole scene is part of a single photograph. So let’s walk through the setup required to achieve this with iray…

The first step is to create matte objects, stand-ins which are modeled and positioned to match, as closely as possible, a select set of elements from the backplate. Whichever objects you think might interact significantly with synthetic objects need to be modeled in this way. In our simple test case, we chose to model the pier and wooden posts around our lumber:

image

Note how the matte objects were assigned materials which matched the backplate as closely as possible. We’ll get back to that later. The next step is enabling the matte feature in iray and flagging each of the matte objects. Then hit render and:

image

Like magic, the result is a perfect* composite of the synthetic object in the matte scene.

*disclaimer: this is developer art!

Some Details

The classical approach to supporting matte objects involves “matte/shadow materials”. Such materials use a myriad of tricks to add specific, but limited, effects to the backplate: shadows, ambient occlusion, some reflections and illumination. iray’s implementation parts with the classical methodology, instead allowing any regular material on matte objects. The only requirement is that they match the backplate as closely as possible. iray will then render the scene normally and appropriately integrate interactions between matte and synthetic objects. The light path and material evaluation logic are unchanged, enabling the full set of lighting effects to be present, either direct or indirect: reflection, refraction, diffuse, glossy, specular, area lights, IBL, etc.!

Let’s elaborate on our sample scene:

image

We added an additional matte object for the gravel part of the ground, and two new synthetic objects: a big and a small SUV (with ridiculously powerful headlights). The goal is to demonstrate the interaction of synthetic light sources with matte objects. Any light generated by a synthetic objects, whether directly by a light source or indirectly by bouncing on a synthetic object, will light the matte object normally and be added to the backplate. 

Let’s further tweak our scene to demonstrate how indirect lighting interacts with matte objects. We use a few reflective planes to illustrate interesting effects. The observations we’ll make are perfectly valid for all types of indirect illuminations, as there are no significant differences between glossy, specular, and diffuse reflections for iray.

image

We see that reflections of matte objects are consistent with what is directly visible to the cameras. The back side of matte objects are approximated by using the front-side projection, typically yielding very acceptable results, especially if one is mostly interested in diffuse indirect illumination.

Summary

Let’s wrap this up by outlining some the advantages of iray’s matte object implementation:

  • Very simple to set up
  • Arbitrary materials on matte objects (even transparent/refractive!)
  • Light sources can be matte objects, too
  • Full light path simulation, no cut corners

We’ll have more for you very soon, stay tuned!

PS: The SUV model is a courtesy of Autodesk, thanks!

—-

daniel l