Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 11

Creating Caustics

Wednesday, 10 January 2007

This tutorial show you how to create caustic effect in V-Ray for Rhino.

Introduction

Caustics are the nice lighting effects you see around reflective or refractive objects. The smaller your
lightsource (or the further away you place it), the sharper and nicer your caustics will be. Here are two
examples of refractive caustics.

The first example is a wineglass, lit by the sun: very sharp and nice patterns. Light gets refracted and where
a lot of light is bundled, you get these bright patterns.

The second example is the same glass, this time lit by the sky trough a large window on one side (meaning a
larger lightsource): blurry caustic patterns
Here an example of reflective caustics. The first one is again lit by the sun:

And the second one lit by the sky/window again:

This image shows the typical pattern a reflective ring produces:

CG caustics

In vray, you have many ways to let caustics show up. Every method has its advantages, and it all depends
on how important the caustic effect in your rendering should be.

What you should remember is that all methods try to do the same thing, so you shouldn’t mix two methods or
you can get a double caustics effect. Usually vray will automatically turn of one method if you turn on
another. More on that later.
Refractive caustics

Starting with refractive caustics, because this is used a lot and it also has the most methods to create them.

One of the frequently asked questions in rendering with Vray is "why isn’t the light going trough my refractive
objects???" In most not so advanced renderers, transparent objects do let light trough by default. In fact, this
is a fake caustics effect, and many people don’t realize that. Then they start using vray, and immediately
notice that for example a glass material is casting a pure black shadow.

Open scene caustics_01.3dm. There is a groundplane, and 3 objects with a glass material. I also added a
point light with default settings. Render the scene, this will give you this image:

Clearly this is not how you would expect glass to behave. There are three ways to let light pass trough
transparant objects, or in other words, to generate caustic effects:

 fake it with the fog material parameters


 GI caustics
 Photon mapped caustics

Fake refractive caustics

Since now we are not yet using GI, we will look at the other 2 options first. To get the effect you are probably
used to in render engines like for example flamingo, we must use the fake caustics method.

Go to the glass material properties, and then in the refraction rollout, tick the option ‘affect shadows’. This
means, the fog options will control the transparency of the shadows. Render the scene again and you get
this image:

This is how transparent shadows look in most render packages. In fact, these are fake caustics and it looks
very different than in real life. It is good though if you want your lights to pass trough windows for example.
Refractive GI caustics

The fake caustics are only usefull when using ‘artificial’ lights, like rectangular lights, spots, pointlights etc…
If you are only using a skylight or environment HDRI to light your scene, the affect shadow option will not do
anything, and you will need to use GI caustics to let light pass trough glass. Open scene caustics_02.3dm.
There is a tube with a glass plate on it. The scene has basic GI turned on, lighting is done by a light blue
environment color. If you render the scene, you get this image:

As you can see, the inside of the tube is not black, so in fact light is coming trough the glass plate! Try
turning on and off the ‘affect shadows’ option for the glass material. As you will see, this has no effect at all.
You should remember that this option is only used for what is called ‘direct light’. This is light coming from the
rhino light types. Skylight, hdri light and rectangular lights with the ‘store with IR map’ option turned on, are
all not direct light. These last three don’t produce direct light, but GI light (calculated with whatever method
you set in primary GI engine).

The reason that the skylight is able to go trough the glass plate in this file, is because by default an option is
turned on to do so. In the vray render options, in the Indirect Illumination rollout, there is an option to turn on
‘refract caustics’. Turn this off and render again. You will get this image:

The inside is very dark now… So this option is very important for interior renders where you want your
skylight to pass trough glass windows!

As said, with point lights, spot lights and directional lights, you must enable the affect shadows option to let
light pass trough your objects. The rectangular light is an exception. Altough it produces direct light also, vray
is capable of calculating GI caustics from it. In other words, you don’t have to use the affect shadows option
to let the rectangular light pass trough your glass objects. To demonstrate this, open scene caustics_03.3dm.
Render and you will get this image:

The scene has GI turned on, and is lit only by a rectangular light (no skylight). You will see that the objects all
cast a black shadow, which is not what we wanted. The problem is that for vray to calculate real GI caustics,
you need real light settings too. If you look at the rect light properties, you will see that by default, the ‘no
decay’ option is checked. In real life, every lightsource has inverse square decay. So turn off the ‘no decay’
option in the light. The light will now have an inverse decay falloff. This means that the further away from the
lightsource you place objects, the darker they will be. If you render right now, the whole scene will be black…
Because the light has now a falloff, you will need a higher multiplier for the light to reach our scene objects.
Set the light multiplier to 60 and render again. Now you get this image:

As you see, the light passes trough the objects, but it is splotchy. Since these are GI caustics, the quality is
controlled by your GI settings, which are very low for the moment. Here is an image with higher GI settings:

And the scene for you to study: caustics_04.3dm


Results are still pretty low quality, which is because caustics are not that easy to compute with the GI
engines. GI caustics are mainly used to avoid dark areas in renders lit by a skylight only. For example the
surface underneath a glass table top, or the inside of an interior scene behind glass windows.

Photon mapped refractive caustics

