Options
All
  • Public
  • Public/Protected
  • All
Menu

This renderer is helpful to fill one of the render target with a geometry buffer.

Hierarchy

  • GeometryBufferRenderer

Index

Constructors

  • Creates a new G Buffer for the scene

    Parameters

    • scene: Scene

      The scene the buffer belongs to

    • Optional ratio: number

      How big is the buffer related to the main canvas (default: 1)

    • Optional depthFormat: number

      Format of the depth texture (default: Constants.TEXTUREFORMAT_DEPTH16)

    Returns GeometryBufferRenderer

Properties

excludedSkinnedMeshesFromVelocity: AbstractMesh[]

Array used to store the ignored skinned meshes while computing velocity map (typically used by the motion blur post-process). Avoids computing bones velocities and computes only mesh's velocity itself (position, rotation, scaling).

generateNormalsInWorldSpace: boolean

Gets or sets a boolean indicating if normals should be generated in world space (default: false, meaning normals are generated in view space)

renderTransparentMeshes: boolean

Gets or sets a boolean indicating if transparent meshes should be rendered

useSpecificClearForDepthTexture: boolean

If set to true (default: false), the depth texture will be cleared with the depth value corresponding to the far plane (1 in normal mode, 0 in reverse depth buffer mode) If set to false, the depth texture is always cleared with 0.

DEPTH_TEXTURE_TYPE: 0 = 0

Constant used to retrieve the depth texture index in the G-Buffer textures array using getIndex(GeometryBufferRenderer.DEPTH_TEXTURE_INDEX)

NORMAL_TEXTURE_TYPE: 1 = 1

Constant used to retrieve the normal texture index in the G-Buffer textures array using getIndex(GeometryBufferRenderer.NORMAL_TEXTURE_INDEX)

POSITION_TEXTURE_TYPE: 2 = 2

Constant used to retrieve the position texture index in the G-Buffer textures array using getIndex(GeometryBufferRenderer.POSITION_TEXTURE_INDEX)

REFLECTIVITY_TEXTURE_TYPE: 4 = 4

Constant used to retrieve the reflectivity texture index in the G-Buffer textures array using the getIndex(GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE)

VELOCITY_TEXTURE_TYPE: 3 = 3

Constant used to retrieve the velocity texture index in the G-Buffer textures array using getIndex(GeometryBufferRenderer.VELOCITY_TEXTURE_INDEX)

Accessors

  • get enablePosition(): boolean
  • set enablePosition(enable: boolean): void
  • Gets a boolean indicating if objects positions are enabled for the G buffer.

    Returns boolean

  • Sets whether or not objects positions are enabled for the G buffer.

    Parameters

    • enable: boolean

    Returns void

  • get enableReflectivity(): boolean
  • set enableReflectivity(enable: boolean): void
  • Gets a boolean indicating if objects reflectivity are enabled in the G buffer.

    Returns boolean

  • Sets whether or not objects reflectivity are enabled for the G buffer. For Metallic-Roughness workflow with ORM texture, we assume that ORM texture is defined according to the default layout: pbr.useRoughnessFromMetallicTextureAlpha = false; pbr.useRoughnessFromMetallicTextureGreen = true; pbr.useMetallnessFromMetallicTextureBlue = true;

    Parameters

    • enable: boolean

    Returns void

  • get enableVelocity(): boolean
  • set enableVelocity(enable: boolean): void
  • Gets a boolean indicating if objects velocities are enabled for the G buffer.

    Returns boolean

  • Sets whether or not objects velocities are enabled for the G buffer.

    Parameters

    • enable: boolean

    Returns void

  • get isSupported(): boolean
  • Gets whether or not G buffer are supported by the running hardware. This requires draw buffer supports

    Returns boolean

  • get ratio(): number
  • Gets the ratio used by the buffer during its creation. How big is the buffer related to the main canvas.

    Returns number

  • Gets the render list (meshes to be rendered) used in the G buffer.

    Returns Nullable<AbstractMesh[]>

  • Set the render list (meshes to be rendered) used in the G buffer.

    Parameters

    Returns void

  • get samples(): number
  • set samples(value: number): void
  • Gets the number of samples used to render the buffer (anti aliasing).

    Returns number

  • Sets the number of samples used to render the buffer (anti aliasing).

    Parameters

    • value: number

    Returns void

  • Gets the scene associated with the buffer.

    Returns Scene

Methods

  • dispose(): void
  • Disposes the renderer and frees up associated resources.

    Returns void

  • Gets the current underlying G Buffer.

    Returns MultiRenderTarget

    the buffer

  • getTextureIndex(textureType: number): number
  • Returns the index of the given texture type in the G-Buffer textures array

    Parameters

    • textureType: number

      The texture type constant. For example GeometryBufferRenderer.POSITION_TEXTURE_INDEX

    Returns number

    the index of the given texture type in the G-Buffer textures array

  • isReady(subMesh: SubMesh, useInstances: boolean): boolean
  • Checks whether everything is ready to render a submesh to the G buffer.

    Parameters

    • subMesh: SubMesh

      the submesh to check readiness for

    • useInstances: boolean

      is the mesh drawn using instance or not

    Returns boolean

    true if ready otherwise false

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static property
  • Static method

Settings

Theme