Skip to content. Skip to navigation

Illuminate Labs

Sections

Using Reflective Occlusion

Environment maps is a fast way to simulate reflection on curved surface without the use of raytrace. But the model doesn't take self occlusion or blocked objects into account. The parts that are self occluded or blocked by other objects can't reflect the environment map. This problem can be solved with a combination of environment maps and reflection occlusion.

Reflective Occlusion AnimationThe reflection occlusion is calculated by shooting a number of rays in the reflection direction. If the rays hits a object the result will be a black pixel, if the ray doesn't hit an object the pixel will be white. The occlusion pass will be multiplied with the reflection pass in a compositing software.

Environment maps in combination with reflection occlusion creates a model that will generate realistic reflections in a efficient way. The model is independent of the changes of the shader in the scene, it is only necessary to recalculate the occlusion if the geometry or animation is updated.

Ambient Occlusion + Environment Maps

The environment map has been added to an ambient occlusion pass. Have a look at the Shake script for this frame.

Ambient Occlusion + (Environment Maps * Reflection Occlusion)

The environment pass has been multiplied with the reflection occlusion pass, the result is then added to an ambient occlusion pass. Have a look at the Shake script for this frame.

The Maya project can be downloaded here.

The reflection occlusion is calculated with a ilrOccSamper node. The type is set to Reflection Occlusion and the output is set to occlusion only. Min/Max defines the minimum and maximum rays that are used to calculate the occlusion. The Cone Angel defines the angle of the secondary rays that are jitterd around the main reflection vector.

Adaptive Sampling can't be used in the reflection occlusion model, because every pixel needs to be calculated with an occlusion value.

coneAngle

The attribute Cone Angle on ilrOccSampler is used to create reflection blur. Reflection blur is achieved by jittering the secundary rays around the main reflection vector and the angle is set by this attribute. The blur is used to simulate different material types, we use a low value for mirror surfaces and a high value for a diffused material. We can also use HDRI blur to create a more realistic simulation of the reflection in the material. A mirror material tend to have a lower HDRI blur and a diffuse tend to have a high blur.

coneAngle.mb

The testscene coneAngle.mb shows how the secondary rays are jittered around the main reflection vector. The camera is moved with lo_cam and lo_camAim, container_coneAngle.Cone Angle defines the angle on the cone object.

The following frames shows the same object with different Cone Angle settings.

Reflection Occlusion coneAngle 0

Reflective Occlusion Pass

Reflection Occlusion coneAngle 10


Reflection Occlusion coneAngle 30


Reflection Occlusion coneAngle 60


Environment map

HDR Image

The HDR image we are using for the environment map is a modified version of Paul Debevec's HDR probe Uffizi. The image has been converted to latitude/longitude and has a resolution of 1500*750. The original image can be downloaded from Paul Debevec's homepage.

The HDR file is loaded with Turtles Image Base Lightning. Enable Image Base Lightning in the render globals and load the HDR file. Set the Sampling Lights to 0, because we don't want to use any lights in the scene. Enable Use HDR in Reflections.

We set the Blur depending on the material we are trying to simulate, 0 blur for a mirror shader and 1 for a diffuse material.

Set Reflections to 0 in the Ray Trace options because we don't want to get any reflections from the objects in the scene.

Blinn Settings

Assign a Blinn shader to all the objects in the scene. Assign the following attributes to the shader. It will produce a perfect reflection of the environment map.

 color:R:0 G:0 B:0
 diffuse:0
 translucenceDepth:0
 translucenceFocus:0
 eccentricity:0
 specularRollOff:1
 specularColor:R:1 G:1 B:1
 reflectivity:1
 reflectedColor:R:1 G:1 B:1

Only Environment Map

Multiply the reflection with a occlusion pass.

The result will look like this, a far more realistic reflectionpass.

Final Animation


The Shake project for a single frame can be downloaded here.

Acknowledgement: Thanks to Kalle Löfberg for the basic form of the craft.

This tutorial is written by Jonas Salomonsson. If you have any questions about the project files feel free to contact him at
jonas[at]above[dot]se

Return to Tutorial index
 
Last modified 2006-03-08