Vector Meldrew

A browser tool

Refraction Lab: free gem refraction and STMap generator

Ray-traced gem cuts over any image

What it does

Refraction Lab places a ray-traced gem over any image you load. You choose the cut, symmetry, angles and material; the tool calculates how light bends through that exact stone and shows the result in real time. The same gem can be exported as an STMap for compositing in Nuke, After Effects or Resolve, or as a web pack for plain JavaScript. What you see in the browser is the refraction you can apply elsewhere.

Exports

As the tool describes them:

  • STMap 16-bit: R = x, G = y (0 at bottom), B = gem mask. Load it in Nuke, After Effects or Resolve to remap any footage through this exact gem.
  • Web pack: one PNG with three stacked panels (coordinates, light and weight) for applying this refraction in plain JavaScript with no WebGL.
  • Render PNG and Light pass, at 1024, 2048 or 4096 px.

How to use it

  1. Load an image, or choose Surprise me.
  2. Select a cut and adjust symmetry, crown, pavilion and table.
  3. Choose a material or set index of refraction, dispersion and fire.
  4. Tune body colour and colour depth until the refraction looks right.
  5. Export an STMap, web pack, or high-resolution PNG of the result.