Taos API Reference
    Preparing search index...

    Class StarsPass

    Standalone procedural starfield pass. Adds stars only on sky pixels and fades them with the sun's altitude (night-only). Add this before any final tonemap so stars are reshaped along with the rest of the scene.

    Stars are added in linear HDR space (no exposure scaling applied here) — downstream tonemap/exposure handles the brightness response. This differs slightly from CompositePass which scales the scene by auto-exposure before adding stars, keeping their absolute brightness constant.

    Hierarchy (View Summary)

    • Pass<StarsDeps, StarsOutputs>
      • StarsPass
    Index

    Properties

    name: "StarsPass" = 'StarsPass'

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

    blackLowerHemisphere: boolean = false

    Fade sky pixels below the horizon to black. Useful on worlds whose geometry doesn't wrap to the horizon.

    skyExtinction: number = 0

    Attenuate each star by the luminance of the sky already behind it, so stars dissolve smoothly into a bright atmosphere instead of cutting off at a hard contrast line. 0 disables it (the default — stars are added at full strength everywhere). Larger values fade stars out faster as the sky brightens; the attenuation is exp(-skyLuminance * skyExtinction). Handy for planet/atmosphere scenes where the daytime lower sky is bright but the zenith is dark. No effect at night (dark sky → attenuation ≈ 1).

    lowerHemisphere: number = 0

    How far stars wrap below the horizon, in [0, 1]. 0 (the default) clamps stars to the upper hemisphere — correct for ground-based scenes where the lower half is occupied by terrain. 1 lets stars cover the full sphere, which is what you want out in space looking in any direction. Drive it with altitude for a smooth ground → space transition.

    occluderCenter: { x: number; y: number; z: number } = ...

    World-space center of a body that occludes the stars (the painted planet body in curved-horizon space views). Rays that strike its sphere skip the starfield, so stars don't bleed over the planet.

    occluderRadius: number = 0

    Radius (m) of occluderCenter's body. 0 (default) disables occlusion.

    catalogMode: boolean = false

    When true AND a catalog texture has been set via setCatalog, draw real Yale-BSC5 stars from the baked equirect instead of the procedural field.

    catalogBrightness: number = 4

    Linear brightness multiplier applied to catalog stars at render time (on top of the per-star flux baked into the equirect). Default 4 — the raw BSC5 flux is dim, so the real-star sky needs a lift to read; lower it to dim, raise it to pop. Only affects the catalog path — the procedural field keeps its own fixed gain.

    Methods

    • Parameters

      • ctx: RenderContext
      • invViewProj: Mat4

        Inverse view-projection of the rendering camera.

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

        World-space camera position.

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

        Unit vector pointing TOWARD the sun (-light.direction). When the sun is high above the horizon, stars are completely hidden.

      Returns void

    • Set the catalog-star celestial orientation from observer latitude and local sidereal time, so real star positions land at the correct altitude/azimuth (the north celestial pole sits at altitude = latitude) and rotate with time. Builds the world→equatorial rotation M = Rᵧ(lst)·Rₓ(φ−90°) (column-major), matching the shader's equatorial frame (Y = pole, RA in the X–Z plane).

      Parameters

      • latitudeRad: number

        Observer latitude in radians (+N).

      • siderealRad: number

        Local sidereal time as an angle in radians (animatable; advances ~2π per sidereal day).

      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: StarsDeps

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

      Returns StarsOutputs

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

    • Release every long-lived GPU resource owned by the pass (pipelines, persistent uniform buffers, samplers, BGLs). Called by the factory or application during teardown. Default implementation is a no-op.

      Returns void