This article explores the concept of caustics, complex light patterns created when rays focus through reflective or refractive materials like glass, water, or gems. Rendering these effects has traditionally been complex and time-consuming, however, modern rendering tools like Corona provide an efficient solution by combining reverse path tracing with automated photon mapping
Key takeaways:
-
Caustics are essential for achieving photorealism because they accurately represent how light behaves when converging through curved or transparent surfaces in the physical world.
-
Because computing caustics with pure ray tracing is a big challenge, traditional rendering methods have relied on hacks like clamping bright rays, ignoring glass geometry entirely, or using hybrid or architectural glass.
-
While light sampling resolves the "firefly effect" for small direct light sources, it does not work for indirect light sources like caustics.
-
Corona Renderer optimizes the rendering process through a hybrid approach that integrates reverse path tracing with automated photon mapping.
-
Using this optimized method eliminates the manual setup required for traditional photon maps and typically limits the render time impact to approximately 50%.
This article will cover:
-
What are caustics?
-
Caustics are everywhere: Why are caustics important?
-
How do caustics fit into ray tracing?
-
What is path tracing?
-
Problems & solutions: Explore different scenarios & hacks
-
How do caustics work in Corona?
-
FAQs
What are caustics?
Caustics occur because curved or transparent surfaces cause light rays to converge rather than spread evenly — the crossing of these rays creates regions of intense brightness surrounded by darker areas. Most people think of caustics as the sparkle of light that comes from a glass or a body of water that creates interesting highlights.
CG artists typically know that these effects can take a lot of time and effort to compute when rendering, so they are generally ignored, and people have been able to get believable-looking images without them.
Some people will go to the extra effort of faking caustics to make an image more believable. But the truth is that, in real life, caustics are a huge part of the lighting contribution of the world.
Common real-world examples of caustics include:
- The shimmering, wave-like light patterns on the bottom of a swimming pool on a sunny day
- The bright crescent or heart-shaped light that forms on a table when sunlight passes through a glass or cup
- The focused beam of a magnifying glass concentrating sunlight
- Light passing through a window pane — technically, all refracted window light qualifies as a caustics
Caustics are everywhere: Why are caustics important?
Let’s start by defining what caustics are and see why, in reality, this effect accounts for a large part of the illumination of an image. As we’ve already mentioned, most artists think of caustics as the light that gets focused through glass or water.
But, for the people in computer graphics, a caustic is defined as a light path that travels from a light source to a specular surface (reflection/refraction), hits a diffuse surface, and finally reaches the camera.
In this example, the ray goes from the source to specular > to specular > to diffuse > to camera.
Keep in mind that even a pane of glass, such as a window, also refracts light. Technically, all light coming through a window is a caustic.
Glass panes in windows are another example of caustics.
This specific interaction is responsible for the bright, focused patterns seen at the bottom of a pool or through a wine glass. This means that, in reality, caustics account for a large portion of light in a scene.
Since the light passes through glass, all the lighting in this photo could be considered caustics.
You might be wondering: If we’ve been ignoring caustics for so long, why do we get renders that look believable? In short: Caustics have been faked for years. But before we discuss how we fake it, let’s explain why we fake it.
Caustics are hard to compute
The truth is, the way we have been calculating caustics for years has been very complicated. There are some brute-force methods that can work, but generally, they either take way too long or take a huge amount of shortcuts that end up giving you only a small fraction of the actual caustic contribution.
Many renderers have used something called “photon mapping,” but traditionally, those methods have been very complicated to use — and if not set up correctly, can be very slow to render or simply look very bad (or both!). But methods like photon maps were invented because computing caustics from pure ray tracing is a big challenge. So let’s examine why.
How do caustics fit into ray tracing?
The best way to start to explore ray tracing is to start by observing nature. In nature, rays of light are emitted from a light source. That light bounces off a surface. That bounce can be specular where it changes direction — either through a reflection or refraction — or it can be diffuse where it scatters in all directions.
If we built a ray-tracing engine that imitated that specific model — i.e. trace the rays from the light source all the way to the camera — we would need to shoot an enormous number of rays to get a complete image. That’s because the vast majority of the rays shot from the light source never hit the camera.
While this method is the closest to nature and would eventually find all the lighting contribution of the scene, it is extremely inefficient – it would take days on a supercomputer just to get a usable rendering of a simple scene, which is why we need to think of something more efficient.
What is path tracing?
Reverse path tracing, or simply path tracing, is the industry-standard method where rays are traced from the camera toward the scene. This is significantly more efficient than tracing from the light source, as it ensures only the light that actually reaches the viewer is calculated. By doing this, our rendering can be far more efficient at finding usable rays — and we now have a usable image much faster. And by faster, we mean seconds rather than days.
Problems & solutions: Explore different scenarios
Here are some of the most common problems with caustics and how to solve them in different ways.
Problem 1: Small light sources that cause noise
When using reverse path tracing, rays leaving the camera often miss small light sources like light bulbs. This leads to the 'firefly' effect, isolated bright pixels that occur when only a few random rays successfully find the light.
With simple reverse path tracing, when using a small light source, the rays traced from the camera can miss the source completely, which causes this "firefly effect."
With simple reverse path tracing, when using a small light source, the rays traced from the camera can miss the source completely, which causes this "firefly effect."
Solution: Use light sampling to find small light sources
Light sampling is a solution that helps the renderer to make sure it doesn’t miss the light source. It works well with all light sizes.
Problem 2: Indirect light sources, like caustics, can’t use light sampling
Notice that we said: “small direct light sources.” The problem is that this method cannot work for indirect light sources. One of the reasons is that, while we do know where the light sources are, we don’t know where the indirect ones are — and by indirect light sources, we are mainly talking about caustics. Once a ray reflects or refracts through a surface, we don’t know where the source is until after it has been traced.
Unfortunately, light sampling doesn’t work for indirect light sources, such as caustics. Caustics are difficult to compute. Light sampling takes care of “fireflies” with direct light sources, but random rays could still leave a firefly effect.
Unfortunately, light sampling doesn’t work for indirect light sources, such as caustics. Caustics are difficult to compute. Light sampling takes care of “fireflies” with direct light sources, but random rays could still leave a firefly effect.
So while the light-sampling method takes care of the fireflies left by the direct light sources, we still get a lot of fireflies from caustics. Similar to the issue before light sampling was added, random rays could come across a caustic and leave a firefly effect. So how do we deal with that?
Hack 1: Clamp everything!
One solution that a lot of renderers use is to clamp everything, which is really just a fancy term for giving up. If it randomly comes across a very bright ray from a caustic, “clamp it.” (Or simply ignore it.)
Clamp everything!
At this point, instead of a caustic through a glass object, what we get is a shadow. In some cases this can produce an image that is somewhat believable.
But if you go back and consider that even a pane of glass is technically a caustic, then using this method, we would get an image like this:
Hack 2: Just ignore the glass
Now for the next hack. Since the issue lies in the fact that the ray is bouncing either through or off a specular surface, what if we simply ignore the glass and trace right through it? We can then go back to light sampling and everything will be back to normal.
By ignoring the glass when rendering, we can light architectural interiors without the dark shadows, and the viewer naturally interprets the glass to be there.
Unfortunately, our glass objects will not do so well: This is what happens if we ignore the glass.
Hack 3: Hybrid/fake/architectural glass
Now for the third hack. Here, we’ll let some of the light through, but not all of it, depending on the thickness, angle or color of the glass. This allows a slightly more believable shadow to form:
Here we have something in the middle, commonly known as “hybrid glass,” “fake glass,” or “architectural glass.”
This is what most rendering solutions have been doing for the last 10 years. It’s sometimes called “hybrid glass,” “fake glass,” and sometimes it has a very fancy name: “architectural glass.” However, none of these hacks are actually caustics and, as such, none of them are correct.
What if we just stop hacking and trace from both directions?
Considering how complicated and time-consuming it is to render caustics correctly, traditional hacks — such as “architectural glass” — were a good compromise. Until now.
What if we told you that you can render caustics easily and that this only has a small impact on your render time? Well, that’s what Corona Renderer is doing — and to achieve this effect, the Corona team simply went back to basics.
What we know is that if we trace rays from the camera, it works really well — and in nearly all cases, except for caustic rays. Those rays do much better when traced from the light source. But what if we could combine both forward and reverse rays depending on what sort of ray we need? Note that this is not a new idea — in fact, it has been around since the 90s. It was first mentioned in a paper about bi-directional path tracing from Lafortune and Willems in 1993.
Idea: Use Bi-Directional Path Tracing
One idea is what is called “Bi-Directional Path Tracing” — or BDPT. This solution is fairly fast, but when it comes to caustics it ends up missing too many caustic rays and we end up with a solution where, in many cases, we hardly see the caustic at all.
Using Bi-Directional Path Tracing (or BDPT), we get fast results here, but too few caustics.
VCM combines too many strategies (and is very slow)
Another method, introduced in 2012, is known as “Vertex Connection and Merging,” or VCM. This method combines photon mapping and BDPT. While this method is generally easier and will get you good results, it over-samples too many rays to get a good solution and drastically increases render times.
Using VCM (a combination of photon mapping and BDPT) we can see a lot of over-sampling and way too many rays to make this a good solution.
Using VCM—a combination of photon mapping and BDPT—we can see a lot of over-sampling and way too many rays to make this a good solution.
How do caustics work in Corona?
Corona optimizes caustics by combining reverse path tracing with automated photon mapping. This hybrid approach eliminates the manual setup typically required for photon maps, delivering realistic results with a 50% render time impact compared to traditional, slower VCM methods.
This means we are now able to render with caustics using not too few rays (like with BDPT) or not too many rays (as with VCM). Corona uses just the right amount of rays and gives you the correct result with all the right caustics, with minimal impact on your render times.
This is not to say that this is a simple task for Corona. Behind the scenes, some very complicated things need to be figured out, like: When to consider forward rays and when to consider reverse ones? How do you combine the results of these two methods? Plus much more.
How do I enable caustics in Corona?
Simply toggle the caustics checkbox in the performance settings. While this adds a realistic layer to your scene, expect a render time increase of approximately 50% due to the additional light path calculations required for physical accuracy.
A few other comments regarding caustics in Corona
It should be noted that because Corona is doing a very accurate representation of all light — including its proper caustic contribution — it supports many noteworthy features that are not available in most other rendering packages, including:
- Key feature: Accurate Caustic Motion Blur. Corona ensures that caustics moving relative to the camera are blurred realistically. For instance, a moving car's caustic reflection on the pavement will correctly maintain its relationship with the light source and geometry, a feat many other renderers struggle to achieve. While this seems obvious, you might not realize this but other rendering solutions don’t actually do this correctly.
- One of the big features of Corona is the Light Mix. Since caustics can be initiated from any different light source, they are also split out and can be properly mixed with the Light Mix.
- If you are experimenting with caustics with different rendering engines, then try this: Create a pool with ripples in it; have it next to a wall — such that you would expect caustics should appear on the wall. With Corona, you will see caustics both at the bottom of the pool as well as on the wall.
While this seems logical, it’s not always the case with other rendering solutions. The reason is: It’s actually difficult to see a caustic through a specular element. In the case of the caustic at the bottom of the pool, we are looking at a caustic through refraction.
And now you fully understand how important caustics are and know both why we have been ignoring them for so long, as well as how renderers have been faking it for many years.
You can now test out caustics in Corona to see what you've been missing:
If you're eager to learn more: Listen to CG Garage Episode #237. Corona’s Founding Partner and Main Developer Ondřej Karlik, and R&D Partner Jaroslav Křivánek told me why caustics are so hard to compute. They also discuss the approach they took to make them work, as well as their vision for the future of caustics.
FAQs
When should I turn on Corona’s caustics instead of faking glass/water highlights for an architectural interior or pool scene?
You should enable the caustics solver whenever your scene features prominent glass, water, or curved metal surfaces. It is especially vital for architectural pool shots and product renders where 'faking' light doesn't capture the intricate focus of real-world reflections. Caustics contribute light that is focused and scattered in ways that faked highlights can’t fully reproduce.
How can you get clean caustics without high render times?
- Enable the Caustics Solver in Performance settings.
- Selectively enable 'Generate Caustics' only for relevant light sources.
- Use the 'Receive Caustics' toggle on specific geometry to focus sampling power where it matters most.
What’s the right workflow to animate caustics in motion (moving water, rotating glass objects) and keep motion blur correct?
Use Corona’s caustics solver together with motion blur settings, the solver integrates with motion blur so that caustics are calculated correctly for moving objects in animations. This ensures that caustic illumination is blurred naturally along with the movement of refractive or reflective geometry.
How can I use the Light Mix in Corona to balance caustic contributions from sun, HDRI, and artificial lights after rendering?
Corona’s Light Mix works with the caustics solver, allowing you to adjust light source power and color after rendering without re-rendering. This means you can fine-tune how much each light contributes, including its caustic effect, to the final image in Light Mix.
How do I estimate the time/cost impact of enabling caustics on a deadline, and what settings give the best quality‑to‑time tradeoff?
Enabling the caustics solver increases render calculations, which can impact render time. To keep a good quality-to-time balance, limit which lights generate caustics and which objects receive them so computation is focused only where the effect is needed.