Rendering techniques applied to caustics
A review of the techniques used to render caustics: texture projections, ray tracing, volumetric lighting, and real-time simulation as opposed to precomputed rendering.
Elliot Négrel-Jerzy, ENSEEIHT - Computer Science Dept.
Abstract
Replicating reality is a goal that we have essentially always been striving to achieve. This obsession with realism started with cave paintings, and has now reached the age of computer-generated imagery, with highly advanced, mathematically-proven methods, one of these being caustics. The existing literature does cover many approaches to this phenomenon, and their perks, including the following, which we intend to discuss here: we’ll explore texture projections, ray-tracing, volumetric lighting, and real-time simulation, opposed to precomputed rendering. Despite the variety of these subjects, this paper’s fundamental aim is to explain in simple words the idea behind these methods, as well as what makes them so effective.
Cost-performance trade-off
The most obvious distinction which comes to mind when talking about rendering objects, is between real-time and precomputed simulations. Both approaches do obviously offer unique advantages which are sought after in specific fields of computer imagery.
Pre-rendering, as expected, is not suitable for videogames, or any kind of interactive medium, since it consists of generating the images/video feed beforehand. This is done very often on a powerful machine, allowing for more complex and detailed simulations, while keeping the rendering speeds pretty low compared to what it would take for an average computer to do the same. Therefore, this technique is mostly used in cinematography and filmmaking, with software such as Blender 3D (open source), Cinema 4D, 3ds Max and many others (Fig. 1).
Fig. 1: Most popular 3D Modelling tools in 2016, sorted by market presence vertically and user satisfaction horizontally (G2, 2016)
In contrast, real-time rendering techniques are extensively becoming the preferred method for 3D imagery (Christen, 2017), due to their speed, which allows for an efficient workflow, and a quick visualisation of the final result. Now, obviously, this speed doesn’t come without a cost: accuracy is considered low priority, hence algorithms which require heavy computations will often be replaced with visually similar, although physically incorrect alternatives.
However, it is important to note that nowadays, the frontier between these two categories is becoming thinner with the constant increase in computing power, and the new algorithms made available on the market (cf. Unreal Engine 5 – Lumen Global Illumination and Reflections). On the same note, software usually used in pre-computed rendering can be applied to virtual reality, and other forms of interactive 3D visualization in some very specific hardware configurations (Interactive rendering with blender cycles for virtual reality using hpc clusters, 2019), such as the one described below (Fig. 2). Here, the computing power is fully relocated to a high-performance computing data centre, which can handle the rendering of 60 images in one second. This cloud-computing infrastructure receives lightweight network packets containing user input data, and sends back compressed images back to the user’s interface.
Fig. 2: Cloud-computing infrastructure, featuring an HPC distributed rendering Cluster (Interactive rendering with blender cycles for virtual reality using hpc clusters, 2019)
Caustic Rendering
Now that we have properly defined the technical solutions used in the field of computer-generated imagery, we can finally explore in detail what Caustics are, and how most render engines approach them.
Caustic networks are shapes of concentrated light projected onto a surface, which are created when rays of light pass through a curved object made of a transparent material. A common occurrence of these optic artefacts is a glass of water exposed to a powerful light source (Fig. 3). Again, various methods are available. The most naïve approach uses ray-tracing (Wyman, et al., 2004) to calculate the colour of each pixel of the image. To keep things simple, it can be summarized in the following manner: the computer casts a ray from each pixel of the camera, which intersects both the pixel of the near plane¹ (see Fig. 4) and the eye point (centre of the projection). This ray then bounces off the faces of the objects it encounters, or gets through them, following the basic principles of refraction and reflection angles; throughout this process, it gains or loses energy, as the surfaces it hits absorb part of it. The ray will keep on bouncing until a maximum number of iterations (set by the user) is reached. If by then it has not collided with a light source, the pixel will be black, or else it will inherit the light source’s colour (this is a clear oversimplification of the process, if you want to know more about it, please check the bibliography (Arvo, 1986)).
¹ The near plane, or near clipping plane lies perpendicular to the camera direction. The distance from the camera (eye point) to the near plane is the closest distance that any object can be to the camera while still remaining in the view.
Fig. 3: Caustics created by a glass of water (cgiknowledge, 2013)
Fig. 4: Common representation of a virtual camera in 3D rendering (Moccozet, 2008)
This approach is efficient, but as you might have guessed by now, extremely costly and slow. Hence, the preferred technique in the video game and virtual/augmented reality industry, attempts to replace most of these heavy calculations with pre-computed models (Zeltner, et al., 2020), at the expense of accuracy. This sacrifice is however absolutely legitimate, since as long as the player does not physically interact with the shape of the object through which light shines, there is no reason for the game to recompute the aforementioned model in real-time.
A common example (Dual Heights Software AB, 2021) of its use is water: pre-calculated caustics textures are projected onto the ocean/pool floor (Fig. 5) and distorted to create the illusion of movement, while the water surface itself is displaced according to an independent noise texture. The lack of consistency between cause (distortion of the water surface) and effect (resulting caustic network) remains unnoticed as long as the waves are low in height and uniform.
Fig. 5: Caustic network textures projected onto various shapes in Unity 3D (Dual Heights Software AB, 2021)
More complex situations, such as moving glass surfaces or dynamic bodies of water, require more advanced models (Villani, 2009), which allow the algorithm to avoid using actual ray-tracing, and still get significantly convincing results.
Conclusion
With the increasing presence of virtual and augmented reality in our lives on a daily basis, computer graphics have become a major part of our lives, and before we know it, we might as well end up spending more time in simulated environments than in our actual world. Thus, the breakthroughs made in the field of lighting, and more specifically caustics are more than necessary, they are vital to our mental health in the long run. Despite the fact that at this point, we still need to use smart tricks (Xiao, et al., 2020) to get away with the extensive complexity and cost of our algorithms, it is safe to assume that, in a couple years, we’ll have sorted these issues out, either by improving our hardware or by creating new, more efficient software solutions.
References
- Arvo, James. 1986. Backward Ray Tracing. Developments in Ray Tracing, SIGGRAPH '86 Course Notes. Chelmsford : s.n., 1986, Vol. 12.
- cgiknowledge. 2013. caustics_glass_image. cgiknowledge.files.wordpress.com. [Online] 2013. https://cgiknowledge.files.wordpress.com/2013/01/caustics_glass_image.jpg.
- Christen, Jonas. 2017. Reconstructing Vindonissa as a living document - A case-study of digital reconstruction for output to pre-rendered and real-time applications. Zurich : Zurich University of the Arts, 2017.
- Dual Heights Software AB. 2021. caustics-water-texturing-using-unity3d. www.dualheights.se. [Online] 2021. https://www.dualheights.se/caustics/caustics-water-texturing-using-unity3d.shtml.
- G2. 2016. g2.com. [Online] 2016. https://www.g2.com/categories/3d-modeling.
- Interactive rendering with blender cycles for virtual reality using high performance computing clusters. Jaros, Milan, et al. 2019. s.l. : aip.scitation.org, 2019. AIP Conference Proceedings 2116, 320005. p. 2.
- Moccozet, Laurent. 2008. Camera-perspective-To-illustrate-the-camera-frustum-manipulation. www.researchgate.net. [Online] July 2008. https://www.researchgate.net/profile/Laurent-Moccozet/publication/216127594/figure/fig5/AS:651866769735680@1532428557051/Camera-perspective-To-illustrate-the-camera-frustum-manipulation-we-create-two-separated.png.
- Villani, Cedric. 2009. Optimal Transport - Old and New. s.l. : Springer, Berlin, Heidelberg, 2009.
- Wyman, Chris, Hansen, Charles and Shirley, Peter. 2004. Interactive Caustics Using Local Precomputed Irradiance. Salt Lake City, Utah, USA : School of Computing, The University of Utah, 2004.
- Xiao, Lei, et al. 2020. Neural supersampling for real-time rendering. s.l. : Facebook Reality Labs, 2020.
- Zeltner, Tizian, Georgiev, Iliyan and Jakob, Wenzel. 2020. Specular Manifold Sampling for Rendering High-Frequency Caustics and Glints. 2020.
© 2022 Elliot Négrel-Jerzy. All rights reserved. Please do not reproduce this article without permission; short quotations with attribution are welcome.