Vector objects

Version 11 of 11

Glass crystal.

GPU · raymarched · today

This version

The glenz idea done physically: a raymarched crystal that reflects with Fresnel and refracts in and out of its far side.

How this version works

A GPU fragment shader runs at a configured render scale of 0.75 and raymarches a rotating shape formed by intersecting an octahedral field with a box field. Up to 80 steps locate the front surface, whose normal is estimated with neighbouring field samples. The shader adds a reflected procedural sky weighted by an angle-dependent Fresnel approximation, then refracts a ray into the crystal using a refractive index of 1.45. Up to 40 interior steps find the far surface, where the ray refracts out or falls back to reflection. The transmitted sky is tinted blue and attenuated by interior travel distance before a final power adjustment.

The trick in this version

The object needs no polygon mesh or texture map: each fragment evaluates the shape and sky procedurally. This is a single entry-and-exit approximation rather than full glass light transport, with no recursive internal reflections.

Historical context · GPU

  1. today · WebGL Fundamentals

    Shaders do the spans

    Vertex shaders transform the mesh, interpolated UVs feed texture sampling, the work of the old software span renderers, done in hardware.

Platform
GPU · raymarched
Era
GPU
Rendered on
GPU
Tags
refraction · Fresnel
Sources
Shaders do the spans (today)