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

_previousBonesTransformationMatrices: {}

Dictionary used to store the previous bones transformation matrices of each rendered mesh in order to compute objects velocities when enableVelocity is set to "true"

internal

Type declaration

  • [index: number]: Float32Array
_previousTransformationMatrices: {}

Dictionary used to store the previous transformation matrices of each rendered mesh in order to compute objects velocities when enableVelocity is set to "true"

internal

Type declaration

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).

renderTransparentMeshes: boolean

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

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)

_SceneComponentInitialization: ((scene: Scene) => void)

Type declaration

    • internal

      Parameters

      Returns void

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

  • _forceTextureType(geometryBufferType: number, index: number): void
  • internal

    Replaces a texture in the geometry buffer renderer Useful when linking textures of the prepass renderer

    Parameters

    • geometryBufferType: number
    • index: number

    Returns void

  • internal

    Replaces the first texture which is hard coded as a depth texture in the geometry buffer Useful when linking textures of the prepass renderer

    Parameters

    Returns void

  • internal

    Sets up internal structures to share outputs with PrePassRenderer This method should only be called by the PrePassRenderer itself

    Parameters

    Returns void

  • _resetLayout(): void
  • internal

    Resets the geometry buffer layout

    Returns void

  • _setAttachments(attachments: number[]): void
  • internal

    Sets texture attachments Useful when linking textures of the prepass renderer

    Parameters

    • attachments: number[]

    Returns void

  • _unlinkPrePassRenderer(): void
  • internal

    Separates internal structures from PrePassRenderer so the geometry buffer can now operate by itself. This method should only be called by the PrePassRenderer itself

    Returns void

  • 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
  • Property
  • Method
  • Static property
  • Static method
  • Inherited constructor

Settings

Theme