If you want very good and physically correct caustics, you should use ‘photon mapped caustics’. Open
caustics_05.3dm. There’s the glass objects again and a point light. Render the scene and you’ll get this
image:

We want realistic light passing trough the glass objects, so we need photon mapped caustics.

In the vray options, go to the caustics rollout, and turn on caustics. Render the scene, nothing has
happened… Also here, we need an inverse square decay option for the light source or it won’t work. Go to
the point light and choose inverse square decay instead of linear. Like before, we will also need to increase
the light strength. Choose 15000 for the light multiplier. Render again, you get this image:

The caustics you see now are photon mapped caustics. They are not computed with the GI settings at all,
but a with an independant system.

Now we want better quality. Take a look at the caustics rollout settings. From the helpfile:
Multiplier - this multiplier controls the strength of the caustics. It is global and applies to all light sources that
generate custics. If you want different multipliers for the different light sources then you should use the local
light settings. Note: this multiplier is cumulative with the multipliers in the local light settings.

Search dist - when VRay traces a photon that hits an object in some point the raytracer searches for other
photons on the same plane in the surrounding area (search area). The search area in fact is a circle with
center the original photon and its radius is equal to the Search dist value.

Max photons - when VRay traces a photon that hits an object in some point and counts the photons in the
surrounding area it then averages the illumination of that area based on the number of the photons in it. If the
photons are more than Max photons VRay will only take the first Max photons of them.

Max density - this parameter allows you to limit the resolution (and this the memory) of the photon map.
Whenever VRay needs to store a new photon in the caustics photon map, it will first look if there are any
other photons within a distance specified by Max density. If there is already a suitable photon in the map,
VRay will just add the energy of the new photon to the one in the map. Otherwise, VRay will store the new
photon in the photon map. Using this options allows you to shoot many photons (and thus get smoother
results) while keeping the size of the caustics photon map manageable.

For sharp high quality caustics, you should make sure that not too much surrounding photons are blended
together. The max photons is important here. Lower this to 10 and render again. You get this image:

Still no good, but you can see they are sharper already.

The other main parameter for high quality, is an option you must set on each light. Go to light properties of
the point light, and note the caustics subdivs (not photon subdivs!!!). Increase this to 2500 and render again.
You get this image:

Probably we lowered the max photons too much, we will never get it smooth now. So change it to 25, and set
caustics subdivs of your light to 5000. Now you get this image:

That’s looking better! Download the scene with these high quality settings here: caustics_06.3dm

Max density can be used to limit the photon map size a bit. It will make sure that not too much caustics will
be stored in the same location.

Here some examples of what the other settings do:


http://www.spot3d.com/vray/help/VRayHelp150beta/examples_caustics.htm

If you don’t want to use inverse square decay on the light, you must enter a very high caustics multiplier
(instead of a very high light multiplier). For example in this case, linear decay with light multi=1, would need
15000 for caustics multiplier to get evenly bright caustics as in the previous test.

Some notes:

 caustics are best visible with small lightsources. Ideal is the pointlight. Rectangular lights have a
bigger area, the caustics will be softer, and also more difficult to compute.
 Sometimes caustics are unwanted! Mostly they are not used, and if they are used, it is to let light
pass trough straight glass planes. One area where caustics are important is jewelry, and therefore photon
mapped caustics can be very usefull. In most cases, low quality GI caustics will be more than enough.

Reflective caustics

All things already said are also true for reflective caustics. The only difference is that here you don’t have the
fake type, and that these caustics are generated by materials with a reflective layer in them.

Reflective photon mapped caustics were in fact already present in the previous examples. The glass has a
reflection layer too, so some caustics came from that. Look at our last rendered image, on the other side of
the objects. Some bright spots can be found on the floor there, these are reflective caustics.

Open scene caustics_07.3dm, and render. You get this image:

I used the same lighting setup as before. But now there is a chrome ring in the scene. You can clearly see
the reflective caustics on the inside and outside of the ring.

To get the same thing, but with reflective GI caustics, we need to replace the point light with an area light
(remember GI caustics only come from non direct light, exception is the rectangle light, also called area
light).
Open scene caustics_08.3dm. The same ring, and photon mapped caustics is turned off. Area light instead
of point light. If you render, you get this image:

No caustics? Simply turn on the ‘reflective caustics’ in the indirect illumination rollout. This is off by default!!
Render and you will get this image:
Very low quality... Here is an image with better quality GI caustics:

Open the scene: caustics_09.3dm to look at the settings. The quality is controlled by the GI settings, which is
not the goal of this tutorial.

Notes:

 You can turn on or off reflective and refractive GI caustics. But you cannot turn off only reflective
photon mapped caustics. So with photon mapped caustics, it is either both on or both off!
 You cannot generate photon mapped caustics from skylight lighting.
 If you enable photon mapped caustics, the GI caustic creation is automatically disabled. Otherwise
you will get a double caustics effect.
 Same for the affect shadows option. If you have photon mapped caustics enabled, the affect
shadows option will not be used anymore (this is for refractive caustics only of course)

To finish this tutorial, here is a wineglass render with very high caustics subdivs:

And the scene if you wanna take a look at it. Note this will take some time to render... Also try to render this
scene with caustics disabled, so you can see the difference better. caustics_10.3dm

You might also like