Options
All
  • Public
  • Public/Protected
  • All
Menu

Renders a pre pass of the scene This means every mesh in the scene will be rendered to a render target texture And then this texture will be composited to the rendering canvas with post processes It is necessary for effects like subsurface scattering or deferred shading

Hierarchy

  • PrePassRenderer

Index

Constructors

  • Instantiates a prepass renderer

    Parameters

    Returns PrePassRenderer

Properties

defaultRT: PrePassRenderTarget

The render target where the scene is directly rendered

disableGammaTransform: boolean

Set to true to disable gamma transform in PrePass. Can be useful in case you already proceed to gamma transform on a material level and your post processes don't need to be in linear color space.

doNotUseGeometryRendererFallback: boolean

Prevents the PrePassRenderer from using the GeometryBufferRenderer as a fallback

excludedMaterials: Material[]

Force material to be excluded from the prepass Can be useful when useGeometryBufferFallback is set to true and you don't want a material to show in the effect.

excludedSkinnedMesh: AbstractMesh[]

To save performance, we can excluded skinned meshes from the prepass

mrtCount: number

Number of textures in the multi render target texture where the scene is directly rendered

renderTargets: PrePassRenderTarget[]

All the render targets generated by prepass

Accessors

  • get currentRTisSceneRT(): boolean
  • Returns true if the currently rendered prePassRenderTarget is the one associated with the scene.

    Returns boolean

  • get enabled(): boolean
  • Indicates if the prepass is enabled

    Returns boolean

  • get isSupported(): boolean
  • Indicates if rendering a prepass is supported

    Returns boolean

  • get samples(): number
  • set samples(n: number): void
  • How many samples are used for MSAA of the scene render target

    Returns number

  • How many samples are used for MSAA of the scene render target

    Parameters

    • n: number

    Returns void

Methods

  • Adds an effect configuration to the prepass render target. If an effect has already been added, it won't add it twice and will return the configuration already present.

    Parameters

    Returns PrePassEffectConfiguration

    the effect configuration now used by the prepass

  • Sets the proper output textures to draw in the engine.

    Parameters

    • effect: Effect

      The effect that is drawn. It can be or not be compatible with drawing to several output textures.

    • subMesh: SubMesh

      Submesh on which the effect is applied

    Returns void

  • dispose(): void
  • Disposes the prepass renderer.

    Returns void

  • getIndex(type: number): number
  • Returns the index of a texture in the multi render target texture array.

    Parameters

    • type: number

      Texture type

    Returns number

    The index

  • getRenderTarget(): PrePassRenderTarget
  • Returns PrePassRenderTarget

    the prepass render target for the rendering pass. If we are currently rendering a render target, it returns the PrePassRenderTarget associated with that render target. Otherwise, it returns the scene default PrePassRenderTarget

  • markAsDirty(): void
  • Marks the prepass renderer as dirty, triggering a check if the prepass is necessary for the next rendering.

    Returns void

  • restoreAttachments(): void
  • Restores attachments for single texture draw.

    Returns void

  • Sets an intermediary texture between prepass and postprocesses. This texture will be used as input for post processes

    Parameters

    Returns boolean

    true if there are postprocesses that will use this texture, false if there is no postprocesses - and the function has no effect

Legend

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

Settings

Theme