Cut Gems

Drag to turn · scroll to zoom · shift-drag moves the lamp · hover to trace a ray

Stone

380transmission through 2 mm780 nm

Proportions

Optics

Render

Presets

The address bar carries the current settings.

01 / trapping

A cut gem is a light trap with a deliberate leak

Light slows down inside transparent matter, and the ratio of its speed in vacuum to its speed in the material is the refractive index n. At a boundary between two media the direction changes by an amount Snell fixed in 1621:

n₁ sin θ₁ = n₂ sin θ₂

Run that backwards, from dense to thin, and something abrupt happens. Solving for the outgoing angle requires sin θ₂ = (n₁/n₂) sin θ₁, and once that exceeds 1 there is no solution. No refracted ray exists. Every photon is reflected back inside, perfectly, with no loss at all. The threshold is the critical angle:

θ_c = arcsin(n₂ / n₁) diamond in air: arcsin(1/2.4175) = 24.4°

This is the entire trick of a faceted gem. Diamond's critical angle is unusually small, so light entering through the top strikes the sloping pavilion facets well past 24.4° and cannot escape downward. It bounces, hits a second pavilion facet, and is aimed back up through the crown toward the observer. Glass, with n = 1.52, has a critical angle of 41.1° and a much narrower window in which this works, which is why paste never quite convinces.

Drag the pavilion angle slider below about 39° and watch the stone die. Too shallow and the internal ray meets the pavilion inside the critical angle, refracts straight out of the bottom, and is lost to the setting. The gem goes glassy and you can see through it. Cutters call the result a fish-eye, and avoiding it is what Marcel Tolkowsky was computing by hand in 1919 when he arrived at a pavilion angle of 40.75°, a crown angle of 34.5° and a table 53% of the diameter. The Tolkowsky button restores exactly those numbers.

02 / splitting

Fire is the index disagreeing with itself

Refractive index is not one number. It depends on wavelength, because the electrons in the material respond differently to different driving frequencies, and blue light always bends more than red in a normal transparent solid. Gemmology quantifies this as the difference in index between two Fraunhofer reference lines, B in the red at 686.7 nm and G in the violet at 430.8 nm. For diamond those indices are 2.407 and 2.451, and the difference, 0.044, is its dispersion.

The renderer needs the index at every wavelength, not just two, so it fits a two-term Cauchy formula through the pair:

n(λ) = A + B / λ² B = dispersion / (1/430.8² − 1/686.7²) A = n_D − B / 589.3² n_D measured at the sodium D line

For diamond that gives A = 2.3787 and B = 13464 nm², which reproduces the measured index at 486.1 nm to within 0.0003. A wide facet angle turns that tiny spread into a visible fan, because a ray that bounces several times inside accumulates the angular difference at every boundary. Fire is dispersion multiplied by path complexity, which is why the same material shows more of it in a brilliant cut than in a slab.

More dispersion is not simply better. Moissanite has 0.104, well over twice diamond's, and cubic zirconia around 0.060. Gemmologists describe the result as excessive and slightly artificial, and it is easy to see why on the dispersion slider: past about 2× the spectral flashes get so wide that they stop reading as sparkle and start reading as a smear of colour. The dispersion multiplier here is not physical, it is a knob for seeing what the parameter does.

materialnDdispersionθc
Diamond2.41750.04424.4°
Moissanite2.650.10422.2°
Cubic zirconia2.160.06027.6°
Corundum1.7660.01834.5°
Beryl1.5770.01439.4°
Quartz1.5440.01340.4°
Lead glass1.620.03138.1°
03 / reflecting

How much bounces at each facet

Snell gives the direction of the refracted ray. Fresnel's equations give the fraction of energy that takes it. The reflected fraction depends on the angle and on the polarisation, and since ordinary light is unpolarised the renderer averages the two:

r_s = (n₁cos θ₁ − n₂cos θ₂) / (n₁cos θ₁ + n₂cos θ₂) r_p = (n₂cos θ₁ − n₁cos θ₂) / (n₂cos θ₁ + n₁cos θ₂) R = ½ (r_s² + r_p²)

At normal incidence this collapses to ((n−1)/(n+1))², which for diamond is 17% and for quartz 4.7%. That difference is why a diamond looks wet and hard-edged where quartz looks like a window, and it is a separate effect from the internal trapping. Past the critical angle both r_s and r_p reach magnitude 1 and R becomes exactly 1, so total internal reflection falls out of the same equations rather than being bolted on.

Because the stone is convex, any ray that does escape a facet goes straight to the environment and never returns. That lets the renderer split deterministically at every boundary rather than gambling: at each internal hit it adds the escaping fraction (1 − R) times the environment in the refracted direction, then continues along the reflected path carrying R. No random choices, so no noise from the light transport at all.

04 / colour

Ruby and emerald are the same impurity in different company

Diamond and corundum and beryl are all colourless when pure. Colour comes from trace ions that absorb specific wavelengths, and the surviving light is what you see. The bookkeeping is Beer-Lambert: intensity falls exponentially with the distance travelled, so a long path through the stone is a deeper colour, which is why the same rough cut small looks paler than cut large.

I(λ) = I₀(λ) · exp( −μ(λ) · ℓ )

Ruby is corundum with about one aluminium atom in a thousand replaced by chromium. Cr³⁺ in that site absorbs in two broad bands, near 405–410 nm in the violet and near 560 nm in the green and yellow, leaving red to pass and a narrow secondary window in the blue. That blue leak is why fine ruby has a slight purple cast rather than reading as pure red.

Now put the same Cr³⁺ ion into beryl instead and you get emerald. The chromium is identical; the six oxygens around it sit at a slightly different distance, which shifts the crystal-field splitting, which moves both absorption bands, and the stone comes out green. Two of the most valuable gems on earth are separated by the size of a coordination octahedron.

Sapphire works by a different mechanism entirely. There is no single colouring ion: blue requires an Fe²⁺ and a Ti⁴⁺ sitting on neighbouring aluminium sites, and light drives an electron from one to the other. This intervalence charge transfer produces a broad band centred near 570–580 nm, with further iron bands near 390, 450 and 706 nm, so yellow through red is removed and blue survives. Take away the titanium and leave the iron and the same crystal comes out yellow.

Each material here is modelled as a sum of Gaussian absorption bands at the published band centres, scaled by the colour-depth slider. The transmission curve in the panel is the resulting spectrum through two millimetres.

05 / geometry

A cut is an intersection of half-spaces

Every facet is a flat plane, and the stone is the set of points on the inner side of all of them at once. That is a convex polyhedron in half-space form, and it means the renderer never needs a vertex, an edge, or a triangle. Each facet is one equation:

n̂ · x ≤ d for all facets entry t = max over facets with n̂·d̂ < 0 exit t = min over facets with n̂·d̂ > 0

Intersecting a ray with the whole stone is one pass over the facet list keeping a running maximum and minimum, the same slab test used for bounding boxes, generalised to arbitrary orientations. It is exact, the normals are exact, the edges are perfectly sharp at any zoom, and a facet whose plane never touches the body simply drops out of the hull with no special case.

The facet families are generated from the girdle outline. Each outline is a convex point set, and its support function h(û) = max over boundary points of û·x gives the distance from the axis to the girdle in any horizontal direction. A crown main at azimuth φ and angle α is then the plane with normal (sinα·û, cosα) at offset sinα·h(û) + cosα·(girdle/2), which by construction meets the girdle exactly. Swap the outline for an ellipse and the round brilliant becomes an oval; swap in a lens and it becomes a marquise; the facet code does not change. Step cuts use the same support function with rows of decreasing angle instead of a bezel and halves.

