| Keyframe Magazine Web Resources Article Project Files
Diving in with Caustics and Deformation Modeling with bhodiNUT's NICKL in CINEMA 4D XL v7
Intro
What are Caustics? Not a harsh chemical, they are actually a class of mathematical expressions used to describe the interaction of light reflecting off of and refracting through different optically transmissive materials. A classical description of Caustics reads:
"Caustic curves: When light reflects off a curve then the envelope of the reflected rays is a caustic by reflection or a catacaustic. When light is refracted by a curve then the envelope of the refracted rays is a caustic by refraction or a diacaustic.
They were first studied by Huygens and Tschirnhaus around 1678. Johann Bernoulli, Jacob Bernoulli, de l'Hôpital and Lagrange all studied caustic curves."1
In more practical terms, Caustics are found pretty much anywhere that you find metals, liquids and light. The pattern of light found at the bottom of a swimming pool filled with water is an expression of Caustics, the way a magnifying glass condenses and focuses the rays of the sun to set fire to a piece of paper is also an expression of caustics. The dazzling pattern of light reflected from a chrome sculpture are also an expression of Caustics in the real world.
The use of caustics in a 3D rendered scene can lend a degree of realism to the finished results without costing too much in terms of rendering time. Through careful use of the caustic settings in CINEMA 4D XL v7, you can achieve a high degree of photo-realism in your finished renders. The goal of this tutorial is to show you how to control the various parameters for both surface and volumetric caustics. One of the main points will be to create believable looking water both the surface and caustics visual effects associated with water. A great way to do this is with the new deformer tool from bhodiNUT called NICKL. NICKL is free to any registered user of C4D XL from MAXONs Plug-in Café.
NICKL includes several noise-based functions for use as within a deformation tool in C4D XL. Noise functions can add a heightened degree of realism to 3D images and can be applied to nearly every aspect of scene or animation. Used in modeling, texturing, lighting or animation; noise-based functions can add an organic quality that would otherwise be very difficult to produce by hand. Ken Perlin is credited with the creation of the algorithms that are now used to produce most of the noise functions used in computer graphics from the 1980s forward. The caption on his Technical Achievement Award from the Academy of Motion Picture Arts and Sciences for work he did back in the 1980's on procedural textures sums it all up with:
"To Ken Perlin for the development of Perlin Noise, a technique used to produce natural appearing textures on computer generated surfaces for motion picture visual effects.
The development of Perlin Noise has allowed computer graphics artists to better represent the complexity of natural phenomena in visual effects for the motion picture industry." 2
NICKL is an application of these and other functions that can be applied to 3D geometry. NICKL works on primitive, polygonal and spline objects in C4D XL. It can be used to create phenomenal effects. It can be used to modify and animate objects to look like they made from materials that exhibit fluid, elastic and other amazing behaviors. Like all deformers in C4D XL, NICKL is non-destructive. This means that it is applied to a given parent object and can be removed from the hierarchy at any time to return the parent to its original state. This means that you can try all sorts of different settings with NICKL and never worry that your original geometry is being permanently modified or destroyed.
You could use NICKL pretty much anywhere that you want to simulate most any type of fluid effect like water, fire, gaseous vapor, and various organic movements. It can be used to make great looking water, it can be used to make awesome looking biological animations (amoebae, jellyfish, and more). Applied in small amounts it can create just the right degree of random looking motion that can make an animation come to life.
One of the most powerful features in NICKL is the inclusion of a special class of 3D noise called Periodic Noise. This is a four dimensional tiling noise derived from Perlin Noise. This means that it tiles in the X, Y and Z space as well as over time. Each different axis can be modified to have different periodic cycles and you can tune it to repeat seamlessly in both space and time to whatever setting you require. Well talk a little more about those settings in a moment.
Getting Started with Caustics
Caustics are turned off by default in C4D XL. There are two places that they must first be enabled. One; any given light in a scene must have either have surface or volume caustics enabled under the caustics property pane, and two; you must also enable surface or volume caustics under the render Settings caustics pane.

Having caustics enabled for both a light and the render settings will not necessarily produce any caustic effects. You must first have something for the light in interact with. Additionally the type of material applied to interacting objects matters a great deal too. You will need to make sure that the materials that are to produce the caustic effects have either Transparency or Reflectivity channels activated (See the Tips and Tricks below for issues to watch for).
There are three basic settings used with caustics. They are Energy (a percentage value), Photons (an initial starting integer between 10 and 10 million) and Falloff (inner and outer ranges for the effect in scene units).
The default settings for caustics work well when used with a default Spot Light. This is because the photons are being projected down a narrow cone. With the default settings you have 10,000 photons being scattered across a given area and each photon is contributing .01% luminance to the total sample set of photons. This means that each photon is low in intensity and when you get a lot of them being clumped together like you might through a refractive surface, that you will get a decent, though somewhat granular effect. This is because the defaults are configured to give good visual feedback with a minimum render cost.

