🔮

Optics & Light

From Rayleigh scattering and rainbow arcs to ray-traced reflections and GLSL shader tricks — explore how light bends, scatters and glows in real time.

8+ simulations Three.js · GLSL Ray Tracing · SDF · Fresnel

Optics Simulations

Click any card to open the simulation live in your browser

🔴
★☆☆ Beginner New
Laser Labyrinth — Reflection & Refraction
Bounce a laser beam off mirrors and through glass to hit the target. Explore the law of reflection, Snell's law, and total internal reflection. Drag mirrors, rotate with scroll, build your own optics puzzles.
Ray Tracing Snell's Law Canvas 2D
🌈
Popular ★★☆ Moderate
Atmospheric Optics
Rayleigh scattering drives the blue sky. Watch it shift to red at sunset. Includes a 22° ice-crystal halo and ray-tracing through a single water droplet to produce a rainbow arc.
Rayleigh Ray Tracing Canvas 2D
🌦️
★☆☆ Easy
Rainbow Formation
Snell's law, internal reflection and wavelength-dependent dispersion inside a spherical water droplet. Reveals why your primary and secondary rainbows sit at 42° and 51°.
Snell's Law Dispersion Wave Optics
💠
★☆☆ Easy
Kaleidoscope
Mirror reflections with n-fold symmetry, generated in a WebGL fragment shader. Change the segment count and shape in real time via sliders.
GLSL Symmetry Fragment Shader
🌀
★★☆ Moderate
Fractal Explorer
Mandelbrot and Julia sets rendered with distance estimation colouring and smooth iteration count. Infinite zoom via a GLSL fragment shader — no CPU involvement once loaded.
GLSL Mandelbrot Distance Estimation
❄️
★★☆ Moderate
Snowflake Crystal Growth
Reiter's diffusion-limited model grows a six-fold symmetric crystal in the browser. Adjust humidity and temperature to switch between plate, dendrite and needle morphologies.
Diffusion Symmetry Canvas 2D
🔺
★☆☆ Easy
Sierpiński Triangle
IFS iterated function system and chaos game generating the Sierpiński fractal. Hausdorff dimension ≈ 1.585 — explore why fractals have non-integer dimension.
IFS Fractal Chaos Game
🪞
★☆☆ Beginner
Mirror Maze
Ray tracing in 2D: place plane mirrors and watch light beams reflect via Snell's law. Build kaleidoscopic patterns or focus rays to a point — geometry-only, no shaders needed.
Ray Tracing Snell's Law Canvas 2D
🎨
★☆☆ Beginner
Color Mixing
Interactive additive (RGB light) and subtractive (CMY pigment) color mixing. Drag spotlights to overlap; see how mixing primaries produces white or brown — the physics of paint vs light.
RGB CMY Canvas 2D
🌑
★☆☆ Beginner
Light & Shadows
Point and area light sources cast umbra and penumbra. Drag objects to see shadow sharpness change with light size — demonstrates why the Sun casts harder shadows than an overcast sky.
Umbra Penumbra Canvas 2D
🔍
★★☆ Moderate
Mirrors & Lenses
Interactive geometric optics ray tracer. Choose converging or diverging lenses and mirrors, adjust focal length, and watch three principal rays form real or virtual images.
Geometric Optics Thin Lens Canvas 2D
〰️
★★☆ Moderate New
Diffraction & Interference
Huygens-principle wave field for single slit, Young's double slit and diffraction grating. Fraunhofer intensity curve overlay. Adjust wavelength, slit width, separation and grating line count.
Huygens Fraunhofer Canvas 2D
🔬
★★☆ Moderate New
Snell's Law — Refraction & TIR
Set the angle of incidence and refractive indices n₁, n₂ — watch the refracted ray bend by Snell's law n₁sinθ₁ = n₂sinθ₂. Increase θ₁ past the critical angle to trigger total internal reflection (the principle behind optical fibre).
Snell's Law Refraction Fiber Optics Canvas 2D
💎
★☆☆ Beginner New
Total Internal Reflection
Drag to set the angle of incidence. Watch refracted and reflected rays obey Snell's law — then exceed the critical angle and see TIR lock in. Fresnel reflectance (Rs, Rp) and fibre optic demo.
TIR Fresnel Canvas 2D
🌅
★★☆ Moderate New
Water Caustics
Sunlight refracts through a wavy water surface (Snell's law, n=1.333) and focuses into shimmering caustic patterns on the pool floor. Adjust wave amplitude, frequency, depth and sources.
Snell's Law Caustics Refraction Canvas 2D
🔮
★★☆ Moderate New
Light Polarization
Explore Malus's Law, Brewster's angle, five polarization wave types, and birefringence with a wave plate. Fresnel Rs/Rp equations computed live.
Malus's Law Brewster Birefringence Canvas 2D

Key Optical Phenomena

Physics behind the simulations

🔵
Rayleigh Scattering
Intensity ∝ λ⁻⁴ — shorter wavelengths (blue) scatter more. Explains the blue sky and red sunsets.
↩️
Snell's Law
n₁ sin θ₁ = n₂ sin θ₂. Governs refraction at every interface — from lenses to raindrops.
🪞
Fresnel Reflectance
Reflection probability depends on the angle of incidence. At grazing angles almost all light reflects — seen on water surfaces.
🌊
Wave Interference
Constructive and destructive superposition of coherent waves. Produces iridescence, soap-bubble colours and diffraction patterns.

Learning Resources

Articles and tutorials about the algorithms in this category

About Optics & Light Simulations

Ray tracing, diffraction, interference, and atmospheric optics — visualised

Optics simulations model how light behaves as both a wave and a ray. Ray-tracing engines trace thousands of photon paths through lens systems, computing refraction with Snell's law and reflection with Fresnel coefficients. The double-slit wave simulation shows how coherent monochromatic waves produce interference fringes, and how adding more slits sharpens the pattern toward a diffraction grating spectrum.

Atmospheric optics simulations reproduce rainbows by ray-tracing sunlight through spherical water droplets and computing the angular distribution of wavelength-dependent refraction. Rayleigh scattering explains the blue sky and red sunset from first principles. These visualisations cover the same ground as university-level physical optics and geometric optics courses, making abstract wave phenomena directly observable and manipulable.

Each simulation in this category is built with accuracy and interactivity in mind. The underlying mathematical models are the same ones used in academic research and professional engineering — just made accessible through a web browser. Changing parameters in real time and observing the results is one of the most effective ways to build intuition for complex scientific and engineering concepts.

Key Concepts

Topics and algorithms you'll explore in this category

Interactive ModelReal-time browser simulation with live parameter controls
WebGL / Canvas 2DHardware-accelerated rendering in the browser
Mathematical FoundationDifferential equations and numerical integration
Open SourceMIT-licensed code — inspect, fork, and learn
No Install RequiredRuns directly in Chrome, Firefox, Safari, Edge
Educational FocusBuilt to explain the underlying science clearly

🔭 Test Your Optics Knowledge

Five quick questions to check your understanding of light and optics

Optics Quiz

Frequently Asked Questions

Common questions about this simulation category

Do these simulations require installation?
No. Every simulation runs entirely in your web browser using WebGL and Canvas 2D. Nothing to install or download — open the page and the simulation starts immediately.
Can I use these simulations for teaching?
Yes — all simulations are designed to be educational and run without an account or login. They are widely used in university lectures, high-school science classes, and self-directed learning. Embed them via iframe or link directly.
What devices do the simulations support?
All simulations work on desktop browsers (Chrome, Firefox, Edge, Safari). Many work on mobile and tablets too, though some physics-heavy simulations benefit from the GPU performance of a desktop or laptop.

Explore Other Categories