The convexity requirement is real and rules some cuts out. A heart shape has a concave cleft at the top, so its girdle outline is not convex and the slab test would give the wrong answer. Every cut offered here is convex.

06 / rendering

One wavelength at a time

Dispersion cannot be rendered in red, green and blue, because the whole point is that different wavelengths follow different paths. So the renderer is spectral. Each pixel picks a small number of wavelengths per frame, stratified across 380 to 780 nm and jittered, traces each one through its own geometry with its own index, and converts the result to tristimulus values through the CIE 1931 colour matching functions using the analytic fit of Wyman, Sloan and Shirley.

XYZ = (Δλ / K) · Σ L(λᵢ) · [x̄(λᵢ), ȳ(λᵢ), z̄(λᵢ)] / ∫ȳ dλ

The environment is spectral too. Each light is given a colour temperature and evaluated through the Planck radiation law rather than stored as a triple, so the fire has something physically shaped to disperse.

Wavelength sampling is the only stochastic part, and temporal accumulation cleans it up over a few frames. Turn on the light path map to colour each pixel by how many internal bounces the ray survived before leaving: dark blue is one or two, warm colours are five or more. It shows immediately where a badly proportioned stone is leaking.

07 / limits

Where the model is wrong

  • No birefringence. Corundum, beryl, quartz and moissanite are all optically anisotropic, so each ray should split into two with different indices and different polarisations. Everything here is treated as isotropic, using the ordinary ray index. That also removes pleochroism, so a sapphire will not shift between blue and violet-blue as you turn it, which real ones do.
  • Polarisation is averaged, not tracked. Fresnel is evaluated for unpolarised light at every boundary, but after one reflection light is partly polarised and the next boundary should see that. Tracking it would need a Stokes vector per ray.
  • Fluorescence is a hack. Ruby genuinely re-emits absorbed blue and green light as a sharp doublet near 693 nm, which is why fine ruby glows in sunlight. Here it is added as a red term proportional to internal path length rather than computed from the absorbed pump energy, and the emission is not tied to any real quantum yield.
  • No inclusions, no colour zoning, no fluorescence variation. Real stones are inhomogeneous and that inhomogeneity is most of what a gemmologist looks at.
  • The girdle is polished flat rather than bruted. Real girdles are frosted or faceted with many more facets, and the scattering there softens the outline.
  • Only the environment lights the stone. There is no setting, no metal, no finger behind it, and those change a real gem's appearance considerably.
08 / sources

References

  • Marcel Tolkowsky. Diamond Design: A Study of the Reflection and Refraction of Light in a Diamond. E. & F.N. Spon, London, 1919. folds.net/diamond — the original ray-tracing derivation of the 40.75° pavilion and 34.5° crown.
  • Aurélien Sikora et al. A Review of Analytical Methods Used in Geographic Origin Determination of Gemstones. Gems & Gemology 55(4), 2019. gia.edu — Cr³⁺ bands at 405–410 and 560 nm, the 694 nm doublet, and the Fe²⁺–Ti⁴⁺ band near 580 nm.
  • Maurizio Aceto et al. The Use of UV-Visible Diffuse Reflectance Spectrophotometry for a Fast, Preliminary Authentication of Gemstones. Molecules 27(14), 2022. PMC9330567 — measured band positions for sapphire, garnet and others.
  • Chris Wyman, Peter-Pike Sloan, Peter Shirley. Simple Analytic Approximations to the CIE XYZ Color Matching Functions. Journal of Computer Graphics Techniques 2(2), 1–11, 2013. jcgt.org/published/0002/02/01
  • The Gemology Project. Dispersion. Geosciences LibreTexts 7.16 — the B and G Fraunhofer line convention and the diamond values 2.407 and 2.451.
  • Max Born and Emil Wolf. Principles of Optics, 7th ed. Cambridge University Press, 1999. Chapter 1 for the Fresnel coefficients in the form used here.