If you increase the number of initial photons to 500,000 you will see that the resulting effect is much smoother in appearance. This is because with the higher photon count, each photon is now contributing .0002% luminance to the total sample set of Photons.

Half a million photons for surface caustics sounds like a lot this does require around 35MB of RAM at render time for just the Photon map, but it is still reasonable. You can go much higher, but this will take longer to generate and will require more memory. Remember this is for each light which has caustics enabled. It is a good work habit to get what you need from one or two caustic enabled lights.
Also realize that number of photons specified is the initial starting number of photons. If a photon reacts with a reflective or refractive surface an additional photon will be generated, in the same fashion as rays in the raytracing process. Scenes which are highly refractive or reflective and have complex reactive surfaces can see a dramatic increase the final photon count from the initial starting value specified in the light settings. Careful placement and usage will keep render times reasonable and the visual results pleasing.
The previous examples only use a Spot Light. Different light types will require different treatment and handling. See the Tips and Tricks below for details on how each type of light handles caustics.
So far we have only looked at surface caustics. Volume caustics and surface caustics use identical options in the light settings. For volume caustics to work you need to make sure that the Visible Light settings are set to Volumetric. The Visibility pane has settings which control the volumetric effects for the light, and these in turn also control volume caustics. It is also worth noting that the Brightness setting in the Visibility pane also acts as a gain control on the volumetric caustic solution. It is possible that you could have a volume caustic calculated at over 1,000,000%!
The number of volumetric photons needed for a given scene is generally considerably fewer than those needed for surface caustics, but this is dependant on your given scene and requirements. As mentioned earlier, the volumetric photon number represents the initial number of photons generated by a given light.
A falloff setting controls the outer volume depth to be evaluated for volumetric caustics. This is set to 1000 C4D units by default. Different falloff functions are available for controlling the decay of the effect. An inner depth control is also used to offset the initial depth evaluated. With these controls you can confine the volumetric caustics to a given region of your scene, and control the amount of memory required to evaluate and render the effect.
Since this is a volumetric effect, many of the same rules for setting up volume lights apply to volume caustics. The specific controls for how volumetric caustics are rendered are found in the caustics pane in the render settings. As we mentioned earlier there are check boxes for enabling the two different kinds of caustics Surface and Volume. The Strength setting affects both surface and volume caustics alike. Strength is a gain control that can either increase or decrease the intensity of the caustic effect of the finished render. A setting of 100% is the same as a gain of zero. Adjust this according to your needs.
Unlike volumetric light effects, volumetric caustics do not require that soft shadows be used to generate the effect. In fact volumetric caustics do not require that any shadow be generated at all. This will allow you to utilize this effect in a wide range of settings.
The next three settings; Step Size, Sample Radius and Samples are only editable if volume caustics are enabled. For most situations the default Step Size is too high. You will recall that volumetric effects require a series of samples to be sampled along the Z-axis of the volumetric region. The Step Size controls the spacing between these samples. It is important to note that each step requires its own photon map to be generated. This can mean that very large amounts of memory can be required for a volume caustics solution. Use them carefully. Generally speaking you will want to work with a Step Size which is, at most, set to half the size of the Sample Radius. This will result in a smoother looking application of the effect. This does not mean, however, that you should not try different ratios. By all means experiment! Frequently it is the "happy accident that leads to innovative discovery!
The Sample Radius will control the local scale of the volumetric caustic effect. A larger Sample Radius will mean a larger volume will be sampled for any given photon. The number of Samples defined will affect the number of photons sampled per step. Lower samples will result in a more "granular" look and higher samples will result in a more homogenous and smooth looking effect.

Materials can also have influence over how caustics are handled. If you click on the Illumination channel in the Material Editor you will note that there are different attributes for receiving and transmitting caustic effects. These work as a material-based gain control for both the receiving and sending photons. Adjust these as you see fit for your given scene.
The best thing to do is to get your feet wet and start playing with these features and parameters to see what they do and how they work.
Getting Started with NICKL
Deformation objects or deformers are, in concept, a very simple way to affect objects and groups in your C4D XL scenes quickly and easily. There are a few basic rules to keep in mind so that you can understand and anticipate what sorts of results you might get.

