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

    Class CoverageBufferTester

    GPU coverage depth → CPU AABB tester.

    updateGPUDepthBuffer downsamples scene depth (4-tap max, 256∶128 chain) and packs the last level as view-space Z for GPU→CPU download. frameUpdate polls finished readbacks. execute reprojects the last capture and tests queued AABBs on the CPU. Results lag at least one GPU frame.

    Works with WebglCoverageBuffer (transform feedback + PBO) and WebgpuCoverageBuffer (compute pack + mapAsync).

    Implements

    Index
    _ocTesterType: "gpu2cpu_readback_oct" = ...
    • Adds the object to the queue for occlusion testing.

      Parameters

      • id: number

        The unique identifier returned earlier by the lock() method.

      • Optional_extra: number | number[]

      Returns number

      A queue index or -1 (if internal verification inconsistencies occur, for example, the tester is unavailable or the tester is waiting for synchronization).

    • Increments the coverage frame id and harvests finished GPU→CPU downloads. Call every frame (typically on frameupdate, or at the start of update). Distinct from execute, which only tests queued AABBs.

      Parameters

      • dt: number

        The time since the last frame.

      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.