Where there’s light there’s shadow. This may be true for light in the real world but in Cinema 4D we can separate light from shadow. For a light to cast a shadow a Shadow type must be selected in the Shadow menu in the light’s General tab. There are three types of shadow from which to choose: Shadow Maps (Soft), Raytraced (Hard) and Area.
The Shadow Maps (Soft) are simple bitmaps that are projected from the angle of view of the light source. This bears the advantage that the detail density and edge sharpness of these bitmaps can be adjusted using the pixel resolution settings. The shadow’s resolution, density and color is defined using the settings in the light’s Shadow tab. The advantages of using shadow maps is the degree of control you have with regard to the shadow’s resolution and the faster render times. A disadvantage can be their memory requirements when using large shadow maps. Furthermore, it may also be necessary to adjust a shadow map’s Bias (Abs) value in the Shadow tab. This setting defines which of an object’s asperities should cast shadows. If this value is too low, even the edges of surfaces will cast shadows onto the surrounding polygons, which will result to an unwanted darkening. This effect is demonstrated in the image below: The sphere on the left is illuminated by a light source whose AB is too low. This results in the surface structure of the polygons being greatly exaggerated. The sphere to the right is the same sphere with a higher Absolute Bias value applied.
This does not however mean that a large bias value will always improve the shadow quality. The image below shows what can happen if the Absolute Bias value is set too high. On the left is a soft shadow with an optimized Absolute Bias value. The same sphere is at the right with a very high Absolute Bias value (strongly exaggerated to better demonstrate the effect).
As already mentioned, one of the disadvantages of larger Shadow Maps, i.e., high-resolution shadow bitmaps, is their memory requirement. This can be curtailed somewhat by calculating the shadow only in a specific region, called a Shadow Cone. The Shadow Cone is calculated around a light’s Z axis. The Angle value defines the cone’s angle of aperture, very similar to that of a Spot light. The advantage this bears can in particular be seen when using Omni lights, for which usually six shadow maps are calculated in order to cast shadows in all directions around the light.
Generally speaking, shadows only take up a small part of any given scene. Hence we can roughly orient the light source’s Z axis toward the object to be illuminated and enable the Shadow Cone parameter in the light’s Shadow tab. An Omni light will, for example, only have to calculate a single shadow along its Z axis. The memory and render time saved can then, for example, be used to increase the Shadow Map resolution. This is of course not necessary when using Spot light sources, for which shadows are only calculated within the light’s cone by default.
A different behavior can be seen when using Parallel or Infinite light sources. For these, the Parallel Width setting must be used to restrict soft shadows. This value represents the lateral distance from the light outward for which a shadow should still be calculated. Whether or not this value should be adjusted so all objects will cast a shadow depends on the size of the respective scene. This is demonstrated in the image below:
In the image above an Infinite light is used to illuminate three spheres. The light’s Parallel Width value is too low, which prevents both outer spheres from being included entirely and causing the shadows they cast to be cut off abruptly.
Correctly aiming a light is not only important for Spot lights but can be just as critical for Omni lights when using the above-described Shadow Cone. As can be done with other objects, lights can be rotated, scaled and moved. Switch to Gouraud Shading mode in the Viewport to get a rough impression of the changing lighting effects. An even more precise method of viewing changing lighting effects is to temporarily switch the camera view to that of the light itself. This will let you look in the direction (along the Z axis) in which the light emits, allowing for a precise placement of lights. To view the scene from the angle of view of the light, select the light object in the Object Manager and select
For scenes in which illuminated objects are animated, lights can be made to follow these objects automatically. This is what the Target tag, located in the Object Manager’s
The Shadow type Raytraced (Hard) is calculated entirely differently than soft shadows. They are however the shadow type that is easiest to use. The only parameters you will have to pay attention to are Color, Density and in certain circumstances Transparency.
As the name suggests, this shadow type’s edges are always razor sharp and hard, i.e., no soft transition takes place. Such hard shadows only occur in extreme real-world lighting conditions (e.g., scenes in outer space where no light dispersion on objects lying in close proximity takes place).
If you observer how shadows are cast in the real world you will notice that the hardness of a shadow’s edge is directly related to the distance between the shadow casting and shadow receiving objects. This means that the shadow directly beneath or next to an object will appear harder and will quickly become softer the farther the two objects lie apart. This is because real-world light sources have a spatial spread, which causes light to hit the object from several different angles. This effect can be simulated by selecting the Area option in the Shadow tab (regardless if Area or Omni light). The Details tab contains settings for defining the shape and size of the given light as well as for fine-tuning the Area Shadow. The series of images below demonstrates how a shadow’s hard edge softens as the light source increases in scale. A light source that is small in relation to the scene itself will cast a hard shadow. The larger the light source is in relation to the scene, the softer the shadows will be.
The larger the light source is scaled (or the closer light source and object lie) the more diffused the shadow will be in the distance. If you look closer you will be able to make out a slight noise pattern in the shadow. This is a result of the limited number of samples (calculation steps) used to calculate the Area Shadow. In the image below, the shadow in the example at the top contains noise; in the example at bottom, the Area Shadow’s settings have been optimized to remove the noise.
The parameters used to adjust the sampling are located in the light’s Shadow tab. Cinema 4D automatically determines a sample count based on the defined Minimum Samples and Maximum Samples values in conjunction with the Accuracy value.
As a general rule, it’s a good idea to set both samples values to the same value and increase this common value until you achieve the noise-free result you want. Subsequently the Minimum Samples value can be reduced to 1/3 of the Maximum Samples value in order to save render time. The Accuracy value serves as a multiplier whose value can also be reduced tentatively, which will also reduce render times.