Control your Shadows

artikel_shadow_exception_02

Recently I came across the following problem in C4D: an object in a building had to cast shadows everywhere except for one wall. The “special” wall would receive shadows from other objects, but shouldn’t show any trace of a shadow of my particular object.

This sounds more simple as it is to do in C4D. Read on for my solution.

The problem

In the example scene are a cube and a cylinder in a corner of a room. One spot light illuminates the corner, casting shadows of the objects onto the walls. For some reason I want to get rid of the shadow cast by the cube onto the right wall. Marked red in the image below. A simple task maybe. Put in a simple sentence: the green cube must not cast a shadow on the right wall.

artikel_shadow_exception_03

If you want to control lights and shadows you usually go to two destinations first in C4D. The scene tab in the settings of a light source or the settings of the compositing tag.

The Scene Tab

Lets look  at the first. In the scene tab I can exclude objects from the influence of the light. It has two modes. Exclude and Include. If you use Exclude, which is default then all objects in the scene are influenced by the light except for the objects in this field. If the light is in Include mode no object at all is influenced, except for the objects in this field. When you drag and drop an object here it looks like this.

artikel_shadow_exception_04

The 5 icons behind the object are specific attributes of a light source which can be de- or activated here. From left to right:

  1. object (just for recognition, doesn’t do anything)
  2. illumination
  3. specularity
  4. shadows
  5. hierarchy (if the children objects are affected by the settings here)

In the above picture every icon is active and therefore every aspect of the light source will be excluded for the chosen object AND all its children in the hierarchy. Since I want to get rid of the shadow of the cube I have to activate only the shadow icon.

artikel_shadow_exception_05

The resulting image:

artikel_shadow_exception_06

Great. I got rid of the cubes’ shadow. And only the cubes shadow! But wait! Every shadow of the cube is gone and not only the shadow on the right wall. That’s not what I am aiming for here, since I want to get rid of the shadow of the cube on the right wall only.

Here’s the limit of the scene tab settings. It allows only for global shadow manipulation.

The next way to handle the problem might be

The Compositing Tag

The shadow related settings in the Compositing tag are

  • Cast Shadows
  • Receive Shadows
  • Self Shadowing

These are again global settings. If I give the right wall a Compositing Tag and turn “Receive Shadows” off, the wall wont receive shadows from the cube. But no shadows from the cylinder and any other object in the scene as well.

This rendering shows how it looks when the wall doesn’t receive shadows:

artikel_shadow_exception_07

It seems that there is no simple button in Cinema 4D to cut the light/shadow-cast connection between 2 objects. Or put it again into a simple sentence: Its not possible to tell the green cube to not cast a shadow on the right wall. And leave everything else as it is.

So but what is the way to accomplish this seemingly easy task?

The solution

I had a discussion on this in a German c4d forum. One user suggested doing it in Postproduction. Rendering an Alpha channel for the right wall would provide a cut out template for the shadow of the cube which would be rendered separately as well. This is a way that should work. But there is a way to do it in Cinema 4D as well.

For this we have to work with two copies of the same light source.  The first light source works in Exclude Mode. The green cube and the right  will be dragged into the objects field. Deactivate the shadow icon. This light doesn’t illuminate the scene. It only cast shadows. This is how the rendering looks:

artikel_shadow_exception_08

It looks like there are no shadows on the right wall. But that’s not true. In fact the wall is full of shadow. Its the absence of light which makes the shadows invisible. So we need a second light for this. A light with the exact values of light 1. A copy.

The second light works in Include Mode. The green cube and the right wall are dragged into the objects field again. Only deactivate the Shadow Icon again. Because the light is in Include Mode now the settings have the opposite effect. This light only illuminates the objects and doesn’t cast any shadow. Here’s how it looks:

artikel_shadow_exception_09

And now both lights combined:

artikel_shadow_exception_10

It looks a bit like the image above where the Composite tag of the right wall prevents the wall from receiving any shadow. But look closer and you’ll see that the wall receives shadows from diffuse light sources in the scene. Only no shadows from our 2 central objects.

We’re almost there. The one thing which is missing is the shadow of the cylinder on the right wall. Drag the cylinder into the second light’s scene tab and deactivate any icon except for the shadow. This way only the shadow of the cylinder is added to the scene without any extra illumination on the cylinder. Voila, the result:

artikel_shadow_exception_11

And here are the settings in the 2 identical lights:

artikel_shadow_exception_12

Nice trick, isn’t it? :-)

(Apologies for any grammatical errors, I am not a native English speaker

Leave a Reply

Your email address will not be published. Required fields are marked *


*

Comment moderation is enabled. Your comment may take some time to appear.