GeometryBufferRenderer

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

Hierarchy

  • GeometryBufferRenderer

Index

Constructors

constructor

Find examples in Playground
  • 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

enablePosition

Find examples in Playground
enablePosition: boolean

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

enableVelocity

Find examples in Playground
enableVelocity: boolean

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

isSupported

Find examples in Playground
isSupported: boolean

Gets wether or not G buffer are supported by the running hardware. This requires draw buffer supports

ratio

Find examples in Playground
ratio: number

Gets the ratio used by the buffer during its creation. How big is the buffer related to the main canvas.

renderList

Find examples in Playground
renderList: Mesh[]

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

samples

Find examples in Playground
samples: number

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

scene

Find examples in Playground
scene: Scene

Gets the scene associated with the buffer.

Static POSITION_TEXTURE_TYPE

Find examples in Playground
POSITION_TEXTURE_TYPE: number

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

Static VELOCITY_TEXTURE_TYPE

Find examples in Playground
VELOCITY_TEXTURE_TYPE: number

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

Methods

dispose

Find examples in Playground
  • dispose(): void
  • Disposes the renderer and frees up associated resources.

    Returns void

getGBuffer

Find examples in Playground

getTextureIndex

Find examples in Playground
  • 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

Find examples in Playground
  • isReady(subMesh: SubMesh, useInstances: boolean): boolean
  • Checks wether 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

Generated using TypeDoc