hex-world
    Preparing search index...

    Interface DayNightState

    Everything a renderer needs to light one moment of the cycle. All objects are reused between evaluate() calls — copy, don't keep.

    interface DayNightState {
        time: number;
        sunDir: Vector3;
        moonDir: Vector3;
        lightDir: Vector3;
        lightColor: Color;
        lightIntensity: number;
        ambientColor: Color;
        ambientIntensity: number;
        skyColor: Color;
        skyHorizon: Color;
        skyZenith: Color;
        terrainLightColor: Color;
        terrainAmbient: Color;
        liquidTint: Color;
        daylight: number;
        isNight: boolean;
    }
    Index

    Properties

    time: number

    Time of day 0–1 (0 = midnight, 0.5 = noon).

    sunDir: Vector3

    Unit vector toward the sun — below the horizon at night (y < 0).

    moonDir: Vector3

    Unit vector toward the moon (always opposite the sun).

    lightDir: Vector3

    Direction of the active luminary: the sun by day, the moon by night.

    lightColor: Color

    Color of the active luminary (warm-shifted near the horizon).

    lightIntensity: number

    DirectionalLight-scale intensity of the active luminary.

    ambientColor: Color
    ambientIntensity: number
    skyColor: Color

    Sky/background color for this moment — the same value as skyHorizon.

    skyHorizon: Color

    Sky color at the horizon. A SkyDome hazes the world into this, so the map edge and the sky meet in one value.

    skyZenith: Color

    Sky color straight overhead — the top of the dome's gradient.

    terrainLightColor: Color

    uLightColor value for the terrain shader (lightColor pre-scaled by intensity, matching the material's static defaults at noon).

    terrainAmbient: Color

    uAmbient value for the terrain shader.

    liquidTint: Color

    Multiplier for unlit liquid surfaces (see setLiquidLightTint) — white at noon, dark blue at night, so lava's emissive glow carries the scene.

    daylight: number

    0 at night → 1 in full day (twilight ramps between).

    isNight: boolean

    True while the sun is below the horizon (the moon is the active light).