The Matte/Shadow/Reflection material, part of the Production Shaders library, is used to create “matte objects”; that is, objects that represent real-world objects in a photograph used as the scene background (also known as the plate). The material provides a wealth of options for combining a photographic background with the 3D scene, including support for bump maps, ambient occlusion, and indirect illumination.
Applications include:
In all these cases the material is applied to a matte object that represents an object in the background plate, and the 3D object uses a traditional material.
For additional information, see Help menu Additional Help mr Production Shader Library Matte/Shadow Objects and CameraMaps, as well as the Tech Note (following).
The Matte/Shadow/Reflection shader works by doing a form of differential shading. In other words, it determines the amount of light a point would receive if it were not in shadow, compares it to the amount of light the point actually receives, and shades it by the relative difference.
This means that any point that is fully lit, unshadowed by any object, returns the same color it already had, completely disregarding the actual intensity of that light. If half of the incoming light is blocked, the point will be shaded at 50 percent intensity, regardless of the full-intensity amount in an absolute sense.
An important feature of the Matte/Shadow/Reflection material is that it is non-self-shadowing, non-self-occluding, non-self- reflecting, and does not cast indirect light onto itself. Because it is designed to act as a stand-in for objects present in a photographic plate, which already contains self-shadowing, self-reflection, and so on, the material automatically excludes these effects. However, it is still able to cast shadows on other objects, receive shadows from other objects, reflect other objects, and so on, without creating unwanted double shadows or double reflections for such effects already present in the plate.
This multi-part procedure provides step-by-step instructions for a simple case of combining a 3D object with a photograph using the Matte/Shadow/Reflection material, the Environment/Background Camera Map shader, and the Environment Probe/Chrome Ball shader.
Prerequisites:
Ideally, these should be HDR photos, but non-HDR images can also work well.
Set up the viewport:
Choose an environment:
Set up the background and environment reflections:
From the pop-up menu, choose mental ray Environment/Background Camera Map.
If the two photos have different exposures, use the Multiplier setting for either or both maps to match them.
Next, you’ll make a rudimentary model that represents objects already present in the background. At the very least you need a simple plane for the "ground" to place things on.
Set up the matte object and a shadow-casting object:
Add a Skylight:
This retrieves the appropriate ambient color from the chrome ball photo.
Next, you’ll set up the Matte/Shadow/Reflection material.
Set up the Matte/Shadow/Reflection material:
This places the same background map that is used in the environment switcher into the background map in the material as an instance.
In the Slate Material Editor, you can see the same map wired to both components.
This completes the basic setup. If you render now, you should see the teapot superimposed over the background image. The teapot should have a soft shadow underneath, which comes from ambient occlusion.
Now you’ll tune the lighting in the scene. Generally you need at least one key light to cast a directional shadow.
The scene is now set up, although further tuning might be necessary.
So far the rendered 3D content has been added on top of the background directly in the renderer. Generally, you want to do this in an external compositing program, as follows:
In this case, you use the button with its Cut option so you can paste the map in a different location.
The scene now contains two Switcher nodes: One used in the environment (switching between transparent black and the chrome ball) and one in the material (switching between transparent black and the camera map).
If you render now, the resulting image still properly contains all the reflections, light, and so on, from the background, but not the background itself. Shadows exist in the alpha channel, so the image is suitable for compositing directly on top of the background image.
The foregoing procedure does not cover gamma.
If you use a gamma-correct workflow, which yields a superior result, with literal mental ray textures (that is, you use the big Browse button to refer directly to a bitmap file, rather than inserting a Bitmap map), you must set the gamma of this bitmap explicitly in the appropriate Reverse Gamma Correction parameters.
Sets the color or map for the matte material. To use the scene background, click the map button, browse from the scene, and choose the Environment map. This button is a shortcut: You can also assign a Background map on the Maps rollout.
The opacity of the material. Default=1.0.
Click the map button to assign an Opacity map. This button is a shortcut: You can also assign an Opacity map on the Maps rollout.
Click the button to assign a Bump map. This button is a shortcut: You can also assign a Bump map on the Maps rollout.
The multiplier for the bump map. Default=0.3.
When on, the surface can receive shadows. Default=on.
If Shadow Casting Lights List is off, all lights cast shadows on the surface.
The amount of environmental light in the scene, which in a practical sense is how dark the shadows are. Default=0.2.
If the mental ray Image Based Lighting (IBL) feature is active, the Matte/Shadow/Reflection material also uses Skylights to generate shadows. In this case, it is not necessary to use the Ambient / Shadow Intensity setting; instead, just set the value to 0.0. However, when not using IBL, the material cannot use light from Skylights, and any such shadowing must come from the ambient occlusion feature.
So when the shader is used together with a Skylight and IBL is off, the Ambient / Shadow Intensity value should be similar to the level of light the Skylight provides.
The units value for this setting depends on the lighting unit. If you use the mr Photographic Exposure Control, and set Physical Scale to Physical Units (cd/m 2 ), this value will be in physical values, and might need to be in the hundreds (or thousands for an outdoor shot lit by mental ray Sun & Sky). However, if you don’t use the exposure control, or set it Physical Scale to Unitless, this parameter is in a "traditional" unit space where 0 is black and 1 is white.
Setting a color or map here tints the shadows. For accurate shadow tint, use a neutral color.
Click the map button to assign an Ambient Color map. This button is a shortcut: You can also assign an Ambient Color map on the Maps rollout.
When on, you can use the Add/Replace/Delete buttons to edit the list, specifying lights that are to cast shadows on the surface. For the lights list to be in effect, Receive Shadows must also be on.
When off, and Receive Shadows is on, all lights in the scene cast shadows on the surface.
When on, ambient occlusion affects the surface. Default-on.
The number of ambient-occlusion rays that are shot. Default=8.
The reach of ambient-occlusion rays. At 0.0, the ray distance is not limited. Using short rays increases performance but localizes the ambient-occlusion effect. Default=50.0.
The darkness of shadows the ambient occlusion causes. The default value is black, but you can cause a less-pronounced shading effect by using a lighter color.
When on, the surface reflects its surroundings. Default=off.
Reflections are tinted this color. For accurate reflections, use a neutral color.
Click the map button to assign a Reflection map. This button is a shortcut: You can also assign a Reflection map on the Maps rollout.
The subtractive color for reflections. This amount is removed from the plate before reflections are added. If black, nothing is removed, and reflections are added purely additively on top of the plate. If 50% gray, the plate pixels are attenuated to 50% of their intensity, and the reflections are added on top of that, and so on.
Use this setting if the plate contains an area with many reflections that need to be removed before the new, synthetic reflection is added.
The glossiness of reflections. Default=1.0.
Click the map button to assign a Glossiness map. This button is a shortcut: You can also assign a Glossiness map on the Maps rollout.
The number of glossy-reflection samples. Default=8.
At values other than the default of 0.0, limits the distance from which reflections are cast.
The falloff curve for reflections at Max Distance. Lower values cause more rapid falloff.Default=2.0.
When on, indirect light (final gather and global illumination) is gathered and scaled by the Indirect Illumination Multiplier value (see following). Default=on.
The multiplier for gathered indirect light. Default=1.0.
When on, the surface renders where struck by direct illumination. Default=off.
If Illuminating Lights List is off, all lights in the scene illuminate the surface.
When on, you can use the Add/Replace/Delete buttons to edit the list, specifying lights that are to illuminate the surface. For the lights list to be in effect, Receive Direct Illumination must also be on.
This rollout lets you assign a map or shader to many of the Matte/Shadow/Reflection parameters. You can also assign maps and shaders on the rollout where the parameter first appears: The principal value of this rollout is that it also lets you toggle a parameter's shader, using the checkbox, without removing the map.
The button to the right of each main shader button is for shaders that can return multiple parameters. If a shader that returns multiple parameters is assigned to the component, the button's tooltip shows the parameter name.