# paperChochin (material)
Hanging paper lantern (chōchin) paper for Lantern Drift's gates and shrine: warm, evenly lit, with horizontal bamboo bands. Over the `paperGlow` shader; per-instance lane 0.y flashes it.
# rockSurface (material)
Dark weathered basalt with moss on top faces and a wet water line, over the `rockSurface` shader. Used by every rock in Lantern Drift.
# LanternDriftGate
A glowing vermilion torii gate the lantern flies through: tapered posts in weathered lacquer (`postL`/`postR` Models on `materials.weatheredLacquer`: faded patches, chips to bare wood, rain streaks, grime at the foot; mesh `Post_dNNN` shared by every gate) with black sleeves, nuki tie beam, centre strut and tablet, upturned kasagi with black cap over the shimaki, a twisted shimenawa rope hung with glowing paper shide, two paper chōchin lanterns with an inked crest (mon), and a warm point light.
Pivot = centre of the opening (4.4 m between posts, 5 m tall: y -2.5..+2.5). Posts run down to y -4.6 and the beam up to +3.4 so in a gap they sink into the rocks. The gate is turned 125° so a lantern flying along +X through the pivot passes squarely between the posts (at x ±1.26, z ∓1.8) while the side camera at -Z sees it in three-quarter view.
Flash it when passed: `require("games.lanternDrift.art.LanternDriftArt").flashGate(gateEntity)` (light flares x6, lanterns blaze, eases back over 0.9 s, golden burst). By hand: `gateLight`'s Light intensity (base 3) and `renderer.instanceData.set(lanternL|lanternR, 0, 0, flash, 0, 0)`.
Inputs: `lightIntensity` (3), `postDepth` (4.6).
# LanternDriftLantern
The paper sky lantern the player flies in Lantern Drift: a 0.84 m rice-paper envelope (generated mesh, `paperGlow` material: golden glow low by the flame, deep orange crown, rib shadows, crinkle), eight bamboo ribs, bamboo ring and wire cross, fuel cake, a flickering two-layer flame, and a warm point light (orange, range 8). Pivot at the lantern's centre.
Spawn / place: `asset.resolve("games.lanternDrift.art.models.LanternDriftLantern", "sceneModule"):instantiate(nil, { name = "Lantern", position = { 1, 1.4, 0 } })` — the main scene already places one named `Lantern`. Move the placement root; the light follows.
Inputs: `lit` (false builds it with no flame/light), `lightIntensity` (6), `lightRange` (8), `scale` (1).
Children by name: `paper` (Model; instance lane 0.x = doused, 0.y = flash), `glow` (flame model; `:setActive(false)` hides it), `lanternLight` (Light). `require("games.lanternDrift.art.LanternDriftArt").douse(lantern)` / `.relight(lantern)` do the whole switch.
# LanternDriftLake
Lantern Drift's world around the course: a Tidewater `lake` (nightStill) spanning x -600..1300, z -220..420 with its surface at y 0; the far wooded shore (z ~66..126) with ~400 pines and clusters of small houses with lit windows and lanterns; and three layers of ridged mountains (z ~150, 225, 320) that recede into the dusk haze. Placed at the origin as `lake` in the main scene. Needs the `@tidewater` library for the water.
Inputs: `seed`, `water`, `villageLights`.
The water is tuned to a calm dusk mirror through the WaterBody `options` (near-flat detail and waves, `mirror` 0.85, `rippleStrength` 0.35) on top of `nightStill`.
# paperGlow (material)
The sky-lantern paper of Lantern Drift over the `paperGlow` shader: golden glow low, deep orange at the crown, 8 rib shadows.
# weatheredLacquer (material)
Weathered vermilion torii lacquer (faded patches, chipped bare wood, rain streaks, grime at the foot) over the `weatheredLacquer` shader. Used by the posts of `LanternDriftGate`; instanced, so every gate's posts are one draw.
# fireflyCluster
The firefly pickup's mesh: a hot core and soft halo sphere for the main firefly and two smaller companions, with uv.y marking each part for the `fireflyGlow` shader (which bobs it and orbits the companions).
# LanternDriftShrine
The Shrine of a Thousand Lanterns, Lantern Drift's goal and win set-piece: a rock island (three `rockSurface` masses), a stone landing with a vermilion torii at the foot of the steps (`stepTorii`, two crested chōchin `stringLantern_torii_*` inside its posts) and 18 steps up to a stone terrace, twelve stone tōrō lit along the steps, a three-tiered pagoda (glowing paper screens, vermilion posts, bracket bands, upturned tiled roofs, gold sōrin finial), rows of paper lanterns under every eave and strung to the terrace, four twisted pines, ~72 paper lanterns floating on the water round it, and warm lights.
Pivot: island centre at the water line; steps face -Z, platform at y 6.2, finial ~22 m. The main scene places it at (640, 0, 14) as `shrine`.
Children by name: `shrineGlow`, `stepsLight` (Lights), `eaveLantern_*`, `stringLantern_*` (paper lantern Models, lane 0.y flash), `swarmOrigin`. `LanternDriftArt.startSwarm()` flares the lanterns and plays the swarm.
Inputs: `seed`, `floatingLanterns` (72). Eave rows: 9 per side on the lowest tier, 7 above.
# fireflyGlow (material)
Yellow-green firefly glow (additive, no depth write) over the `fireflyGlow` shader.
# LanternDriftJetty
The start of Lantern Drift, placed at the origin in world space: a weathered plank jetty (x -6..2.1, deck top y 0.6, 1.6 m wide) on turned posts with wet bases, rope coils; a grassy bank rising behind it with reeds, boulders (`rockSurface`), two twisted pines and a lit stone tōrō (`toroLight`); and the child at the end (x 0.35, facing +X), arms raised to the lantern's start at (1, 1.4, 0), with a face (eyes, brows, blush, mouth), a fringe, side locks, bun and red ribbon, a white crossed collar, gold hem, cream flower motifs, hanging furisode sleeves and sandals — the model `child`, which can be hidden with `:setActive(false)`.
Inputs: `child` (true), `seed`.
# lanternDriftDusk
The whole look of Lantern Drift's lake at dusk, as one scene setup:
- `sky`: `duskSky` — custom dusk gradient sky shader, sun disc low behind the course (+Z).
- `sun`: `duskSun` — warm low directional light travelling toward the side camera (back/rim light).
- `ambient`: `duskAmbient` — cool blue-violet fill.
- `skyLight`: lights and reflects the scene (water reflections) from the drawn sky.
- `fog`: height fog that hugs the water (low mist), warm in-scatter toward the sun.
- `exposure` (manual), `taa`, `bloom` (`duskBloom`), `vignette` (`duskVignette`).
Place it as the scene's `lighting` entity:
`asset.resolve("games.lanternDrift.art.lighting.lanternDriftDusk", "sceneSetup"):instantiate(nil, { name = "lighting" })`.
Tune a placement with its `SceneSetup` component (`fog/density`, `sun/intensity`, `sky/backdrop/exposure`, ...).
# LakeMirror
A true mirror reflection for a flat lake whose water plane is y = 0 (Lantern Drift's lake). In play, each frame it puts a camera at the mirror image of whichever camera is drawing the screen, reflected through the water plane, with the same field of view. That camera renders the scene without the water into a texture at `scale` of the viewport's size. The component then hands the texture to the lake's tidewater `waterSurface` material as `planar_map`, with `planar_strength` 1, so the surface reflects it in place of the screen-space trace.
Put it on any entity in the scene; it needs no sibling components. `waterName` names the WaterBody entity; its whole tree is put on the `water` render layer so the mirror camera skips it. Removing the component sets the strength back to 0, frees the texture and despawns the camera. It does nothing in edit mode.
# Lantern Drift course
The one fixed route from the jetty to the shrine: spires (standing and hanging), gates and fireflies, drawn from a fixed seed with a difficulty ramp. The scene build places the course's props from `Course.get()`; the game uses it for collisions (`Course.hit`) and pickups.
# LanternDriftSpire
A weathered rock spire for Lantern Drift's course and background: a generated, noise-displaced turned rock built of tilted strata layers (each set back or forward, with an overhanging lip and an undercut, so moss gathers on every ledge), quantised chips, vertical cracks and a broken, stepped crown (columnar/twisted/stacked/slender variants); hanging rocks get a jagged blunt tip and moss/vine strands trailing from the upper rim (never below 35% of the height, so the gap stays clear) drawn with `rockSurface` (dark basalt, moss on whatever faces up, wet band at the water line), grass on standing crowns and optionally a twisted pine.
- Standing (`hanging = false`): pivot at the water line, top at y = `height`, rock below the water to y -2.5. Width near the top = `width`.
- Hanging (`hanging = true`): pivot at the blunt bottom tip, widening upward to a broad floating top at `height`. Width near the tip = `width`. Use this for overhangs rather than flipping a standing one.
Inputs: `variant` 1..4, `hanging`, `height`, `width`, `pine` (decor only — a pine would intrude into a course gap), `seed`.
Meshes are shared per variant/kind/2 m height step (`Spire_v<variant>_<stand|hang>_h<NN>.mesh` in this folder), so many placements cost few meshes.
`asset.resolve("games.lanternDrift.art.models.LanternDriftSpire", "sceneModule"):instantiate(nil, { name = "spire_1", position = { 34, 0, 0 }, params = { variant = 1, height = 5.8, width = 3.2 } })`
# Lantern Drift game
The example game built on curtainKit: the one-button glide (hold to rise, let go to sink), scoring (fireflies +10, gates +50 times the chain, a point a metre, +500 at the shrine), the follow camera, and its curtainKit config: the title camera, the opening cutscene, the win and lose endings, the stats and grades. `Curtain.start(require('games.lanternDrift.game').config)`.
# curtainKit.api
The front door: `Curtain.start(config)` gives a short game its whole frame on this machine (title, opening cutscene, ready beat, play, ending, results card with Replay). Also `stop`, `status`, `on`, `replay`, `toTitle`, `startRun`, `setPaused`, `ctx`, `records`, `looks`. See the package README for every config field.