What is Crystal Cave WebGL
Crystal Cave WebGL is an interactive simulation that uses WebGL to render crystal structures. It employs Signed Distance Function (SDF) raymarching, a technique for generating detailed and smooth 3D shapes without the need for complex geometry.
The simulation also incorporates spectral dispersion, which splits light into its component colors, creating vibrant and realistic visual effects.
Raymarching and SDF
Raymarching is a rendering technique that traces rays through the scene to determine what objects they intersect with. In Crystal Cave WebGL, this process is used to render complex crystal structures by calculating distances from points in space to surfaces defined by SDFs.
SDF stands for Signed Distance Function, which defines the distance of any point in space to a surface. By using these functions, the simulation can create smooth and continuous shapes without the need for polygonal meshes.
Lighting Effects
Crystal Cave WebGL features various lighting effects that enhance the visual appeal of the crystal structures. These include cool light modes (blue, cyan, violet), warm light modes (amber, rose, gold), and a rainbow mode where hues cycle through the spectrum.
The use of these different light modes not only adds to the aesthetic but also helps in understanding how light interacts with surfaces at different wavelengths.
Fresnel Edge Glow
One of the key features of Crystal Cave WebGL is the Fresnel edge glow effect, which simulates the way light behaves when it hits a surface. This effect creates a soft, glowing border around objects, making them appear more lifelike and three-dimensional.
This technique is particularly effective in highlighting the intricate details of crystal structures, giving viewers a sense of depth and realism.
Frequently asked questions
What is SDF raymarching?
SDF raymarching is a rendering technique that uses Signed Distance Functions to trace rays through space and determine the closest surface intersection. This method allows for smooth and continuous shapes without the need for complex geometry.
How does spectral dispersion work in Crystal Cave WebGL?
Spectral dispersion splits light into its component colors, creating a rainbow effect that enhances the visual appeal of the crystal structures. This technique simulates how light interacts with surfaces at different wavelengths.
Why are there different light modes in the simulation?
Different light modes allow for varied and dynamic lighting effects, enhancing the visual experience and highlighting various aspects of the crystal structures. They also help in understanding how light behaves under different conditions.
What is Fresnel edge glow?
Fresnel edge glow simulates the way light interacts with surfaces at glancing angles, creating a soft, glowing border around objects. This effect enhances the realism and three-dimensional appearance of the crystal structures in the simulation.
Try it live
Everything above runs in your browser — open Crystal Cave WebGL and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Crystal Cave WebGL simulation