In the world of CGI, ambient occlusion is a shading technique used to add depth to a rendering. Occlusion is not a real-world phenomena, but a simple shading technique used by some 3D applications as an alternative to ray tracing to create the illusion of shadows. In KeyShot, occlusion can be thought of as shading determined by nearby geometry, so an occluded surface is one that's near to another surface. KeyShot, being a physically-accurate ray trace renderer, doesn’t rely on occlusion to simulate shadows. In KeyShot, Occlusion is a texture that can be used to achieve different effects. First, let's look at an object with and without occlusion to get a quick comparison.
In KeyShot, occlusion is applied as a procedural texture, allowing you to determine the color of a surface based on how near it is to neighboring geometry. Unlike a shadow, occlusion acts independently of the light source and is non-directional. Now, let's take a deeper look.
How Occlusion Works in KeyShot
Imagine three identical boxes at various distances from a wall. The distance they are from the wall determines whether the box is occluded or unoccluded. In the example below, blue denotes occlusion. In KeyShot, the occlusion procedural texture allows you to define the distance at which geometry becomes occluded. In the example below, the distance was set to 1.5 cm. Because box A was exactly 1.5 cm from the wall, it remains unoccluded. Boxes B and C are both less than 1.5 cm from the wall, therefore some of their surfaces are occluded. In KeyShot, the distance at which geometry becomes occluded is controlled with a Radius slider, and the unit will always be the KeyShot scene unit.
At first glance, the result of using occlusion in KeyShot can look like shadows, but upon closer examination, it becomes clear that occlusion is just a way of shading geometry based upon nearby surfaces.
So, why use occlusion at all? Traditionally, an occlusion pass is often rendered to be used during the post processing or compositing phase of creating CGI. When an occlusion pass is layered on top of a rendered image, it can be used to accentuate occluded surfaces, and add contrast to the image.
KeyShot takes the concept of occlusion a step further by using it as a texture. This allows an immense amount of flexibility in the types of applications for occlusion. Let's look at some creative uses of the Occlusion Procedural Texture within KeyShot.
In the example below, occlusion is used to control where patina (metal discoloration) is visible on the tea pot. The vertical crevices are occluded, making them a different color than the raised surfaces. In this case, the Occlusion Texture is used as a mask.
The Occlusion Texture can also be used to create what’s called a contact shadow. A contact shadow helps to ground an object, but keeps it near the base of the object rather than bleeding to the edge of the image frame. A contact shadow is often desired when inserting photos with a white background into PowerPoint presentations. In the example below, an Occlusion Texture is used on the ground plane. The occluded color is set to black, and since the ground is occluded by the toy car, the result is something that looks like a contact shadow. The radius slider allows us to control the maximum distance the ‘shadow’ appears from the car.
KeyShot's Occlusion Procedural Texture lets you control the shading of surfaces based on nearby geometry. Whether you wish to create stylized contact ground shadows, gain further control over advanced materials in the material graph, or add more depth to your renderings in post, KeyShot's Occlusion Texture provides a great amount of flexibility to achieve the quality you desire.
To experience KeyShot's Occlusion Texture, download a free trial of KeyShot here. Once installed, download the Wooden Toy Car scene here to see how the Occlusion Texture was used on the ground plane to create a contact shadow.