← Paracosm·Docs/Handbook
Contents · Weather, sky and light

Weather, sky and light

Time of day

1. Run a day cycle with set_time

set_time with freeze=false and a daylength (seconds) runs the sun; with freeze=true (the default) and a fraction it pins the time (0.25 morning, 0.5 midday, 0.75 dusk). This build ran a 7200 s day. Scripts read the same day through llGetRegionDayLength() and llGetRegionDayOffset() (scripts.md).

Weather in the sky belongs to the region environment

2. Drive the viewer's own sky; do not build clouds out of prims or particles

The viewer draws its own clouds from the region ENVIRONMENT, so that is where a storm belongs. WorldBridge's sky tick (once a minute) blends every sky frame from its fair baseline by the storm value: cloud_shadow (cover) up to 0.95, cloud_pos_density1.z, cloud_color darker, cloud_scroll_rate faster, haze_density up; then StoreOnRegion and WindlightRefresh(transition).

3. Particle and prim clouds failed

4. The water is in the same environment

DayCycle.waterframes (normScale, wave1Dir and wave2Dir as direction times speed, fresnelScale and fresnelOffset, blurMultiplier, scaleAbove, waterFogDensity and waterFogColor). WorldBridge blends it from a captured baseline with the storm and the region's wind: calm water goes glassy (the normal map barely stirring, more fresnel, a crisp reflection); storm water runs fast downwind, rough, darker and murkier. The [calm, storm] pairs are tunable live from worldbridge-sky.json ("waterTune"), so the look is tuned without a rebuild.

5. The weather is one formula every script shares

One organic storm value (a sum of incommensurate periods, scaled by a seasonal storminess) is computed identically by every script from the wall clock and by the module in C#, so sky, clouds, mist, stream, rain and memory never desynchronise.

Particles: fire, mist, rain

6. Fire is particles, not glowing spheres

A grown flame sprite, FOLLOW_VELOCITY plus WIND, emissive. ADDITIVE blending blooms at night but washes to pink against a bright sky; by day draw it with ONE_MINUS_SOURCE_ALPHA in a deeper orange. People look UP at a beacon: size the plume for being seen from below (2-3 m of flame over the basket).

7. Atmosphere is particles, not translucent prims

Mist made of translucent prims catches the camera's focus (alt-click, object view) and confuses movement. Particles cannot be clicked.

8. Rain follows the visitor

Rain is local: a phantom, invisible emitter follows the nearest avatar (llGetAgentList plus OBJECT_POS, llSetRegionPos once a second), emitting WITHOUT FOLLOW_SRC so streaks already falling stay in the world as it moves.

9. Rings on water are squashed billboards

Particles are billboards, so squash them (scale x = 3 y) and they read as rings lying on the water from standing height. Interpolate scale small to large and alpha to 0 over 0.9 s. Emit one ring of emitters per llParticleSystem call (a horizontal ANGLE_CONE band at a radius) with a new area-uniform radius (R * sqrt(u)) four times a second: already emitted particles outlive the call that made them. Sit the emitter 7 cm ABOVE the water, or the ring's lower half is under it.

Flashes, bolts and lights

10. A sky flash cannot come from the environment; flash a mesh dome

osReplaceAgentEnvironment and WindlightRefreshForced take a transition, but for a modern viewer the refresh only re-sends region info; the viewer re-fetches the environment and eases into it on its own schedule, so a "flash" arrives as a slow swell. Prims update at once: flash a mesh DOME over the whole region (236 m, fullbright, alpha blend, alpha 0 at rest, phantom, tiny physics).

11. Put a distant bolt on a shell where the eye would see it

Carry every point of the channel along its line of sight from the listener onto a shell inside the dome (ribbons facing the centre, joints overlapped). It then has the exact look of that channel from where you stand, stands on the horizon, and turns with the glow. Extra faces of the dome (a mesh prim has up to 8) hold several bolts, lit one at a time.

12. Aim from the camera, not from the dome's centre

WorldBridge avatars gives the camera position and lookAt; intersect that ray with the dome sphere to get the bearing to show dead ahead.

13. Light that must read at night is fullbright and casts light

Without fullbright or a light a prim goes dark at night, exactly when a beacon matters. spawn takes fullbright, glow, shiny and a point light (radius up to 20).

14. Carry every change in size and colour; glow is only the flourish

Glow is a bloom the viewer dims or drops at modest graphics settings. Glow and light are also not readable through WorldBridge; colour and size are.

15. A flickering lamp: make the glowing part its own object

A flicker script that sets ALL_SIDES lights everything in its object. Make the glowing panes one object and the iron frame another, or the flicker lights the iron too. Give the panes a tiny physics box.

16. Indoor light

Torches as a mesh (strap, ring, shaft, charred head) with a small emitter prim at the head, placed where no one brushes past (half a turn from a stair at that height).

Weather on surfaces

17. Wet is darker plus a gloss

Multiply PRIM_COLOR by about 0.68 for stone and 0.8 for timber, and add PRIM_SPECULAR (TEXTURE_BLANK, glossiness about 120, environment about 35 for stone) scaled by the wetness. 170 / 60 read brassy at a low sun.

18. Snow on things is a cap grown from the thing's own mesh

Upward triangles (n.z > 0.55) whose centroid ray straight up meets none of the mesh's own triangles, lifted along VERTEX normals (no cracks), UV from above, one texture whose alpha is a per-texel ladder; the mask cutoff follows a broadcast depth. Check the saved mesh file's extents equal the object's size before mapping file vertices to the world.

19. An object centred on the eye (a rainbow)

A 242 m ring 70 m ahead plus a mirrored speck of invisible geometry puts the object's centre at the viewer's eye; the script moves it there and turns +X to the antisolar point (llRotBetween(<1,0,0>, -llGetSunDirection())). Put vertex rings fine where the colour changes fast and coarse elsewhere, within 65,535 vertices per face.