acron.clouds

Volumetric clouds and weather on acron.sky (core profile).

After Schneider’s Nubis talks (Guerrilla, SIGGRAPH 2015-2023), ported from castaway’s and car-main’s clouds and generalised. The pieces (one module each; the package re-exports the API):

  • CloudConfig / Quality (config) — the fixed settings (data/clouds.json), validated: the noise tiles divide each other, render sizes are powers of two, panorama bands split the width; quality presets low / medium / high / ultra. Pure Python.

  • WeatherPreset, WeatherBlend (weather) — weathers as data (data/weather.json ships clear, fair, overcast, rain, storm, fog and snow as examples: the game’s policy), cross-faded over seconds. Pure Python.

  • Weather (weather) — the engine’s native acron.atmosphere.WeatherField driven by the presets: its cells, wind, drift and the weather map (r cover, g type / 2, b base, a top over 12 km) written straight into a Texture.

  • Schedule, PanoramaState, History, shadow_placement(), light_fade() (schedule) — the amortised panorama’s slots, when histories reset, the shadow map’s air-fixed grid. Pure Python.

  • make_noise() (bake) — the noise textures (native CloudNoise).

  • VoxelClouds (voxels) — the voxel clouds’ atlases and slot table (Nubis^3: hero cells and a game’s volumes, native CloudVolume).

  • CloudRenderer (renderer) — all of it on an acron.sky.Environment: the screen-space march with temporal reprojection, the panorama (low preset, environment probe), the cloud shadow map, the sky composite (shaderlib/clouds.glsl), lightning, the cloud fog on geometry (shaderlib/cloud_fog.glsl) and light shafts (shaderlib/light_shafts.glsl) for lit shaders, the sky light under the clouds.

GLSL: shaderlib/cloud_density.glsl (density), shaderlib/cloud_voxels.glsl (the voxel volumes), shaders/clouds_march.glsl (geometry, light, rain), one fragment shader per pass; every pass is a fragment pass, so the module runs on a macOS GL 4.1 development box as on the GL 4.5 targets.

No numpy anywhere at run time (Android and web builds do not ship it): the CPU side — noise, weather, the density queries — is the engine’s native acron.atmosphere, which acron.clouds requires (a clear NativeMissingError without it). The pure-Python model the tests hold it to lives in the tests (python/tests/_clouds_reference.py).

Global Functions

assemble_shaders(quality: str = 'high', config: CloudConfig | None = None, frame_defines: dict | None = None, version: int | None = None, voxels: bool = True, brute: float = 0.0) → dict

Every cloud shader’s (vertex, fragment) source for a quality, as the renderer would compile them — no GL (tests check they resolve). voxels: with the voxel volumes (the config’s voxels slots); brute: their reference march (fixed steps of that many metres).