Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page provides a guide on using the Maya Sampler Info node with additional V-Ray Attributes to control what items receive shadows.

 

Floatingpagetoc

Overview

...

Section
Column
width50%

In this tutorial, we discuss how to use the Maya Sampler Info node to control which items receive shadows and which don't. With the use of each object's ObjectID setting, a shadow-casting object can cast shadows on some other objects but not others. Accomplishing this will require some extra attributes from V-Ray to give the standard Maya node these additional abilities.

While for simple scenes it is possible to use a copy of the light (or lights) to illuminate different objects in different ways (by using shadow linking), for more complex scenes this method becomes unwieldy and overly complex. It is also prone to problems such as shadow Z-fighting unless one of the lights is moved slightly away from its copy. But using the samplerInfo node, with the V-Ray Additional outputs, it is possible to control which geometry casts shadows on other geometry within a scene. With this method, you control the casting and receiving of shadows via the VRaySwitchMtl material and Object IDs with a straightforward setup.

Column
width5%
Column
width45%

Image Removed

UI Text Box
typeinfo

The Sampler Info node is a Maya utility node that provides various scene information that can be used in shading networks at render time. V-Ray Extra Attributes can be applied to the node to increase the node's output options. For more information, see the Additional Outputs section of the Texture Attributes page.

Column
width5%
 
Column
width45%

Image Added

 

How it Works

...

Using the methodology in this tutorial, you can use Object IDs to determine which objects will receive shadows. 

...

3.  For any that you don't want to receive shadows from the main shadow-casting object, set the Object ID to 0.

 

  

UI Text Box
typenote

For objects that could potentially receive shadows from the shadow-casting object in the scene, assign an Object ID of 1 to geometry objects that you want to receive shadows, and an Object ID of 0 to geometry objects that you do not want to receive shadows. No special material is required for these objects. If you don't change the Object ID for an object, it will behave normally, receiving shadows if shadows are cast upon it.

 

Set up Shadow Material Override

...

Section
Column
width10%

 

Column
width40%


Eggs in grass have Object ID of 0, grass has Object ID of 1.
Topmost egg casts shadows on the grass but not on the other eggs. 

 

Column
width40%


Eggs in grass have Object ID of 1, grass has Object ID of 0.
Topmost egg casts shadows on other eggs but not on the grass.

 

Column
width10%

 

...