API

Class PrePassRenderer

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

Index
defaultRT: PrePassRenderTarget

The render target where the scene is directly rendered

disableGammaTransform: boolean = false

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 = true

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 = 0

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

renderTargets: PrePassRenderTarget[] = []

All the render targets generated by prepass

TextureFormats: { format: number; name: string; purpose: number; type: number }[] = ...

Describes the types and formats of the textures used by the pre-pass renderer

  • 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

    • cfg: PrePassEffectConfiguration

      the effect configuration

    Returns PrePassEffectConfiguration

    the effect configuration now used by the prepass

  • 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