mip_matteshadow
 
 
 

Category: mental ray > Materials

Shader Family: Surface Material

Output: Color

Related Softimage shader: Matte Shadow (mip)

Often you want to include synthetic objects into an existing photographic background plate filled with real world objects. For example, adding a yet-to-be-constructed building into an empty lot, adding a virtual car onto a road, or having a virtual character walk through a scene and realistically interact with objects in the real world scene. In general, the term "synthetic" refers to additional objects to be inserted in the scene, and "real world" refers to objects that are already there.

Two main shaders exist to facilitate this work: the Camera Map (mip_cameramap) shader which "projects" an image from the camera onto geometry, and the Matte Shadow (mip_Matte_Shadow) shader which takes care of generating hold-out mattes, as well as allowing the real world objects in the photographic plate to both cast and receive shadows, as well as receive reflections and indirect light.

The Matte Shadow shader is used to create "matte objects" (objects that are used to represent existing real world objects in a photographic plate) for the following purposes:

In all the above mentioned cases, the Matte Shadow shader is applied to an object representing the real world object, and the synthetic object uses a traditional material.

This shader can also function as a "shadows only" shader which only shows how much in shadow a point is compared to the incoming light, but ignoring the actual amount of incoming light itself (only the occluded percentage of it).

Name

The name of the shader node displayed in the render tree. Enter any name you like, or leave the default.

background

The background color. If neither of the catch_xxx options are on, this result is simply returned, including its alpha, and the shader does nothing. Otherwise it is the base color upon which all the other operations occur. When using external compositing this is generally transparent black (0 0 0 0), otherwise you would use the real world background plate mapped with the mip_cameramap shader.

catch_shadows

When enabled, allows other objects to cast shadows on this object.

shadows

The color of the shadows. When shadows are detected, a blend between background and shadows is performed depending on how much "in shadow" the point is.

ambient

Sets a "base light level" by raising the lowest "in shadow" level. For example, if this is 0.2, 0.2, 0.2 the darkest shadow produced will be a 20 percent blend of background to a 80 percent blend of shadow (unless ambient occlusion is enabled).

no_self_shadows

When enabled, causes objects using the Matte Shadow shader not to receive shadows from any other such object.

use_dot_nl

Specifies whether or not the angle to the light is considered when calculating the incoming amount of light.

colored_shadows

If the Shadow Coloring Factor is 0.0, all shadows are cast in grayscale. If it is set to 1.0, the shadows have full color. For example, if the surface is lit by one red and one green light, the red light will have a green shadow, and the green light will have a red shadow.

ao_on

When enabled, a built-in ambient occlusion is applied. The ambient occlusion respects the No Self-Shadowing option and will not cause ambient occlusion from objects with the same material as itself.

ao_dark

Specifies how dark the AO shadows will be. The default black is generally adequate, but a lighter color will cause a less pronounced shading effect.

ao_samples

The number of ambient occlusion rays that are shot into the scene.

ao_distance

Sets an upper limit on the distance ambient occlusion rays can travel. If the value is set to zero, the rays reach infinitely far (no limit). Short rays increase performance dramatically, but localize the ambient occlusion effect.

catch_reflections

Enables reflections.

refl_color

A multiplier for reflections. Note that the alpha value of this color is important in that the reflections will influence the alpha by this amount. In some cases the reflections may need to be subtractive, in which case refl_subtractive is used.

refl_subtractive

Subtractive reflection color.

refl_samples

Sets the number of glossy reflection samples. If it is set to zero, mirror reflections are used.

refl_glossiness

Sets a Ward glossiness for reflections.

refl_max_dist

Limits the reach of glossy reflection rays.

If the maximum distance is set to 0.0, the reach of the glossy reflection rays is infinite. For values greater than 0.0, the reach of the glossy reflection rays is limited to this distance, and the color of the reflection is faded toward the environment color as the length of the ray approaches this distance.

Use Maximum Distance to improve performance and reduce excessive noise caused by high-contrast objects in the distance.

refl_falloff

The rate for fading into the environment. The default of 2.0 means that the falloff is by distance squared. A value of 3.0 means distance cubed, and so on. This parameter has no effect if Maximum Distance is 0.0.

catch_indirect

When on, indirect light is gathered and scaled by the indirect color (which one generally sets to the same as the background color, thereby treating the background color as a reflectance value for the indirect light).

indirect

The indirect light color.

multiple_outputs

When on, the shader writes to the multiple output ports. When off, the shader only writes to the main "result" output port.

catch_illuminators

Enables the use of illuminators to light the scene.

Illuminators

Creates an illuminators list to specifiy which lights should produce the effect.

Note that the difference between lights and illuminators is that the lights are only used to cause shadows on the background, whereas the illuminators are used to throw actual light on it. This means that the lights list should contain lights that are already present in the background plate, and the illuminators list contains any additional lights introduced by a CG element, such as the headlights of a CG car.

Add

Adds a light Item to the list.

Clear

Removes all light Items from the list.

Item

An Item port (parameter) representing a single light in the list.

Pick

Allows you to choose a light in your scene that will be used to compute the effect.

  1. Click the Pick button.

  2. In the pop-up explorer, select the light you want to use.

  3. Right-click outside the explorer to end the picking session.

  4. The Item text box displays the name of the selected light.

 

Click the Edit Item icon to Remove, Rename, Move Up, and Move Down each Item entry in the list.

Once an Item is removed from the list, it no longer influences the effect created by the shader. In most cases, the position of an Item in the list indicates its order of evalution. Changing the evaluation order (moving Items up and down in the list) can impact the final output results of the shader.

additional_color

A color input simply added to the result.

mode

The mode selector for the light list. For more information, see Setting the Light List Mode [Direct Illumination].

Lights

Creates a light list to specifiy which lights should produce the effect. For more information, see Using Light Lists [Direct Illumination].

Render Tree Usage

The mip_matteshadow shader has multiple outputs. All outputs are as "raw" as possible to be maximally useful as layers in post production. For example, to ensure that the reflections have not been multiplied with the reflection color, and so on.

When multiple_outputs is enabled, the shader outputs the following values:

result

The combined result.

shadows_raw

The raw full-color shadow pass on white background, suitable for compositing on top of a background in "multiply" mode.

ao_raw

The raw ambient occlusion.

refl_raw

The raw reflections.

indirect_raw

The incoming indirect light.

illumination_raw

Light gathered from any lights in the illuminators list.