Engine API Reference - v2.24.0-beta.13
    Preparing search index...

    Class Sky

    Implementation of the sky.

    Index
    node: GraphNode = ...

    A graph node with a transform used to render the sky mesh. Adjust the position, rotation and scale of this node to orient the sky mesh. Ignored for SKYTYPE_INFINITE.

    • get depthWrite(): boolean

      Gets whether depth writing is enabled for the sky.

      Returns boolean

    • set depthWrite(value: boolean): void

      Sets whether depth writing is enabled for the sky. Defaults to false.

      Writing a depth value for the skydome is supported when its type is not SKYTYPE_INFINITE. When enabled, the depth is written to the scene depth texture during the scene pass or a depth prepass, allowing subsequent passes to apply depth-based effects, such as Depth of Field.

      Note: When a depth prepass is used, the Sky Layer must be ordered before the Depth layer, which is the final layer used in the prepass.

      Parameters

      • value: boolean

      Returns void

    • get enabled(): boolean

      Gets whether the sky is rendered.

      Returns boolean

    • set enabled(value: boolean): void

      Sets whether the sky is rendered. When disabled, the sky is not rendered and its mesh and shader are not created, while the environment lighting of the scene, such as Scene#envAtlas, still lights the scene. Defaults to true.

      Parameters

      • value: boolean

      Returns void

      // light the scene with the environment atlas, without rendering it as the sky
      app.scene.envAtlas = envAtlas;
      app.scene.sky.enabled = false;
    • get fisheye(): number

      Gets the fisheye projection strength for the sky.

      Returns number

    • set fisheye(value: number): void

      Sets the fisheye projection strength for the sky. The value is in the range [0, 1]:

      • 0: Standard rectilinear (perspective) projection.
      • (0, 1]: Increasing barrel distortion, producing a wider field of view.

      Only supported with SKYTYPE_INFINITE. Has no effect on dome or box sky types, and has no effect with orthographic cameras. Defaults to 0.

      Parameters

      • value: number

      Returns void