Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Properties

adaptScaleToCurrentViewport: boolean

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

alphaConstants: Color4

Sets the setAlphaBlendConstants of the babylon engine

alphaMode: number

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

alwaysForcePOT: boolean

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

animations: Animation[]

Animations to be used for the post processing

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.

clearColor: Color4

Clear color to use when screen clearing

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)

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

forceAutoClearInAlphaMode: boolean

If clearing the buffer should be forced in autoClear mode, even when alpha mode is enabled (default: false). By default, the buffer will only be cleared if alpha mode is disabled (and autoClear is true).

forceFullscreenViewport: boolean

Force the postprocess to be applied without taking in account viewport

height: number

Height of the texture to apply the post process on

inspectableCustomProperties: IInspectable[]

List of inspectable custom properties (used by the Inspector)

see

https://doc.babylonjs.com/toolsAndResources/inspector#extensibility

name: string

Name of the PostProcess.

nodeMaterialSource: Nullable<NodeMaterial>

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

onActivateObservable: Observable<Camera>

An event triggered when the postprocess is activated.

onAfterRenderObservable: Observable<Effect>

An event triggered after rendering the postprocess

onApplyObservable: Observable<Effect>

An event triggered when the postprocess applies its effect.

onBeforeRenderObservable: Observable<Effect>

An event triggered before rendering the postprocess

onSizeChangedObservable: Observable<PostProcess>

An event triggered when the postprocess changes its size.

renderTargetSamplingMode: number

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

scaleMode: number

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

ValueTypeDescription
1SCALEMODE_FLOORengine.scalemode_floor
2SCALEMODE_NEARESTengine.scalemode_nearest
3SCALEMODE_CEILINGengine.scalemode_ceiling
uniqueId: number

Gets or sets the unique id of the post process

width: number

Width of the texture to apply the post process on

