Taos API Reference
    Preparing search index...

    Class AtmospherePass

    Renders an atmospheric sky dome into the supplied HDR target (render-graph version).

    Uses a fullscreen triangle and reconstructs view rays via the inverse view-projection matrix; the atmosphere shader evaluates a procedural sky model from the camera position and the toward-sun vector.

    Defaults to Earth-scale, flat-world scattering (legacy behavior). Call setPlanet to switch to planetary mode — the camera position is then treated as a world position relative to the planet center at the origin, and the supplied PlanetAtmosphere drives the scattering scale.

    Hierarchy (View Summary)

    • Pass<AtmosphereDeps, AtmosphereOutputs>
      • AtmospherePass
    Index

    Properties

    name: "AtmospherePass" = 'AtmospherePass'

    Human-readable identifier used in graph node labels and error messages.

    Methods

    • Enable or disable horizonless-sky mode (planet-mode only — has no effect with the legacy Earth/flat-world scattering). See _horizonless. Takes effect on the next update.

      Parameters

      • enabled: boolean

      Returns void

    • Opt-in: center the sky-view LUT's elevation warp on the altitude-dependent geometric horizon instead of the local horizontal, so the bright lit-limb band gets the LUT's V resolution from orbit (fixes limb banding in orbit-to-ground views). Degenerates exactly to the default mapping at the surface, so it never changes a ground view. Off by default. Takes effect on the next update (both the sky-view bake and the dome read the flag).

      Parameters

      • enabled: boolean

      Returns void

    • Enable or disable the lit planet-surface term (planet mode only — no effect with the legacy Earth/flat-world scattering). When on, view rays that strike the ground sphere are shaded as a stylized sun-lit globe with a day-night terminator and aerial perspective, so the planet reads as a sphere from high altitude / space. Real surface geometry (e.g. streamed terrain) composited after the sky overwrites this wherever it exists. Takes effect on the next update. See _renderGround.

      Parameters

      • enabled: boolean

      Returns void

    • Overrides the ground albedo — the tint of the ground-bounce light the sky integral adds back (and the below-horizon ground tone). Lower it toward black for a dark ground / unlit horizon. Works in flat and planet mode; takes effect on the next update (the param block is re-packed every frame). For a consistent look with multi-scattering on, pass the same value to AtmosphereLutsFeature({ params: { groundAlbedo } }).

      Parameters

      • rgb: [number, number, number]

      Returns void

    • Set the planet's center in world space (planet mode only). By default the planet is centered at the world origin; pass the world-space position of the center to render the atmosphere for a planet that sits elsewhere — e.g. a floating-origin geospatial scene where the world frame is a local tangent plane and Earth's center is millions of meters away. Update it each frame if the origin re-anchors. No effect in Earth/flat mode. Takes effect on the next update.

      Parameters

      • center: { x: number; y: number; z: number }

      Returns void

    • Merge per-field overrides into the active atmosphere parameters without changing the Earth/planet mode. Unspecified fields keep their current value. Takes effect on the next update (the cached params are re-uploaded every frame). Use this to drive the sky from authoring data (e.g. a Sky scene component) — adjusting sun intensity, Rayleigh/Mie/ozone scattering, or ground albedo at runtime.

      Parameters

      Returns void

    • Tune the sun-flare halo: power is the falloff exponent (higher hugs the disk tighter), strength its brightness in HDR units. Set strength to 0 to disable the halo (just the hard disk remains).

      Parameters

      • power: number
      • strength: number

      Returns void

    • Set the moon-flare halo brightness — a dim, cool glow around the moon, separate from the sun's flare and weighted by the moon's lit fraction in the shader (a crescent glows less than a full moon). 0 disables it. Shares the sun's flare falloff exponent (setSunFlare's power).

      Parameters

      • strength: number

      Returns void

    • Override the moon's phase explicitly, decoupled from the sun↔moon geometry. phase ∈ [0,1] sweeps the lunar cycle: 0.5 = full, 0/1 = new, 0.25 / 0.75 = the two quarter moons. Pass null to fall back to the geometric phase (the moon lit by the real sun direction — the default).

      Parameters

      • phase: number | null

      Returns void

    • Hide (or show) the painted moon disk + flare entirely. Use when a real moon is rendered as scene geometry, so the stylized sky moon doesn't draw a second disc / rim over it. Off by default.

      Parameters

      • hidden: boolean

      Returns void

    • Hide (or show) ONLY the painted moon disk, keeping its flare/halo. Use when a real moon body is drawn as geometry (the lit sphere is the disc) but a glow positioned at the moon direction is still wanted. Off by default.

      Parameters

      • hidden: boolean

      Returns void

    • Keep the painted moon visible during the day (instead of fading it out after sunset). Use for an orbiting moon you want to spot while the sun is up. This only affects the painted disk/flare in the sky — the scene moonlight stays night-only. Off by default.

      Parameters

      • enabled: boolean

      Returns void

    • Parameters

      • ctx: RenderContext

        Render context (used for the queue).

      • invViewProj: Mat4

        Inverse view-projection matrix used to reconstruct view rays.

      • camPos: { x: number; y: number; z: number }

        World-space camera position.

      • lightDir: { x: number; y: number; z: number }

        Directional light direction (rays traveling toward the scene); the shader receives normalize(-lightDir) as the toward-sun vector.

      • OptionalmoonDir: { x: number; y: number; z: number }

        Optional unit vector pointing TOWARD the moon. When omitted the moon is placed antipodal to the sun (a full moon, the legacy behavior); supply a direction to get real lit phases + earthshine.

      Returns void

    • Insert the pass into graph for one frame. Implementations call graph.addPass(name, type, b => { ... }) exactly once and use the supplied PassBuilder to declare reads, writes, transient resources, and the execute callback.

      Parameters

      • graph: RenderGraph

        Graph being built this frame.

      • deps: AtmosphereDeps = {}

        Pass-specific dependency record (handles, scene data, etc.).

      Returns AtmosphereOutputs

      Pass-specific output record (typically a set of handles downstream passes will consume).