NatureGL Skyv1.1.0

Guides

Clouds and weather

The clouds are a world-space slab at a real altitude, marched from wherever the camera is. A handful of weather parameters shape them, and every one of them eases, so the weather can change while you watch.

applyPreset('overcast') and then applyPreset('storm') on a running sky. Coverage, density, precipitation, the sun colour and the ambient light all ease together.

#Cloud forms

cloudForm picks the cloud's shape. The other parameters shape it further.

cloudFormWhat it looks likePresets
cumulusFair-weather puffs to full decks, depending on humidityclear, marine, overcast, storm, night
altocumulusSmall mid-level puffs in rows: a mackerel skyaltocumulus, sunset
toweringCumulus congestus: isolated cauliflower towerstowering, golden
cirrusHigh fibrous ice cloud; the dome stays bluecirrus
noctilucentElectric-blue high cloud lit after sunsetnoctilucent
cumulonimbusOne monumental cell anchored at (0, −9.5 km)cumulonimbus
towering
altocumulus

#The weather dials

All of these are 0–1 unless noted and ease when set through setParams or applyPreset.

ParamDefaultEffect
humidity0.5Cloud cover and the amount of cirrus
coverage0Extra cover on top of humidity (−1 … 1)
precipitation0Dark bases, rain veils, gloom; lightning above 0.4
temperature0.45Base altitude and vertical growth
density0.55Extinction: thin wisps to solid towers
edge0.58Erosion strength: soft edges to crisp edges
clump0.5Weather map: km-scale clumps and clearings
wind0.35Drift speed
windDirection293World azimuth the clouds drift toward (degrees)
cirrus1Cirrus multiplier (0 – 2)
haze0.14Aerosol: milkier sky, redder sunsets, hazier distance
js
// a building afternoon storm
sky.setParams({ humidity: 0.85, temperature: 0.7, precipitation: 0.55, wind: 0.6 });

The full list, including exposure and post-pass dials, is on Sky parameters.

#Rain and lightning

When precipitation rises past about 0.4, the deck darkens and rain veils hang under it. Lightning then flashes inside the cloud. sky.lightning reports the current flash (0 – 1.5), so you can flash your own lights with it. Set lightning: 0 to turn the flashes off.

storm: a squall line with rain veils and in-cloud lightning, and the low sun under the deck.
js
renderer.setAnimationLoop(() => {
  sky.update(dt);
  lampLight.intensity = base + sky.lightning * 40;   // your own light reacts to the flash
  renderer.render(scene, camera);
});

#Fly through them

The slab has a real base and top in metres (sky.cloudLayer). The camera can be under it, inside it or above it. The march adds near steps adaptively when you're inside.

#Static and dynamic rendering

js
const sky = await SkySystem.create({ renderer, scene, camera, cloudRenderingMode: 'static' });
sky.setCloudRenderingMode('dynamic');
  • dynamic (default): clouds drift and evolve, lightning flashes, and the shadow and environment maps refresh on their quality-tier interval.
  • static: evolution is frozen. The LUT, shadow and env maps only re-bake when a parameter or the time changes. Use it for product shots, architectural scenes, or anywhere GPU time is tight.

#Cloud shadows

The sky keeps a top-down transmittance map of the deck around the camera (±8 km by default, shadowExtent). Any built-in lit material can sample it:

js
sky.patchMaterial(terrain.material);   // Standard, Physical, Lambert, Phong, Toon

For your own shaders, see Lighting your scene.