• Public
  • Public/Protected
  • All

Class VRMultiviewToSingleviewPostProcess

VRMultiviewToSingleview used to convert multiview texture arrays to standard textures for scenarios such as webVR This will not be used for webXR as it supports displaying texture arrays directly





  • Initializes a VRMultiviewToSingleview


    • name: string

      name of the post process

    • camera: Camera

      camera to be applied to

    • scaleFactor: number

      scaling factor to the size of the output texture

    Returns VRMultiviewToSingleviewPostProcess


adaptScaleToCurrentViewportSearch playground for adaptScaleToCurrentViewport

adaptScaleToCurrentViewport: boolean

Modify the scale of the post process to be the same as the viewport (default: false)

alphaConstantsSearch playground for alphaConstants

alphaConstants: Color4

Sets the setAlphaBlendConstants of the babylon engine

alphaModeSearch playground for alphaMode

alphaMode: number

Type of alpha mode to use when performing the post process (default: Engine.ALPHA_DISABLE)

alwaysForcePOTSearch playground for alwaysForcePOT

alwaysForcePOT: boolean

Force textures to be a power of two (default: false)

animationsSearch playground for animations

animations: Animation[]

Animations to be used for the post processing

autoClearSearch playground for autoClear

autoClear: boolean

If the buffer needs to be cleared before applying the post process. (default: true) Should be set to false if shader will overwrite all previous pixels.

clearColorSearch playground for clearColor

clearColor: Color4

Clear color to use when screen clearing

enablePixelPerfectModeSearch playground for enablePixelPerfectMode

enablePixelPerfectMode: boolean

Enable Pixel Perfect mode where texture is not scaled to be power of 2. Can only be used on a single postprocess or on the last one of a chain. (default: false)

externalTextureSamplerBindingSearch playground for externalTextureSamplerBinding

externalTextureSamplerBinding: boolean

if externalTextureSamplerBinding is true, the "apply" method won't bind the textureSampler texture, it is expected to be done by the "outside" (by the onApplyObservable observer most probably). counter-productive in some cases because if the texture bound by "apply" is different from the currently texture bound, (the one set by the onApplyObservable observer, for eg) some internal structures (materialContext) will be dirtified, which may impact performances

forceFullscreenViewportSearch playground for forceFullscreenViewport

forceFullscreenViewport: boolean

Force the postprocess to be applied without taking in account viewport

heightSearch playground for height

height: number

Height of the texture to apply the post process on

inspectableCustomPropertiesSearch playground for inspectableCustomProperties

inspectableCustomProperties: IInspectable[]

List of inspectable custom properties (used by the Inspector)



nameSearch playground for name

name: string

Name of the PostProcess.

nodeMaterialSourceSearch playground for nodeMaterialSource

nodeMaterialSource: Nullable<NodeMaterial>

Gets the node material used to create this postprocess (null if the postprocess was manually created)

onActivateObservableSearch playground for onActivateObservable

onActivateObservable: Observable<Camera>

An event triggered when the postprocess is activated.

onAfterRenderObservableSearch playground for onAfterRenderObservable

onAfterRenderObservable: Observable<Effect>

An event triggered after rendering the postprocess

onApplyObservableSearch playground for onApplyObservable

onApplyObservable: Observable<Effect>

An event triggered when the postprocess applies its effect.

onBeforeRenderObservableSearch playground for onBeforeRenderObservable

onBeforeRenderObservable: Observable<Effect>

An event triggered before rendering the postprocess

onSizeChangedObservableSearch playground for onSizeChangedObservable

onSizeChangedObservable: Observable<PostProcess>

An event triggered when the postprocess changes its size.

renderTargetSamplingModeSearch playground for renderTargetSamplingMode

renderTargetSamplingMode: number

Sampling mode used by the shader See https://doc.babylonjs.com/classes/3.1/texture

scaleModeSearch playground for scaleMode

scaleMode: number

Scale mode for the post process (default: Engine.SCALEMODE_FLOOR)


uniqueIdSearch playground for uniqueId

uniqueId: number

Gets or sets the unique id of the post process

widthSearch playground for width

width: number

Width of the texture to apply the post process on



  • get aspectRatio(): number


  • The input texture for this post process and the output texture of the previous post process. When added to a pipeline the previous post process will render it's output into this texture and this texture will be used as textureSampler in the fragment shader of this post process.

    Returns RenderTargetWrapper

  • The input texture for this post process and the output texture of the previous post process. When added to a pipeline the previous post process will render it's output into this texture and this texture will be used as textureSampler in the fragment shader of this post process.


    Returns any


  • get isSupported(): boolean



  • set onAfterRender(callback: (efect: Effect) => void): any
  • A function that is added to the onAfterRenderObservable


    • callback: (efect: Effect) => void
        • Parameters

          Returns void

    Returns any


  • set onApply(callback: (effect: Effect) => void): any
  • A function that is added to the onApplyObservable


    • callback: (effect: Effect) => void
        • Parameters

          Returns void

    Returns any


  • set onBeforeRender(callback: (effect: Effect) => void): any
  • A function that is added to the onBeforeRenderObservable


    • callback: (effect: Effect) => void
        • Parameters

          Returns void

    Returns any


  • set onSizeChanged(callback: (postProcess: PostProcess) => void): any


  • get samples(): number
  • set samples(n: number): any
  • Number of sample textures (default: 1)

    Returns number

  • Number of sample textures (default: 1)


    • n: number

    Returns any



activateSearch playground for activate

  • Activates the post process by intializing the textures to be used when executed. Notifies onActivateObservable. When this post process is used in a pipeline, this is call will bind the input texture of this post process to the output of the previous.


    • camera: Nullable<Camera>

      The camera that will be used in the post process. This camera will be used when calling onActivateObservable.

    • Optional sourceTexture: Nullable<InternalTexture>

      The source texture to be inspected to get the width and height if not specified in the post process constructor. (default: null)

    • Optional forceDepthStencil: boolean

      If true, a depth and stencil buffer will be generated. (default: false)

    Returns RenderTargetWrapper

    The render target wrapper that was bound to be written to.

applySearch playground for apply

  • Binds all textures and uniforms to the shader, this will be run on every pass.

    Returns Nullable<Effect>

    the effect corresponding to this post process. Null if not compiled or not ready.

cloneSearch playground for clone

disposeSearch playground for dispose

  • dispose(camera?: Camera): void
  • Disposes the post process.


    • Optional camera: Camera

      The camera to dispose the post process on.

    Returns void

getCameraSearch playground for getCamera

  • Gets the camera which post process is applied to.

    Returns Camera

    The camera the post process is applied to.

getClassNameSearch playground for getClassName

  • getClassName(): string
  • Gets a string identifying the name of the class

    Returns string

    "VRMultiviewToSingleviewPostProcess" string

getEffectSearch playground for getEffect

  • The effect that is created when initializing the post process.

    Returns Effect

    The created effect corresponding the the postprocess.

getEffectNameSearch playground for getEffectName

  • getEffectName(): string
  • Returns the fragment url or shader name used in the post process.

    Returns string

    the fragment url or name in the shader store.

getEngineSearch playground for getEngine

  • Gets the engine which this post process belongs to.

    Returns Engine

    The engine the post process was enabled with.

isReadySearch playground for isReady

  • isReady(): boolean
  • Get a value indicating if the post-process is ready to be used

    Returns boolean

    true if the post-process is ready (shader is compiled)

isReusableSearch playground for isReusable

  • isReusable(): boolean
  • The post process is reusable if it can be used multiple times within one frame.

    Returns boolean

    If the post process is reusable

markTextureDirtySearch playground for markTextureDirty

  • markTextureDirty(): void
  • invalidate frameBuffer to hint the postprocess to create a depth buffer

    Returns void

restoreDefaultInputTextureSearch playground for restoreDefaultInputTexture

  • restoreDefaultInputTexture(): void
  • Since inputTexture should always be defined, if we previously manually set inputTexture, the only way to unset it is to use this function to restore its internal state

    Returns void

serializeSearch playground for serialize

  • serialize(): any
  • Serializes the post process to a JSON object

    Returns any

    the JSON object

setPrePassRendererSearch playground for setPrePassRenderer

  • Sets the required values to the prepass renderer.


    Returns boolean

    true if the pre pass is needed.

shareOutputWithSearch playground for shareOutputWith

  • To avoid multiple redundant textures for multiple post process, the output the output texture for this post process can be shared with another.


    • postProcess: PostProcess

      The post process to share the output with.

    Returns PostProcess

    This post process.


  • updateEffect(defines?: Nullable<string>, uniforms?: Nullable<string[]>, samplers?: Nullable<string[]>, indexParameters?: any, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void, vertexUrl?: string, fragmentUrl?: string): void

Updates the effect with the current post process compile time values and recompiles the shader.


  • Optional defines: Nullable<string>

    Define statements that should be added at the beginning of the shader. (default: null)

  • Optional uniforms: Nullable<string[]>

    Set of uniform variables that will be passed to the shader. (default: null)

  • Optional samplers: Nullable<string[]>

    Set of Texture2D variables that will be passed to the shader. (default: null)

  • Optional indexParameters: any
    The index parameters to be used for babylons include syntax "#include[0..varyingCount]". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx
  • Optional onCompiled: (effect: Effect) => void

    Called when the shader has been compiled.

      • Parameters

        Returns void

  • Optional onError: (effect: Effect, errors: string) => void

    Called if there is an error when compiling a shader.

      • (effect: Effect, errors: string): void
      • Parameters

        • effect: Effect
        • errors: string

        Returns void

  • Optional vertexUrl: string

    The url of the vertex shader to be used (default: the one given at construction time)

  • Optional fragmentUrl: string

    The url of the fragment shader to be used (default: the one given at construction time)

  • Returns void

    useOwnOutputSearch playground for useOwnOutput

    • useOwnOutput(): void
    • Reverses the effect of calling shareOutputWith and returns the post process back to its original state. This should be called if the post process that shares output with this post process is disabled/disposed.

      Returns void

    Static ParseSearch playground for Parse

    • Creates a material from parsed material data


      • parsedPostProcess: any

        defines parsed post process data

      • scene: Scene

        defines the hosting scene

      • rootUrl: string

        defines the root URL to use to load textures

      Returns Nullable<PostProcess>

      a new post process


    • Constructor
    • Property
    • Method
    • Inherited property
    • Inherited method
    • Inherited accessor
    • Property
    • Method
    • Static property
    • Static method