Halloween effects lit by the scene’s own lights
A burning torch whose flame is also a light, and a spider web whose threads glint only where a light catches them, both exist as first cuts. A blood version of the rain is planned and not built.
In this piece
- The torch: a flame that is also a lamp
- A torch is about a fifth of a bulb, so the room goes dark
- The web: measured, then solved thread by thread
- A thread glints only where it faces the light
- The torch lights the web without the web knowing it exists
- The blood rain is planned and not built
- What is still unknown about blood on glass
Three of the effects on the list belong to Halloween: a burning torch, a garden spider’s web, and blood running down the glass. The first two exist as first cuts behind preview switches. The third is planned and not built.
They follow the rule the site started with: a light is a thing in the scene. The torch is a light. The web has no light of its own and shows whatever the lights give it.
The torch: a flame that is also a lamp
I wanted a torch whose flame is a light with realistic flicker, usable as a cursor. The research note is dated 1 October, and its first finding is that flicker is not random. A flame puffs at a rate set by the size of what burns, about 1.5 divided by the square root of the diameter in metres.
For a torch head about 5 cm across that is 6.7 Hz. The note computes 9.5 Hz for the 2.5 cm road flare that was already in the site, and 2.4 Hz for a 40 cm campfire.
Almost no energy lies above 10 to 20 Hz, so on top of the puff the code adds slow wander at 0.3, 0.7, 1.5 and 3 Hz, and now and then a gutter. The amplitudes of all of that are estimates, because nobody has measured a torch’s. The tests check the parts that can be checked: the strongest line must sit within 10% of 6.7 Hz, and under 1% of the power may lie above 20 Hz.
A torch is about a fifth of a bulb, so the room goes dark
How bright is it? A juniper torch measured in a published study came out at 14 candela. A 60 W bulb shining evenly is about 64, so the note computes a torch at roughly 0.22 of a bulb. That is why, while the torch burns, the code sets the room’s fill light down to 0.12: a torch only reads as a light in the dark.
The flame is coloured as a 1900 K blackbody (the colour an ideal hot object glows at that temperature), then white-balanced as a camera set to 3000 K would record it, which gives a deep orange.
The flame you see is drawn procedurally, and its length follows its brightness. The flame on the page and the light on the page come from the same flicker signal, so they move together. Waving the torch makes it burn brighter, up to 40% more, the way fanning a fire does.
The web: measured, then solved thread by thread
The webs were to glisten in light, sway when the cursor passes, and tear when pulled. The research note starts from measurements of 194 laboratory webs of the garden spider: about 33 radial threads in total, with the hub sitting 0.44 of the way down from the top, and radials longer below the hub than above it. The generator uses 24 radials and 18 turns of spiral by default, and a test checks the hub position and that there are more radials below it than above.
The physics was meant to be the soft bodies of Rapier, a physics engine. A quick trial failed: pinned particles fell freely, even with 433 particles and 864 edges. So the web is solved with XPBD, a constraint solver, thread by thread, with threads that only pull and never push.
Radials are 100 times stiffer than the capture spiral, where real silk is about 3,000 times. The note says why: at the real ratio the spiral would not look taut on screen. A radial breaks at 27% strain and a spiral thread not until 270%. A flick faster than 2,500 pixels a second cuts the threads it crosses, and a test confirms it.
The room’s air moves it at a breeze of 45 px a second, and the pointer leaves a wake about 120 px wide. Those two numbers are marked estimates in the code.
A thread glints only where it faces the light
The silk itself is drawn almost invisibly, at 7% opacity. What you see are glints, and a glint has a rule. A smooth fibre reflects light into a cone around its own axis. So a thread shows a highlight only where its direction T satisfies T · (L + V) = 0, where L points toward the light and V toward the eye.
The code runs that test on every 6 px piece of every thread, for every light in the scene, with a tolerance of 0.08 radians.
That gives the real behaviour of a lit orb web: the threads do not glow evenly. An arc of them lights up, curving round the hub, and the arc is a different set of threads for each position of the light.
The torch lights the web without the web knowing it exists
The web does not know the torch exists. It asks for the list of point lights, and a burning torch is on that list. So when you carry the torch across the corner of the page, the arc of lit threads slides with it, and the colour of the glint is the torch’s own, orange.
The strength of each glint includes the light’s gain, and the torch’s gain includes its flicker. So the glints should breathe at the flame’s rate. I have read that in the code. I have not measured it.
What is still not done on the web, per the note’s own status: dew drops, corner cobwebs, iridescence and the lab controls. On the torch: smoke, sparks, the candle and campfire presets in the lab, and a side-by-side against a free flame flipbook to see which looks more real.
The blood rain is planned and not built
The blood version of the rain is something I plan to make. It is not built. What follows is what the repository says it would start from.
What already exists. Blood is already a liquid in the drop simulation. The code defines three liquids, water, blood and slime, and the spray bottle (a first cut behind a preview switch) can already spray blood onto the glass. The table below is drawn from those values. The water shader already lets blood absorb light by the Beer–Lambert law (light fading exponentially with depth), using the haemoglobin spectrum.
What would stay. The drop simulation itself: drops landing, growing, merging, running when heavy enough, the lens, the lamp and the shadows. Each drop already carries a liquid.
What would change. The rain’s own drops are all created as water, and the drizzle too, so the spawning would have to choose blood. After that, the liquid’s numbers do the work. Blood is 4.8 times as viscous, so the research computes it running about 0.8 cm/s where water does 4 cm/s, and a test checks that it runs three to five times slower.
It pins harder, with contact angles (how steeply a drop’s edge meets the glass) that the code estimates at 45° and 15°. It leaves a thicker, more continuous film. And it splashes earlier: a published measurement has blood splashing at 3.47 m/s on every surface tried, where 1 mm water drops did not splash up to 4.7 m/s.
Its light changes most. Through a drop 1 mm thick, blood keeps about 61% of the red and next to nothing of the green or blue, with the code’s values. So the shadow and the bright patch behind a blood drop are deep red, from the same absorption term, at no extra cost.
What is still unknown about blood on glass
What would have to be researched. The research note lists these as unknown. The contact angle of blood on glass is an estimate; the papers with the real value could not be read. Bloodstain studies used horizontal surfaces, so how a tail and a ring look on a vertical window is unknown.
The note found no free photograph of blood on a vertical window with a scene behind it, so there is nothing yet to compare against, and the plan for that is to take one. Drying is design only: the note describes a gelled rim, then cracks, then a matte stain, and the status says drying is still to do. Whether blood should brown over time is an open question for me, not a decision.
One more dependency. The note on fixing the rain’s lens lists “no dye” among the corrections for water, and blood is deliberately a dye, through the same absorption term. The fog and film maps were built for water, and whether they should carry blood is not decided.
A small Halloween detail from the black-light notes: blood does not fluoresce, so under the black light it reads dark.
Light & shadowAll 19 parts →
