DepthRenderer

This represents a depth renderer in Babylon. A depth renderer will render to it's depth map every frame which can be displayed or used in post processing

Hierarchy

  • DepthRenderer

Index

Constructors

Properties

Methods

Constructors

constructor

Find examples in Playground
  • Instantiates a depth renderer

    Parameters

    • scene: Scene

      The scene the renderer belongs to

    • Optional type: number

      The texture type of the depth map (default: Engine.TEXTURETYPE_FLOAT)

    • Optional camera: Nullable<Camera>

      The camera to be used to render the depth map (default: scene's active camera)

    Returns DepthRenderer

Properties

useOnlyInActiveCamera

Find examples in Playground
useOnlyInActiveCamera: boolean

Specifiess that the depth renderer will only be used within the camera it is created for. This can help forcing its rendering during the camera processing.

Methods

dispose

Find examples in Playground
  • dispose(): void
  • Disposes of the depth renderer.

    Returns void

getDepthMap

Find examples in Playground
  • Gets the texture which the depth map will be written to.

    Returns RenderTargetTexture

    The depth map texture

isReady

Find examples in Playground
  • isReady(subMesh: SubMesh, useInstances: boolean): boolean
  • Creates the depth rendering effect and checks if the effect is ready.

    Parameters

    • subMesh: SubMesh

      The submesh to be used to render the depth map of

    • useInstances: boolean

      If multiple world instances should be used

    Returns boolean

    if the depth renderer is ready to render the depth map

Generated using TypeDoc