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
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.
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
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.
- 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 wingLight patterns and shifting colors
Structured light
Iridescence
September–October 2026
Making stripes with light
Where two wave peaks line up, a bright stripe appears. Where a peak meets a trough, the light can fade.
Early optical checks
Move the light, watch the spot
In one simulated camera setup, I moved the light right. The image center moved left.
October 2026
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.
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.
October 2026 · Wing scales
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.

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
October 2026 · Soap film
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.

Soap-film color data derived from CIE (2019) color-matching functions, shared under CC BY-SA 4.0.
November 2026 · Standalone renderer
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?

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.
Giving the card an edge
I made the back thicker and kept the front fixed. Look for the wider gray stripe at the edge.
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.



























