threejs-worldgen
    Preparing search index...

    Class Clouds

    Sparse Gaussian clouds. Created by Sky (sky.clouds), which drives them every frame; use Clouds.coverAt to ask how cloudy it is anywhere (e.g. to make it rain under clouds).

    Index
    object: Mesh<
        BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
        Material<MaterialEventMap> | Material<MaterialEventMap>[],
        Object3DEventMap,
    >[]

    Both layers. Added to the sky's group.

    settings: CloudOptions = ...

    Resolved settings. Change them with Clouds.set / Clouds.reset.

    uniforms: {
        ambientColor: UniformNode<"vec3", Vector3>;
        color: UniformNode<"vec3", Vector3>;
        curvature: UniformNode<"float", number>;
        density: UniformNode<"float", number>;
        haze: UniformNode<"float", number>;
        hazeColor: UniformNode<"vec3", Vector3>;
        moonColor: UniformNode<"vec3", Vector3>;
        planetCenter: UniformNode<"vec3", Vector3>;
        planetRadius: UniformNode<"float", number>;
        rotation: UniformNode<"mat3", Matrix3>;
        shift: UniformNode<"vec3", Vector3>;
        silverLining: UniformNode<"float", number>;
        sunColor: UniformNode<"vec3", Vector3>;
        sunDirection: UniformNode<"vec3", Vector3>;
    } = ...

    Shared uniforms.

    Type Declaration

    • ambientColor: UniformNode<"vec3", Vector3>

      Sky light radiance on clouds.

    • color: UniformNode<"vec3", Vector3>

      Cloud albedo colour.

    • curvature: UniformNode<"float", number>

      1 = bend local-layer clouds down with distance (flat local frame).

    • density: UniformNode<"float", number>

      Density multiplier.

    • haze: UniformNode<"float", number>

      Haze distance, metres (0 = none, e.g. in space).

    • hazeColor: UniformNode<"vec3", Vector3>

      Haze colour (horizon sky).

    • moonColor: UniformNode<"vec3", Vector3>

      Moonlight radiance on clouds.

    • planetCenter: UniformNode<"vec3", Vector3>

      Render-space planet centre.

    • planetRadius: UniformNode<"float", number>

      Planet radius, metres.

    • rotation: UniformNode<"mat3", Matrix3>

      Global layer: body → render rotation including wind drift.

    • shift: UniformNode<"vec3", Vector3>

      Local layer: render-space drift since the last rebuild.

    • silverLining: UniformNode<"float", number>

      Silver-lining strength.

    • sunColor: UniformNode<"vec3", Vector3>

      Direct sunlight radiance on clouds.

    • sunDirection: UniformNode<"vec3", Vector3>

      Towards the sun.

    • Cloud cover 0..1 at a render-space position right now (low clouds; the same field the splats are placed from, drifting with the wind). Use it to align rain, shadows or gameplay with the clouds.

      Parameters

      • x: number
      • y: number
      • z: number

      Returns number

    • Places and lights the clouds for this frame. Called by Sky.

      Parameters

      • state: SkyState

        Sky state (frame, camera position relative to the planet, sun and moon).

      • camera: Vec3

        Camera position, render space.

      • light: { ambient: Vec3; haze: Vec3; hazeFade: number; moon: Vec3; sun: Vec3 }

        Radiances (direct sun, moon, sky ambient, haze colour; linear RGB) and hazeFade 0..1 (0 above the Kármán line).

      • altitudeScale: number

        Atmosphere altitude scale (planet radius / Earth radius, or 1).

      • troposphere: number

        Tropopause altitude (for the orbital cross-fade), metres.

      • anchor: [number, number]

        Latitude/longitude the detailed layer's tangent plane is anchored at (planet frame).

      Returns void