Let's start by answering the question, "what are caustics?" According to wikipedia, "a caustic is [an] envelope of light rays reflected or refracted by a curved surface or object, or the projection of that envelope of rays on another surface." This results in the concentration of light into patterns of light and shadow that's projected onto another surface. Caustics are very common in the environment around us and can be used for both artistic effect and to increase the level of realism in 3d renderings.
photos: Jimmy Earl, Heiner Otterstedt
Brazil r/s will automatically and accurately render caustic generated by both reflective (mirror) and refractive (glass, water, etc.) sufaces.
This exercise will cover the various settings that enable and control rendering of caustics in Brazil r/s.
Breakdown
Start by downloading and rendering the example scene (3ds Max 8, and Brazil r/s 2.0).
The scene contains a ground plane, one direct light, a camera, a cylinder (to add some reflections) and a glass teapot that we will use as a caustic generator.
The scene's material setup is as follows:
- teapot = Brazil2 glass material with default settings.
- ground plane = Brazil2 advanced material with diffuse set to white and a small specular highlight.
- cylinder = Brazil2 advanced material with diffuse set to white, highlight shader set to "none" and fully self illuminated (luminosity: 255/255/255) with Kl set to 2.0 (this setting makes the reflected cylinder more visible).
The scene is illuminated by a direct spotlight and a small amount of direct sky light (color: 23/36/50). Most of our caustics will be generated from the spotlight.
The quality and shape of your caustics depends largely on the geometry used to generate the caustics. More complex geometry creates more complex caustics, reflecting and refracting your light rays in a greater variety of directions.
The rendered scene is shown below with notes what we want to do. The rotated camera view is there to make the image a little more dramatic and to get the caustics aligned into a diagonal.
Note: Make sure that Genrate Caustics is checked on in Brazil2 Glass material options.
Execution
- Enable Caustics
- turn on photons in light rollout -- keep the default settings.
- Switch the lights shadow generator to "Brazil2 Ray shadows" to make the shadow transparent as they travel through the glass object.
- Check "Enable" in "Brazil Photon Map Settings" rollout, and turn Caustics on (marked with red dot).
- Render.
Caustics are there and look good already, but the transparent shadows look wrong.
- Fixup the shadows by changing the shadow mode to "Rectangular Area":
- Tweak the caustics settings
- Set the "Photons in Estimate" to 50
- Set the "Max Search Radius" to 1000
- Adjust the "Energy Tweaks" "Multiplier" to .55
The larger Max Search Radius will blends sparse areas of the caustic photons together better, and the smaller number of Photons in Estimate will cause the photon gather to stop searching for more photons around the sampling points much sooner ("Smaller Effective Radius"). By lowering the energy Multiplier, we are preventing the amount of over-bright photons in the of caustics.
- Increase the image sampling and render
- Set the Image Sampling to 1 by 2.
- Render
Conclusion
Now we have our glass teapot with believable shadows and caustics. You can download and render this final scene here.
Caustics in Brazil r/s render very quickly, so they are a feature that's actually quite fun to play and experiment with. Try different settings from those above and note how the changes affect the rendering. In addition to that, try getting creative and experimenting with some of the following:
- Glossy reflections on the teapot glass material.
- Allow Absorption in the glass material.
- Try caustics with Dispersion.
- Play with area shadow settings.
- Experiment with the "Affect Surface" settings in the light.
- Try different Photon Map Settings.
- And in the end, why not a little of post-production?
The techniques mentioned above were all used in the creation of the following picture: