CLASSES
TagsA - Z

PostProcess

PostProcess

Description

class PostProcess

Postprocesses allow you to create 2D effects on top of your scene.

A postprocess is linked to a camera and can be part of a chain of postprocesss where each postprocess use the result of the previous one as input for its own processing.

A tutorial about post process can be found here : https://doc.babylonjs.com/tutorials/how_to_use_postprocessrenderpipeline

Constructor

new PostProcess(name, fragmentUrl, parameters, samplers, options, PostProcessOptions, camera, samplingMode, engine, reusable, defines, textureType)

Parameters

Name Type Description
name string The postprocess name
fragmentUrl string The URL of .fragment.fx file where you will code the GLSL shader used for every pixel of the screen
parameters string[] A list of your uniforms parameters
samplers string[] A list of additionnal samplers
options number or PostProcessOptions
camera Camera The given camera
optional samplingMode number Texture.NEAREST_SAMPLINGMODE, Texture.BILINEAR_SAMPLINGMODE or Texture.TRILINEAR_SAMPLINGMODE
optional engine Engine The engine to attach the postprocess.
optional reusable boolean Indicates if the postprocess can be reused multiple times on the same camera
optional defines string

Members

name : string

width : number

default : -1

height : number

default : -1

renderTargetSamplingMode : number

default : Texture.NEAREST_SAMPLINGMODE

Other possible values : Texture.BILINEAR_SAMPLINGMODE, Texture.TRILINEAR_SAMPLINGMODE

clearColor : Color4

enablePixelPerfectMode : boolean

onActivateObservable : Observable<Camera>

An event triggered when the postprocess is activated.

@type {BABYLON.Observable}

onActivate : (camera: Camera) => void

Action to execute just before the postprocess is activated

onSizeChangedObservable : Observable<PostProcess>

An event triggered when the postprocess changes its size.

@type {BABYLON.Observable}

onSizeChanged : (postProcess: PostProcess) => void

Action to execute just before the postprocess' size is changed

onApplyObservable : Observable<Effect>

An event triggered when the postprocess applies its effect.

@type {BABYLON.Observable}

onApply : (effect: Effect) => void

Action to execute just before the postprocess is applied

onBeforeRenderObservable : Observable<Effect>

An event triggered before rendering the postprocess

@type {BABYLON.Observable}

onBeforeRender : (effect: Effect) => void

Action to execute just before the postprocess is rendered

onAfterRenderObservable : Observable<Effect>

An event triggered after rendering the postprocess

@type {BABYLON.Observable}

onAfterRender : (efect: Effect) => void

isSupported : boolean

Methods

updateEffect(defines) → void

Parameters

Name Type Description
optional defines string

isReusable() → boolean

Tests if the Postprocess is set to reusable

markTextureDirty() → void

activate(camera, sourceTexture) → void

Activates this postprocess to the given camera

Parameters

Name Type Description
camera Camera The given camera
optional sourceTexture WebGLTexture Optional textures to add

apply() → Effect

Applies this postprocess

dispose(camera) → void

Parameters

Name Type Description
optional camera Camera The given camera