Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GeometryBufferRenderer

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

Hierarchy

  • GeometryBufferRenderer

Index

Constructors

constructor

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

    Returns GeometryBufferRenderer

Properties

excludedSkinnedMeshesFromVelocitySearch playground for excludedSkinnedMeshesFromVelocity

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

renderTransparentMeshesSearch playground for renderTransparentMeshes

renderTransparentMeshes: boolean

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

Static Readonly DEPTH_TEXTURE_TYPESearch playground for DEPTH_TEXTURE_TYPE

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)

Static Readonly NORMAL_TEXTURE_TYPESearch playground for NORMAL_TEXTURE_TYPE

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)

Static Readonly POSITION_TEXTURE_TYPESearch playground for POSITION_TEXTURE_TYPE

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)

Static Readonly REFLECTIVITY_TEXTURE_TYPESearch playground for REFLECTIVITY_TEXTURE_TYPE

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)

Static Readonly VELOCITY_TEXTURE_TYPESearch playground for VELOCITY_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

enablePosition

  • get enablePosition(): boolean
  • set enablePosition(enable: boolean): any
  • 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 any

enableReflectivity

  • get enableReflectivity(): boolean
  • set enableReflectivity(enable: boolean): any
  • 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 any

enableVelocity

  • get enableVelocity(): boolean
  • set enableVelocity(enable: boolean): any
  • 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 any

isSupported

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

    Returns boolean

ratio

  • 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

renderList

  • 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 any

samples

  • get samples(): number
  • set samples(value: number): any
  • 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 any

scene

  • Gets the scene associated with the buffer.

    Returns Scene

Methods

disposeSearch playground for dispose

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

    Returns void

getGBufferSearch playground for getGBuffer

  • Gets the current underlying G Buffer.

    Returns MultiRenderTarget

    the buffer

getTextureIndexSearch playground for getTextureIndex

  • 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

isReadySearch playground for isReady

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