For a deformer to have any effect at all it must be made a child of the object or group that you wish to affect. You can affect many separate objects simultaneously by placing all the objects and the deformer as children of a Null Object or Empty Object. You can even have more than one deformer operating simultaneously on a group of objects. To do this, place everything below a parent object in your hierarchy.
In many cases the order of the deformers in the hierarchy has a direct effect on the resulting deformation. For example having a Bend Deformer above a Taper Deformer in the hierarchy produces a very different result when their hierarchical positions are reversed. It is well worth your efforts to spend some time trying out different arrangements of deformers in the hierarchy to better understand the results.

It is also possible to limit the effect of a given deformer through the use of Vertex Maps, and Selection Set Restriction Tags. Remember that you generate and place the Vertex Maps on the object being deformed and the Restriction Tag on the deformer. You get them to work together by naming Vertex Map and Selection Set in the Restriction Tag. You can also set the percentage of influence a given Selection Set or Vertex Map has in the Restriction Tag.
NICKL is a very flexible and special type of deformer. It is a plug-in and is accessed from the plug-in menu.
When you first create a NICKL object for your scene and double-click it in the Object Menu you will see that it is comprised of five different regions that control different attributes of the deformer plug-in. They are; Function, Attributes, Falloff, Movement and Temporal Animation. Certain function types will disable some of the different input options.
Function:
There are seven different function types to choose from; Noise, Period Noise, Fbm, Turbulence, Wavy Turbulence, Organica (developed by Paul Everett) and None. Some of these noise types should be familiar as they are based on the internal noise functions in C4D XL. Period Noise and Organica are special function types. Organica is a sinusoidal function. Period Noise is a special application of Perlin Noise that seamlessly tiles both in Space (X,Y and Z) and Time. Because of this the entire Temporal Animation section and Period input fields under the Movement section are only active when Period Noise is selected.
Also part of the function controls is a Scale setting for controlling the scale of a given function. As one would expect a lower scale percentage will result in a small noise and a larger scale will result in a large noise. Scale can be set from 0% to 1,000,000,000% and higher. It should be noted that values over 2 million can result in rounding errors when the NICKL parameter dialog is closed.
Attributes:
Under Attributes there are settings for Direction, what Space the deformer operates in, and the Strength of the deformation. The choices for Direction are Planar, Spherical and Normal. Planar and Spherical are applied as one would expect. Normal, however, is a special case. Normal applies the deformation along the normal of any given vertice. The Space setting determines what space the function is evaluated in.
Object means that the function will behave as if it is always located at the axis of the object. This means that you can have multiple objects being deformed by NICKL and each one will have the deformation applied from its axis even if they are all in different locations or have different rotation settings. World means that function will behave as if it is always located at the world origin of the scene. Deformer means the function will be evaluated based on NICKLs position and rotation.
Strength settings can be either positive or negative percentages. High settings (over ±1000%) will generally produce extreme results.
Falloff:
Falloff can be set to three different Types (Infinite, Spherical and Cubic). Infinite will result in NICKL being applied to the scene uniformly, Spherical and Cubic will limit NICKL to a region defined by the Radius (in C4D scene units) and will decay from the center of the region to the edge based on the Falloff percentage value. Falloff values can be from 0% to 100%
Movement:
The Movement controls can animate the offset of the function by translating it through any combination of values across the X, Y or Z axis. A value of one represents a movement translation of 100 C4D scene units per second. It is important to note that this assumes that the Function Scale and the Movement Speed are both set to 100%. Adjustments to Function Scale and Movement Speed will act as a gain control on the Translation. For example if you have your Function Scale set to 200% and you want to have the noise translate 100 units per second, you will either need to set the Translation value to .5 or the Movement Speed to 50%. This can get a little tricky since all these values are all linked together.
Temporal Animation:
This controls the speed that the function is run at over time. The function will animate and deform your objects even if you have not applied any translation within NICKL. Many of the noise functions have very high internal frequencies (Fbm and Wavy Turbulence for example) and will generally look better if you run them at lower Temporal Speed values. The Temporal Animation Period setting is only available with Period Noise. There are some tips listed below on working with periods and getting NICKL to seamlessly loop over time when using Period Noise.
Putting it all together
So now that you know the basics about bhodiNUTs NICKL deformer and C4D XL v7s caustics, the next thing to do is to put them all together in a simple scene that can be used as a seamlessly looping web animation. For this quick scene a handful of gold coins has been lost at the bottom of a tropical lagoon. A sea urchin watches over the sunken treasure and gently waves its spines. NICKL is used in this scene to deform the water surface, creating the surface caustics pattern on the sea floor and to produce the volumetric caustics projecting down into the water. NICKL has also been used to pose and animate the sea urchin. All settings were optimized so that the scene could be rendered as an animation and looped over time as a web viewable graphic.
The best way to see how this was all done is to look at the project file and play with it at your own pace.
If you do not have a copy of CINEMA 4D XL v7 you can download a demo version from MAXONs web site along with a copy of NICKL and many other great resources so that you can start working with caustics and NICKL deformations right away.
Tips and Tricks
Caustics
For caustics to work you need a Transparency with a refractive index setting between .25 and 4.0, but not equal to 1.0. What this means is that C4D XL supports refractive values from .25 on up to a value of 4. A value of 1 applies no refractive change to the rays passing through it and as such will not be used in the generation of any caustic effects.
If you have a reflective material that is 100% transparent and has an index of refraction equal to 1.0 you will need to lower the transparency before the material will be used in the caustics solution at render time. Otherwise objects with this material will be ignored by the caustics portion of the render process.
Even with shadows enabled, the samples for caustics can bleed behind other surfaces. Be aware of this when you construct your models and create your scenes.
Omni and Tube lights project their illumination into a cubic region and there are 6 separate Photon map passes required for each light. Photons are divided between each of these 6 projections. You may wish to increase the Photon count and/or intensity with Omni and Tube lights.
Spot Lights (Round and Square) project their illumination into a conic region. There is only one Photon map pass required for each light. The outer angle settings for the light controls the area of the Photon map.
Parallel Lights, and Distant Lights project their Photons into a cylindrical region defined under the Shadow pane. Use the Parallel Width to control the area of the Photon Map.
Round and Square Parallel Spotlights also project their Photons into a cylindrical or cubic region defined under the Detail pane. Use the Outer radius to control the area of the Photon map with this light type.
Area Lights are a special case. Their size is controlled by the Outer Radius setting in the Details pane, but due to the very nature of Area Lights the region is difficult to predict or define. It is basically the same as the area illuminated by the light and is projected generally along the lights axis.
NICKL
Isoparms and Normal view mode will cause NICKL to not be evaluated. This is because there are not any normals to evaluate when working in Isoparm view in the Editor Window.
By default NICKL is configured for Period Noise and is set up to have it loop seamlessly. All the period values are set to "3" which corresponds to a default C4D XL scene having a 3 second duration. For seamless looping the duration of the scene, in seconds, should be divisible by the Movement Translation Period values. Here is a handy table to get you started with this:
| Scene Length (seconds) |
Periods that will loop seamlessly
(Movement and/or Temporal) |
| 1 |
1 |
| 2 |
1, 2 |
| 3 |
1, 3 |
| 4 |
1, 2, 4 |
| 5 |
1, 5 |
| 6 |
1, 2, 3, 6 |
| 7 |
1, 7 |
| 8 |
1, 2, 4, 8 |
| 9 |
1, 3, 9 |
| 10 |
1,2,5,10 (and so on) |
Remember that these values only work with the Scale and Movement and/or Temporal Animation Speed set to 100%. You can achieve other looping durations by adjusting the Scale and Speed settings accordingly. For example; if a scene is 4.5 seconds in length, then set the period to 9 and the speed to 200% and you will loop every 4.5 seconds.
Fun recipes:
Magnet:
Use NICKL in what can be referred to as "Magnet Mode". Set Noise to None and Falloff to Spherical. Now move the NICKL region around and watch as it pulls on the object like the Magnet Tool. Remember this is a non-destructive process so have fun with it!
Flying:
Group NICKL and your object to be deformed under a Null Object. Have NICKL with Scale and Strength set fairly high (Scale=1000%, Strength=500%) and set the Attribute for the Space to World. Then set Falloff to None. Now move the object around and watch as NICKL moves it all about. You can make it look like something is swimming or flying through a fluid medium with this technique. This process combined with Vertex Maps can make awesome animated motions!
Endnotes:
1 As referenced on the University of St. Andrews, Scotland web site:
http://www-history.mcs.st-andrews.ac.uk/history/Curves/Definitions2.html
For more historical information on Caustics, Mathematics and related Optical information please visit an excellent reference on Hamiltons papers on Geometrical Optics as published by D.R. Wilkins of the School of Mathematics at Trinity College, Dublin web site:
http://www.maths.tcd.ie/pub/HistMath/People/Hamilton/Optics.html
Additional contemporary information as it pertains to Computer Graphics can be found in a paper written by Henrik Wann Jensen, titled "Rendering Caustics on Non-Lambertian Surfaces". A copy can be found on the Internet at:
http://graphics.lcs.mit.edu/~henrik/papers/gi96.html
2 For more information on Ken Perlin and Perlin Noise you can visit Ken Perlins home page at:
http://mrl.nyu.edu/~perlin/
There is a lecture which Ken Perlins gave at the GDC Gamers Hardcrore workshop in 1999:
http://www.noisemachine.com/
Additionally there is a great visual guide to Perlin Noise on Hugo Elias web pages found at:
http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
Liscense |