Accessors

  • get aspectRatio(): number
  • The aspect ratio of the output texture.

    Returns number

  • Gets Color curves setup used in the effect if colorCurvesEnabled is set to true .

    Returns Nullable<ColorCurves>

  • Sets Color curves setup used in the effect if colorCurvesEnabled is set to true .

    Parameters

    Returns void

  • get colorCurvesEnabled(): boolean
  • set colorCurvesEnabled(value: boolean): void
  • Gets whether the color curves effect is enabled.

    Returns boolean

  • Sets whether the color curves effect is enabled.

    Parameters

    • value: boolean

    Returns void

  • get colorGradingEnabled(): boolean
  • set colorGradingEnabled(value: boolean): void
  • Gets whether the color grading effect is enabled.

    Returns boolean

  • Gets whether the color grading effect is enabled.

    Parameters

    • value: boolean

    Returns void

  • Gets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.

    Returns Nullable<BaseTexture>

  • Sets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.

    Parameters

    Returns void

  • get contrast(): number
  • set contrast(value: number): void
  • Gets contrast used in the effect.

    Returns number

  • Sets contrast used in the effect.

    Parameters

    • value: number

    Returns void

  • get ditheringEnabled(): boolean
  • set ditheringEnabled(value: boolean): void
  • Gets whether the dithering effect is enabled.

    Returns boolean

  • Sets whether the dithering effect is enabled.

    Parameters

    • value: boolean

    Returns void

  • get ditheringIntensity(): number
  • set ditheringIntensity(value: number): void
  • Gets intensity of the dithering effect.

    Returns number

  • Sets intensity of the dithering effect.

    Parameters

    • value: number

    Returns void

  • get exposure(): number
  • set exposure(value: number): void
  • Gets exposure used in the effect.

    Returns number

  • Sets exposure used in the effect.

    Parameters

    • value: number

    Returns void

  • get fromLinearSpace(): boolean
  • set fromLinearSpace(value: boolean): void
  • Gets whether the input of the processing is in Gamma or Linear Space.

    Returns boolean

  • Sets whether the input of the processing is in Gamma or Linear Space.

    Parameters

    • value: boolean

    Returns void

  • Gets the image processing configuration used either in this material.

    Returns ImageProcessingConfiguration

  • Sets the Default image processing configuration used either in the this material.

    If sets to null, the scene one is in use.

    Parameters

    Returns void

  • 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.

    Parameters

    Returns void

  • get isSupported(): boolean
  • If the post process is supported.

    Returns boolean

  • A function that is added to the onActivateObservable

    Parameters

    Returns void

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

    Parameters

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

    Returns void

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

    Parameters

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

    Returns void

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

    Parameters

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

    Returns void

  • set onSizeChanged(callback: ((postProcess: PostProcess) => void)): void
  • A function that is added to the onSizeChangedObservable

    Parameters

    Returns void

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

    Returns number

  • Number of sample textures (default: 1)

    Parameters

    • n: number

    Returns void

  • get toneMappingEnabled(): boolean
  • set toneMappingEnabled(value: boolean): void
  • Gets whether tonemapping is enabled or not.

    Returns boolean

  • Sets whether tonemapping is enabled or not

    Parameters

    • value: boolean

    Returns void

  • get toneMappingType(): number
  • set toneMappingType(value: number): void
  • Gets the type of tone mapping effect.

    Returns number

  • Sets the type of tone mapping effect.

    Parameters

    • value: number

    Returns void

  • get vignetteBlendMode(): number
  • set vignetteBlendMode(value: number): void
  • Gets the vignette blend mode allowing different kind of effect.

    Returns number

  • Sets the vignette blend mode allowing different kind of effect.

    Parameters

    • value: number

    Returns void

  • get vignetteCameraFov(): number
  • set vignetteCameraFov(value: number): void
  • Gets Camera field of view used by the Vignette effect.

    Returns number

  • Sets Camera field of view used by the Vignette effect.

    Parameters

    • value: number

    Returns void

  • get vignetteCenterX(): number
  • set vignetteCenterX(value: number): void
  • Vignette center X Offset.

    Returns number

  • Vignette center X Offset.

    Parameters

    • value: number

    Returns void

  • get vignetteCenterY(): number
  • set vignetteCenterY(value: number): void
  • Vignette center Y Offset.

    Returns number

  • Vignette center Y Offset.

    Parameters

    • value: number

    Returns void

  • get vignetteCentreX(): number
  • set vignetteCentreX(value: number): void
  • Gets Vignette center X Offset.

    deprecated

    use vignetteCenterX instead

    Returns number

  • Sets Vignette center X Offset.

    deprecated

    use vignetteCenterX instead

    Parameters

    • value: number

    Returns void

  • get vignetteCentreY(): number
  • set vignetteCentreY(value: number): void
  • Gets Vignette center Y Offset.

    deprecated

    use vignetteCenterY instead

    Returns number

  • Sets Vignette center Y Offset.

    deprecated

    use vignetteCenterY instead

    Parameters

    • value: number

    Returns void

  • get vignetteColor(): Color4
  • set vignetteColor(value: Color4): void
  • Gets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode) if vignetteEnabled is set to true.

    Returns Color4

  • Sets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode) if vignetteEnabled is set to true.

    Parameters

    Returns void

  • get vignetteEnabled(): boolean
  • set vignetteEnabled(value: boolean): void
  • Gets whether the vignette effect is enabled.

    Returns boolean

  • Sets whether the vignette effect is enabled.

    Parameters

    • value: boolean

    Returns void

  • get vignetteStretch(): number
  • set vignetteStretch(value: number): void
  • Gets Vignette stretch size.

    Returns number

  • Sets Vignette stretch size.

    Parameters

    • value: number

    Returns void

  • get vignetteWeight(): number
  • set vignetteWeight(value: number): void
  • Gets Vignette weight or intensity of the vignette effect.

    Returns number

  • Sets Vignette weight or intensity of the vignette effect.

    Parameters

    • value: number

    Returns void

Methods

  • 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.

    Parameters

    • 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.

  • 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.

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

    Parameters

    Returns void

  • Gets the camera which post process is applied to.

    Returns Camera

    The camera the post process is applied to.

  • getClassName(): string
  • "ImageProcessingPostProcess"

    Returns string

    "ImageProcessingPostProcess"

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

    Returns Effect

    The created effect corresponding the the postprocess.

  • 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.

  • Gets the engine which this post process belongs to.

    Returns Engine

    The engine the post process was enabled with.

  • 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)

  • 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

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

    Returns void

  • 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

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

    Returns any

    the JSON object

  • Sets the required values to the prepass renderer.

    Parameters

    Returns boolean

    true if the pre pass is needed.

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

    Parameters

    • 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.

Parameters

  • 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.

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

    Called if there is an error when compiling a shader.

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

        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

    • 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

    • Creates a material from parsed material data

      Parameters

      • 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

    • Registers a shader code processing with a post process name.

      Parameters

      • postProcessName: Nullable<string>

        name of the post process. Use null for the fallback shader code processing. This is the shader code processing that will be used in case no specific shader code processing has been associated to a post process name

      • Optional customShaderCodeProcessing: PostProcessCustomShaderCodeProcessing

        shader code processing to associate to the post process name

      Returns void

    Legend

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

    Settings

    Theme