What does a laser do when the page is made of glass?
In this piece
- The first laser pointed into the screen
- A beam in the plane of the glass meets the panes at their edges
- Violet bends most, because the glass's index depends on colour
- Every surface throws off a weaker second beam
- Inside a pane, the beam is held and guided
- Why green carries further
- The spots are dazzling but light little around them
- Colour, output, width and reach are settings
- Brightness follows the square root of power, as the eye does
- Dust flickers in the beam in air, never inside the glass
- The white laser and the prism exist, but I have not recorded them
The laser on this site runs across the page in the plane of the glass, so it meets each pane at its edges, and what happens to it there is what happens to light at a glass surface: it bends by colour, reflects, is trapped inside the pane and fades with distance.
The first laser pointed into the screen
On 30 September the first version went in as a preview: red 650 nm, green 532 nm or violet 405 nm, picked by a switch in the page address. It was a bright spot a couple of pixels across, held close to the glass, with the fine grain a coherent beam makes on anything it strikes. Because it was a light in the scene, the glass answered it the way it answers the lamp.
That made it a dot, where a laser is seen as a line. The same day I turned it so that its beam runs across the page, at the glass's depth, instead of into the screen.
A beam in the plane of the glass meets the panes at their edges
The panes on this site are slabs lying in the page. A beam that travels at their depth does not meet their fronts. It meets their edges, the thin side faces. So the laser became a two-dimensional ray trace over the outlines of the panes (rounded rectangles), following the beam's path one straight segment at a time.
The tracer has no randomness: the same panes and the same aim always give the same beam, and it is tested against textbook cases. The sections below follow the order in which the beam meets each effect.
Violet bends most, because the glass's index depends on colour
Snell's law says a ray turns at a surface by an amount set by the glass's refractive index. The index is not one number. It depends on the colour of the light, which is why a prism makes a rainbow.
The panes are soda-lime float glass, index 1.518 and an Abbe number of about 60, a standard measure of how much a glass spreads colours. From those two numbers the code fits a Cauchy curve, a standard formula for how the index changes with wavelength, and reads off the index at the laser's own wavelength.
The result for the six single-colour lasers is below. Red at 650 nm sees 1.5156. Violet at 405 nm sees 1.5325. Over a short edge the difference is tiny; it is what lets a prism pull a white beam apart.
Every surface throws off a weaker second beam
Glass never transmits everything. At each surface the exact Fresnel equations (the standard formulas for how much light a surface reflects), averaged over the two polarisations, decide how much is reflected: about 4.2% looking straight on, more as the angle gets shallow. So every surface the beam crosses throws off a second, fainter beam, and the tracer follows both. A single pointer across a few panes becomes a small tree of beams.
The tracer keeps going until a branch holds less than 0.6% of the laser's energy or has met 48 surfaces.
Inside a pane, the beam is held and guided
Past a critical angle, light inside glass cannot leave. For this glass the angle is 41.2 degrees (the project's catalogue of lights lists it). A beam meeting an edge from inside more steeply than that is reflected back whole, which is total internal reflection, the same effect that carries light along an optical fibre. So a pane guides the beam along itself.
A beam that meets a pane's left or right end square-on would simply leave. On 1 October I decided it should bounce off the inside of those ends instead. The setting is Laser bounces off the panes' ends, on by default. With the ends mirrored, as a light guide's ends are silvered, the beam bounces back along the glass. The clip at the top is that, with the aim sweeping.
Why green carries further
Float glass is faintly green because of iron in the sand. The panes' side faces carry three absorption numbers, 2.7 for red, 0.9 for green and 1.2 for blue, and the beam loses energy along its path inside the glass by Beer-Lambert's law, exponentially with distance. Red goes fastest.
The code weights those three numbers by the laser's own colour. The picture is a model, with one assumption: the code takes one unit of absorption path to be 1000 px, because the absorption was measured looking along the side of a pane about that long. So the percentages below are for 1000 px inside the glass, and say how the colours compare, not what a real pane would do.
The spots are dazzling but light little around them
Where the beam strikes a surface, the spot glows, brighter for a stronger hit. The two brightest spots are also lights in the scene, so the glass next to them catches them on its rims. They are weak on purpose: the code comment notes a pointer's whole output is a few milliwatts, about a thousandth of the lamp, so a spot is dazzling to look at but lights little around it. Each spot's strength is set at 5% of the lamp.
Colour, output, width and reach are settings
Once the physics was in, I wanted to be able to change what kind of laser it is: its colour, its output and its beam size. The settings are the colour (650, 635, 589, 532, 450, 405 nm, and white), the output in milliwatts, from 1 to 500, and the width, from 0.5 to 8 px. The beam also reaches further, through Laser reach: 9,000 px of path by default, up to 30,000, and so more bounces before the beam is let go.
I also wanted the flicker you see along a real laser as particles drift through it, with none of it inside the glass. That became the dust, below. The same day the laser joined the tool picker beside the lamp, black light, flare, flashlight and magnifier. The settings were decided on 1 October and went in on 4 October.
Brightness follows the square root of power, as the eye does
Width is how wide the beam is drawn; its glow is four times as wide in air and 7.5 times as wide in glass. Output is more subtle. The eye does not see twice the power as twice the brightness: its response is roughly a square root. So the beam's drawn brightness follows the square root of the power measured against the 5 mW pointer it was tuned on.
At 500 mW that is ten times the 5 mW brightness; at 1 mW, about 0.45 of it. The light a spot throws on the glass around it follows the power itself.
Dust flickers in the beam in air, never inside the glass
Specks drift across the beam in air, each lit only while it is inside the beam, so it flares and is gone. A few are bigger and flare brighter. The count scales with the beam's length and the Dust knob (0.5 by default), and there are none inside the glass. This is the flicker decided on 1 October.
On 8 October, during work on the rain, the beam met the specks of water on the glass too: a droplet narrower than the laser takes only its own width's share of the beam.
The white laser and the prism exist, but I have not recorded them
A white laser is seven wavelengths, 410 to 650 nm, each traced with its own index. Through a glass prism the white beam goes in and comes out as a spectrum. On 30 September I built that, with the prism as a triangle in the beam tracer and a test that its least deviation (the smallest angle the prism can turn a ray through) matches the textbook formula for an equilateral prism.
There is no clip of it here. The prism is only on the Lab samples page, which is for the admin only. The clips above were recorded on the portfolio page, where the laser is in hand and white is a colour on the list. I have not recorded the prism.
A second laser also exists in the code, one that skims the glass's face through the drops. This piece covers only the in-plane one.
Sources and notes (9)
- List of physical properties of glass (Wikipedia) — soda-lime index 1.518 and Abbe number about 60
- Snell's law (Wikipedia) — bending at the pane's edge
- Fresnel equations (Wikipedia) — the weaker reflection off every surface
- Total internal reflection (Wikipedia) — the beam held inside the pane past the critical angle
- Beer-Lambert law (Wikipedia) — energy lost along the path inside the glass
- Light catalogue — the notes this was written from
- Beam tracer — the notes this was written from
- Dispersion — the notes this was written from
- Laser knobs — the notes this was written from
Light & shadowAll 19 parts →
