Log inGet started
World

The House Wears a Face

Branchmain
Branchesmain
Commit8e7f3baa4a

README.md

glow

A body of light with no surface: a mote, a moth, a bulb's halo. Surface domain, one fragment function, no lighting terms — it lights itself.

What it draws

The fragment's brightness is dot(normal, view) raised to falloff, so the body is brightest where it faces the camera and falls off toward its own silhouette. That is the difference between a glow and a lit ball: a lit sphere has a highlight somewhere on it and a terminator across it, and reads as an object; this has neither and reads as light.

The same value is the alpha, so the falloff dissolves the silhouette instead of leaving a hard edge where the geometry stops.

Properties

propertywhat it does
glow_colorthe colour, with alpha as an overall opacity
glow_intensityhow hard it is driven, 0–40
falloffhow fast it falls off toward the silhouette, 0.05–12. Higher is a tighter dot; around 1.5 is a soft body.

How to draw it

Additive blend, no depth write, cull none. Depth COMPARE stays less so the body is occluded by geometry in front of it — a mote behind a wall is behind the wall. demo.air.moth is the worked example: 3.2 intensity at falloff 1.4 on a 5.5 cm sphere.

In a near-black room an additive body stacks with every other one behind it, so a hundred of these in a small volume is a white patch rather than a hundred specks. Intensity and count trade against each other; the demo's moths are few and bright, and its dust is many and dim.