home about gallery publications education links contact

..::refractive caustics::..

Note from the author: This article was written with 3ds max 5 in mind. It should be noted that later versions of 3ds max contain the ability render caustics due to the inclusion of the Mental Ray renderer.

A few issues back we covered how to create reflective caustics using 3ds max 5’s base kit. However, the method described did not cover how to produce refractive caustics. As there is no automatic method to create these by default in 3ds max 5, we shall cover how to convincingly fake them.

First and foremost, why would we want to fake something that could be easily produced with a third party renderer? Two things – time and money. Rendering photon-based lighting can take an age if it’s not set up properly and to produce effective results you will have to have a lot of photons flying around to create a nice caustic effect. And the only way to produce such an effect “properly” is by purchasing a third party renderer for max and these can cost a fair amount. Therefore using a faked caustic effect can be more feasible.

Enlarge Screenshot Refractive caustics are displayed around the base of a wine glass (for example) where the main key light has been refracted and focused through the change in material density, internal reflection and emitted onto a surface such as a table. (** insert image : refractive_caustics01.jpg **) This can be simulated by using a projection map emitted from a clone of the original key light, set up to just illuminate the surface(s) that receives the caustic effect.
Enlarge Screenshot

Okay, a relatively simple solution, but how can we create our projection map? With our scene already set up, we can utilise the reflective properties of the glass object, in this case a bottle, to generate our caustic projection map. The key light is focused directly onto the bottle and rendered off with a square 1:1 aspect; if a non-square aspect is used, the projection map will be distorted and will not line up correctly when re-used. Note that there are imperfections in the glass; these are generated using bump mapping to simulate a mass-produced product that has been sealed and contains some heat distortion. These imperfections can add to the effect. The resulting render is of a black background with white highlights generated by the glass material.

With the key light Viewport rendered off, this image can be re-imported into max and used in a clone of the original key light. However, in the original photograph the caustic effect becomes dispersed and more diffused the further away it gets from the glass. To simulate this we can combine two (or more) copies of the rendered images with different blurring intensities. To combine these we can use a Mix map with an intense blur assigned to one copy and a lesser (or none) blur in the other. To control the mixing, a Gradient Ramp map is used to set how far away from the glass (or how far up in the Viewport if viewed from the key light’s Viewport) the maps should change. Due to this blurring, some intensity is lost, therefore the Output amount in the render’s Bitmap map should be significantly increased to generate that high intensity glow around the base of the glass where the light is immediately focussed.

Enlarge Screenshot Finally, we can project this map using a copy of the main key light (the light from which the highlight pass was rendered). Copy the light and turn on raytraced shadows in the original light. Increase the original light’s Falloff/Field to illuminate the environment a little more. In the key light copy (the caustic emitter), exclude the bottle from receiving light or casting shadows. Ensure that shadows are turned off for this light. The mixed map setup should be dropped onto the Projector Map slot of the caustic emitter light (using instanced copying should you require to easily tweak settings later on). The light is excluded from illuminating (etc) the bottle as it is already being illuminated from the original key light; lighting the bottle with the caustic emitter would generate an undesired effect.
Enlarge Screenshot And here we have our final result . It’s not technically accurate, but it gives a visual interpretation of a caustic effect which can add realism to a scene, even if it’s a subtle effect. To add further detail to the effect, try blending an overhead rendered position of just the bottle on a black background (as before) with the original render and project this through the key light copy to create some nice concentric circle caustic effects. This is especially effective if an imperfect wine glass is used as our model. Furthermore, if glass or other refractive material is used that has a colour tint, the caustic will also be tinted as the glass (etc) acts as a gel (a coloured filter). This can be simulated by tinting the caustic map; the bottle’s shadow colour should also be tinted to simulate this gel effect.
Download the max file! Zip file to accompany

Initially published: Computer Arts magazine, Issue 86, August 2003.

Copyright Pete Draper, August 2003. Reproduction without permission prohibited.