Sunfall Ridge
README.md
ThermalMarker
Draws the signs a pilot spots a thermal by, and nothing else: large raptors (griffon vultures / eagles, 3.2 m span) circling in its core, and a dust devil swirling up off the ground under it. It applies no lift and no wind; the Thermal (or any other lift) component does that beside it.
Put it on an entity standing at the thermal's axis: the entity's x and z are the axis, its y is roughly the ground. At start it finds the ground under the axis (the ridge entity's Terrain:heightAt, else a physics ray down, else the entity's own y) and stands the dust there. It needs no sibling component.
Fields
| Field | Default | Meaning |
|---|---|---|
radius | 60 | Metres of lifting air round the axis; each bird circles at 25-75% of it. |
top | 1400 | World height the thermal ends at; birds circle in bands between 60 m above the ground and this. |
birds | 7 | How many raptors circle in it (0 for none). |
strength | 5 | Lift in m/s: how fast the birds climb and how fast and thick the dust spins and rises. |
seed | 1 | Which flock and which dust devil (paths, phases, wander, turn direction). |
dust | true | Draw the dust devil. |
All fields are Sync; changing one rebuilds the marker. groundHeight() answers the ground found under the axis and birdPositions() the birds' world positions this frame.
What it draws
- Birds: one instanced draw of the shared raptor mesh (
sunfall.markers.raptorFlock, about 2.8k triangles, built once per session and shared by every marker) with theraptorshader, which poses each copy in its vertex hook from four lanes this component writes: shoulder and wrist angles (a shallow V, slow occasional flap bursts), primary-feather spread, tail spread, hand sweep and tip curl. Each bird flies its own circle (radius 25-75% ofradius, 10-14 m/s, about 30% turning the other way), banked 20-35 degrees into the turn, climbing in its own height band; at the top of its band it glides out in a wide arc, faster, wings flexed, and comes back into the core lower. Birds farther than 900 m from the on-screen camera keep moving but stop animating their wings. - Dust: a second instanced draw, about 790 stateless GPU particles on one shared card mesh (
sunfall.markers.raptorFlock.dustCard) with thedust_puffshader. Its vertex hook works out every particle from the clock and lanes written once at build, so the dust costs no CPU per frame and writes no buffer after the draw is made. It draws a rotating, wandering, tapering funnel about 10-18 m wide at the ground and 70-140 m tall (fromradiusandstrength). The funnel is dense in its lowest 30 m and thins into wisps above, with two twisted dust bands winding up the core. It also draws a skirt of dust thrown out along the ground, dry grass and leaves whirled up in it, and a faint scatter of motes and seed fluff rising toward the birds. The cards are soft and lit by sky and sun with a forward-scattering glow when backlit, and fade into the ground they meet. The dust moves on the gameplay clock, so it stands still while the editor is paused.
It runs in edit (while paused) and in play, on every peer locally; nothing it draws is replicated or saved.
Placing it
local Course = require("sunfall.course")
for i, t in Course.THERMALS do
local marker = entity.spawn("thermal_marker_" .. i, { parent = group })
marker.localPosition = { t.x, 0, t.z } -- y is found from the terrain at start
marker.component.add("ThermalMarker", {
radius = t.radius, top = t.top, birds = t.birds, strength = t.strength, seed = i,
})
end