Sunfall Ridge
README.md
SunGlow
Draws the sun a player looks at in Sunfall Ridge's sunset. The atmosphere's own solar disc is held to a few times the sky's brightness, which after exposure and the display curve reads as a small pale grey disc; SunGlow draws the real thing over it: a small, very bright core (white-yellow high up, gold, orange and finally a dim red ball at the horizon), a tight aureole, a wide warm halo bleeding into the sky, and faint diffraction rays, bright enough that bloom and the lens flare fire on it. It sinks behind the cloud deck's far edge and goes out by -1 degree.
Put it on the entity carrying the sun's directional Light (the scene's sun); it reads that Light's direction and enabled and needs nothing else. It runs in play and in edit.
Fields
| Field | Default | Meaning |
|---|---|---|
strength | 1 | Overall brightness of the drawn sun and its glow (0 hides it). |
distance | 9500 | Metres from the camera the card is placed; the shader puts its depth at the far plane, so every surface any camera draws (terrain, wing, pilot) hides it, whatever that camera's far distance. |
deckReach | 30000 | Metres to the cloud deck's far edge (the deck's top is sunfall.course's CLOUDS.top). |
How it draws
One instanced draw of one card with look/sun_glow.shader, additive, writing no depth, queue 2950 (under the other blended surfaces). The shader stands the card along the sun's direction from the camera every frame, so no entity moves and nothing is recorded into the scene. The component writes the draw's four lanes (direction, strength, deck top, reach, distance) only when the Light has turned, into a table made once: nothing is allocated per frame. Buffers are registered a few frames after they are made and freed a few frames after the draw is dropped.