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

    Class SceneDepthMapHandle

    A handle to the scene depth map of a camera, obtained from CameraComponent#sceneDepthMapHandle. The handle is a single object for the lifetime of the camera, and always identifies the depth map the camera rendered most recently, together with how it is encoded, even as the camera renders it to a different texture.

    Pass the handle to Compute#setSceneDepthMap to make the depth map available to a compute shader.

    Index
    • get width(): number

      Gets the width of the depth map the camera rendered most recently, in texels, or 0 when the camera has not rendered one. A compute shader processing each texel of the depth map is dispatched over this size, see Compute#setupDispatchThreads. It changes with the depth map, so read it right before the dispatch: once the camera renders in the frame, it is the width of the depth map of this frame, and before that, of the previous frame.

      Returns number