WaveGrating

I’m building a standalone renderer for the shifting colors in foil cards, soap bubbles, and butterfly wings.

Shayan Bianconi · Project lead
Research in progress since September 2026

Prismoth ex fan art. Watch the flash cross the wings.

Why the shine moves

The lamps stay still in the opening film. As the card turns, the flash travels from one wing to the other. Tiny grooves in the foil send different colors toward your eye at different angles.

A closer look at the foil

About a thousand of these grooves fit across a millimetre. Aluminium coats the tops, sides, and bottoms. A deeper groove gives the light a taller metal wall to reflect from.

Side profiles at the same scale. One mold has low steps, the other has deep rectangular channels. Both have a thin continuous metal coating.
Two foil profiles from a later study, drawn at the same scale. The dark line is the aluminium coating. See a reference foil under a microscope.

How a groove becomes a color

Light reflects from neighboring grooves in waves. Where their peaks line up, the reflection gets brighter. I calculate how much of each color leaves in each direction and save the answers in a table.

For each frame, the renderer looks up which reflections reach the viewer from the studio lamps. At the edge of a wing, one pixel can cover both foil and white-backed ink. The renderer works out how much light each part contributes. On smooth patches, it can reuse a color it already calculated for that view.

Two frames from the film

The card turns side to side and tips forward and back.

I rendered each position under the same studio lights.

A narrow flash is easy to miss between two angles. When the table’s angles were too far apart at the wing edge in a later test, I calculated those points directly.

The film renderer works with layered cards. Other objects need their own surface models. I tried butterfly scales on a cube and a thin film on a bubble.

Inside the printed card

A glossy card can catch the shape of a lamp as well as the colors of the foil. To follow those two reflections, I built a later version of the card one layer at a time.

Side view from the clear cover down through adhesive, raised ink, selective white, primer, metal foil, its support, and the paper backing.
The moth sits higher than the background. The clear cover curves over the step.
Clear cover
Some light bounces off the cover as glare. Light entering at an angle bends on its way to the ink. Clear adhesive fills the low spots beneath the film.
Printed artwork
The background goes down first. A clear base raises the moth above it. Color ink filters the light. White ink scatters it, leaving openings where the foil can shine through.
Foil and paper
Below the ink, the metal follows the pattern pressed into its support. Its grooves steer the colored reflection. The paper underneath gives the card its thickness.

Light can enter above one part of the wing and meet the foil beneath another. I follow it down through the ink and back out again to find where the highlight appears.

See a cross-section through the wing

Light patterns and shifting colors

Making stripes with light

Where two wave peaks line up, a bright stripe appears. Where a peak meets a trough, the light can fade.

Matching wave peaks add to make light brighter. A peak meeting a trough can cancel to make a dark band.

Move the light, watch the spot

In one simulated camera setup, I moved the light right. The image center moved left.

The source moves two micrometres right. In this test, the image center moves just over four micrometres left.

One HD image in 11 minutes

I started with a patch just 64 pixels wide. A full HD view took 92 minutes on one Ryzen 9 7950X3D core and 11 minutes on an RTX 3090.

Render time for one HD image: 92 minutes on the CPU and 11 on the GPU.

Checking the faster render

I checked the two images pixel by pixel before keeping the faster version. A later change made the same frame 8.51% slower, so I took it out.

Both runs used 485 wavelengths and 970 modes. The colors agreed within the 10⁻¹² test limit. The job allowed four CPU cores and one BLAS thread.

Light on a cube

A bright band wraps around the corner of this aluminium cube.

How a butterfly makes blue

A Morpho butterfly has tiny shelves on its wing scales. Reflections from the shelves strengthen blue light. I tried the same idea on a cube.

Scanning electron micrograph of complete branched ridges with a central trunk and many shelves on either side.
Real wing scale under an electron microscope.

From wing to ridge

Micrograph cropped from Song and colleagues, Figure 1 (right panel), under CC BY 4.0. The model combines a Morpho rhetenor scale type with the ridge shape reported for Morpho sulkowskyi in Siddique and colleagues, Figure 1.

Four renders of the same cube

From bubble to dots

Light bounces off both sides of a soap film. Changes in thickness shift the color. I used those colors to draw the bubble with dots.

A smooth iridescent bubble reflects rectangular studio lights on a dark background.
The original smooth prototype, shown in a new still.

Soap-film color data derived from CIE (2019) color-matching functions, shared under CC BY-SA 4.0.

Color inside a chip

Metal lines on a chip reflect bands of color. I kept the lights fixed and removed the top layer to see what it hid.

Colorful rectangular wiring blocks on a simulated logic die.
Simulated Tiny Tapeout logic chip.

Making a foil card

The sky has bright spokes. The lake has stripes. Could I predict where the shine would move when the card turned?

The entire Spire of Nine Colours card viewed at an angle.
Spire of Nine Colours.

Foil under a microscope

These microscope images show grooves in real nickel foil used for security holograms. I used them as a reference for the simulated card.

Optical panels cropped from Tamulevičius and colleagues, Figure 5. Electron micrograph and height map from Supplementary Figures S8 and S7. Images used under CC BY 4.0.

What the camera sees

For a camera, I calculate how many photons reach a pixel and how many electrons it should collect. Holding the shutter open four times longer gave about four times the signal.

With the modeled sensor and lighting fixed, four times the exposure produced about four times the expected sensor charge.

Giving the card an edge

I made the back thicker and kept the front fixed. Look for the wider gray stripe at the edge.

The two cards share the same front surface. One has a 0.30 mm backing and the other a 0.35 mm backing.

Lining up the print

I used ImageGen for the artwork and masks, then aligned selected printed shapes with the art. A new background fills the area hidden by the moth.

The same leaf appears at the same coordinates in the artwork, its footprint, and its raised surface.

Where the moth meets the background

Follow the line across the artwork. At the edge of the wing, the purple ink steps up. The red line shows how the clear cover bends over it.

The marked line crosses from a leaf onto a moth wing. On the chart, the purple print steps up, the red outer film curves over it, and the buried foil stays below.
A section through the model. Width is in millimetres and height is in micrometres.

Open original image