playcanvas-opti-pixel - v1.3.1
    Preparing search index...

    Class CoverageBufferTesterWorker

    JS worker coverage tester. Owns the AABB pool, one transferable job bus, and a two-slot ping-pong output ring (reprojected + flags). Last results stay in the published slot while the write slot is with coverageBufferWorkerMain. CoverageCpuBuffer runs only inside the worker — never on this thread.

    Implements

    Index
    _ocTesterType: "gpu2cpu_readback_oct" = ...
    aabbExpand: number = 0

    World AABB inflate as a fraction of camera-to-box distance. Written into the bus before each worker job.

    depthBias: number = 0

    Moves reprojected occluders away from the camera. b > 0: z * (1 + b) + b. b < 0: z + |b| metres of view-space Z. Written into the bus before each worker job.

    rectPadPixels: number = 0

    Extra coverage pixels around the projected rect. Written into the bus before each worker job.

    DEFAULT_AABB_CAPACITY: 4096
    • Parameters

      • id: number
      • boundingBox: BoundingBox
      • Optionalmatrix: Mat4
      • extra1: number = 0
      • extra2: number = 0

      Returns void

    • Registers a BoundingBox for subsequent occlusion testing.

      Parameters

      • boundingBox: BoundingBox

        The bounds of the object in local or world coordinates.

      • Optionalmatrix: Mat4

        Optional transformation matrix (if a local BoundingBox is used).

      • extra1: number = 0

        Optional extra data 1.

      • extra2: number = 0

        Optional extra data 2.

      Returns number

      A unique identifier for the registered object.

    • Registers a BoundingBox for subsequent occlusion testing.

      Parameters

      • data: ArrayLike<number>

        The array containing the bounding box data (min and max points) in local or world coordinates [minX, maxX, minY, maxY, minZ, maxZ].

      • offset: number

        The offset in the array where the bounding box data starts.

      • Optionalmatrix: Mat4

        Optional transformation matrix (if a local BoundingBox is used).

      • Optionalextra1: number

        Optional extra data 1.

      • Optionalextra2: number

        Optional extra data 2.

      Returns number

      A unique identifier for the registered object.