Square Enix © Goodbye Kansas

Table of Contents

This tutorial walks you through the steps of creating a shadow/matte catcher.

 

Overview


V-Ray shadow catcher is a Matte object, which is not directly visible in the scene, but shows the received shadows. This approach is ideal for achieving a photorealistic render, compositing a 3d object with a shadow on top of the environment map or just a backdrop.

For the purpose of this tutorial, we use a motorcycle geometry from our Chaos Cosmos 3D content library. The scene lighting is achieved with a VRayDome light and an HDRI from Poly Haven used as an environment override.

 

Without shadow

With shadow

 

 

Tutorial steps


In this tutorial, we turn a plane into a shadow catcher/matte object. There are two ways to do that:

  • by using the V-Ray Shadow Catcher node
  • by using the VRayMtlWrapper material

Open the scene you will use for this tutorial and let's delve into each method.

 

Using V-Ray Shadow Catcher


Select the object, which will become a shadow catcher. In our case we select a plane.

Click the Shadow Catcher button on the V-Ray toolbar while the object is still selected. Alternatively, right-click on the same button to open more options for assigning properties to an object, and select Apply single shadow catcher to selection.

The assigned Shadow Catcher creates a VrayObjectProperties node with already set settings for a matte object. It is recommended to leave the properties at their defaults, as they are automatically set for optimal results.

 

 

 

 

 

The Matte Surface, Shadows and Affect Alpha options are enabled and the Alpha Contribution is set to -1. This turns the plane into a Matte object. This means that it is not directly visible in the scene; instead, the background color is shown in its place. The background color here corresponds to the Override Environment parameter that can be accessed from Render Settings > Overrides tab > Environment rollout. Please note that this effect works only on objects that have these V-Ray Object Properties set.

  • For increased realism, set the Matte For Secondary Rays option to With Projection Mapping. This enables the matte object to project the environment back onto other objects in the scene.

 

 

Optionally, the reflections that the motorcycle geometry receives can be overridden with another texture. To achieve this, enable Override Secondary Matte Environment option from the Render Settings > Overrides tab > Environment rollout > Override Secondary Matte Environment where a different HDRI can be used as a Secondary Matte texture for the reflections.

 

 

 

 

Here's how the reflections and refractions are changed by the Override Secondary Matte Environment. Please, note that the final result is strongly exaggerated to better illustrate the effect of the options. The use of a secondary matte texture is not mandatory and can be omitted. 

 

off
on

 

Using V-Ray Object Properties


Alternatively, you can use the   V-Ray Object Properties node directly and adjust it manually. 

For instructions on how to create a V-Ray Object Properties node, please visit the V-Ray Object Properties page.

 

After assigning the node to the selected plane, go to the Attributes Editor and under the vrayobjectproperties tab set the following settings:

  • Enable Matte Surface

  • Enable Shadows –  this option allows the object to receive shadows

  • Enable Affect Alpha – this option determines whether the received shadows affect the alpha. The Alpha Contribution specifies whether to add to the alpha, when set to 1.0. When the option is set to -1.0,  it takes away from the alpha. When set to 0.0, it leaves the alpha unchanged.

  • Set the Alpha Contribution to -1.0. This allows the received shadows to take away from the alpha information for later compositing.

This turns the plane into a Matte object. This means that it is not directly visible in the scene; instead the background color is shown in its place. Note that the background here corresponds to the Override Environment parameter that can be accessed from Render Settings > Overrides tab > Environment rollout. This effect works with every geometry that has the VrayObjectProperties applied to it.

  • For increased realism, set the Matte For Secondary Rays option to With Projection Mapping. This enables the matte object to project the environment back onto other objects in the scene.

 

 

 

 

Using VRayMtlWrapper Material


Another way to achieve this effect is through the use of VRayMtlWrapper.

Select the plane, open the Hypershade and create a VRayMtlWrapper using the Create panel.

 

 

 

 

Assign the VRayMtlWrapper to the plane by right clicking and holding on the VRayMtlWrapper Shader ball icon (alternatively, on the VRayMtlWrapper node) and choosing Assign Material to Selection.


 

 

 

Enable the same options for the VRayMtlWrapper as the ones mentioned in the V-Ray Object Properties:

  • Matte Surface

  • Shadows –  this option allows the object to receive shadows

  • Affect Alpha – this option determines whether the received shadows affect the alpha. The Alpha Contribution specifies whether to add to the alpha, when set to 1.0. When the option is set to -1.0,  it takes away from the alpha. When set to 0.0, it leaves the alpha unchanged.

  • Set the Alpha Contribution to -1.0. This allows the received shadows to take away from the alpha information for later compositing.

This turns the plane into a Matte object. This means that it is not directly visible in the scene; instead the background color is shown in its place. Note that the background here corresponds to the Override Environment parameter that can be accessed from Render Settings > Overrides tab > Environment rollout. This effect works with every geometry that has the VrayMtlWrapper applied to it.

  • For increased realism, set the Matte For Secondary Rays option to With Projection Mapping. This enables the matte object to project the environment back onto other objects in the scene.

 

Optionally, the reflections that the motorcycle geometry receives can be overridden with another texture. To achieve this, enable the Override Secondary Matte Environment option from Render Settings > Overrides tab > Environment rollout > Override Secondary Matte Environment. A different HDRI can be used as the Secondary Matte texture.

 

 

 

 

Here's how the reflections and refractions are changed by the Override Secondary Matte Environment. Please, note that the final result is strongly exaggerated to better illustrate the effect of the options. The use of a secondary matte texture is not mandatory and can be omitted. 

 

off
on