Small World Engine API Reference - v0.76.20
    Preparing search index...

    Function zSliceFromViewDepth

    • Maps a view-space depth to a logarithmically-staggered depth slice index, so cells stay thin near the camera and widen towards the far plane (same family of formula as the existing CSM log/uniform split, see DirectionalLight.updateCascades()).

      Parameters

      • viewZ: number

        View-space depth (positive distance from the camera).

      • near: number

        Camera near-plane distance.

      • far: number

        Camera far-plane distance.

      • numSlices: number

        Number of depth slices.

      Returns number