acron.sky

The sky, the day and the night: a physically based atmosphere (Hillaire 2020) lit by a sun and a moon that sit where they would for a date, an hour and a place, with the frame values every environment-aware shader reads.

The pieces (each its own module; the package re-exports the API):

  • DayClock (clock) — local time at a latitude/longitude, a speed, sync to the computer’s clock. Pure Python.

  • sky_at() / Sky (celestial) — sun and moon directions, the moon’s phase and the star sphere’s rotation. Pure Python.

  • Atmosphere (atmosphere) — the air’s media in km and 1/km (Earth by default), weather (haze, humidity), and a CPU twin for light colours (native: acron.atmosphere.SkyModel).

  • Look, Blend, HourCycle, Layer (look) — the artistic numbers (haze, fog, exposure, stars …), the game’s cross-fades, per-hour values and the layers (weather, season) that compose on top (compose()). Pure Python.

  • FrameUniforms (frame) — named per-frame slots in one float texture bound once at the root (shaderlib/frame.glsl).

  • SkyPasses (passes) — the LUTs: transmittance, multiple scattering, a sky view per light, sky irradiance and the aerial-perspective volume, as fragment passes.

  • Environment (environment) — all of it wired to a ShowBase: the sky dome, the key and ambient lights, the per-frame update.

  • SunShadows (shadows) — cascaded shadow maps for the key light.

  • stars and NightSky (night) – the night sky after Jensen et al. 2001: the Yale Bright Star Catalogue, a Milky Way map, zodiacal light, airglow, light pollution and the moon’s face (shaders/night_sky.glsl). The catalogue part is pure Python.

  • EnvironmentProbe (probe) — the sky (clouds and all) as image- based light: a cubemap filtered into GGX-prefiltered and irradiance octahedral maps (shaderlib/probe.glsl).

Shaders include atmosphere.glsl / shadows.glsl from acron.shaderlib; Environment.make_shader() compiles them with the right defines. Needs a core-profile context (gl-version 4 5; 4.1 works on macOS for development).