SDK JS
    Preparing search index...

    A SunConsumer that fans the SunState out to Bitruvius WebGL2 layers for REAL lighting (and, later, shadows). Targets implement SunLightable. Kept renderer-agnostic (no @bitruvius/mesh import) so atmosphere depends on no renderer package. Created and managed for you by setTimeOfDay (its layers option + Atmosphere.addLayer / Atmosphere.removeLayer).

    import { GeoSunSystem, RendererSunController, Tiles3DMeshLayer } from '@bitruvius/sdk-maplibre';

    const city = new Tiles3DMeshLayer({ id: 'city', url });
    map.on('load', () => {
    map.addLayer(city);
    const sun = new RendererSunController([city]); // or sun.add(layer) later
    const system = new GeoSunSystem(map, { controllers: [sun] });
    system.update(new Date()); // pushes the SunState to every target's setSunState
    });

    Implements

    Index

    Constructors

    Properties

    enabled: boolean = true

    When false, RendererSunController.update is a no-op (the geo-sun system is disabled). The facade still calls RendererSunController.clearLighting on the disable transition to revert the layers to their baseline look.

    Methods

    • Revert every target to its baseline (no-sun) lighting (on the disable transition).

      Returns void

    • Remove a previously added target.

      Parameters

      Returns void

    • Toggle the cast-shadow pass on every target that supports it.

      Parameters

      • on: boolean

        Whether shadows should be on.

      Returns void