ExtractHighlightsPostProcess | Babylon.js API documentation

API
Babylon.js API documentation
    Preparing search index...

    Class ExtractHighlightsPostProcess

    The extract highlights post process sets all pixels to black except pixels above the specified luminance threshold. Used as the first step for a bloom effect.

    Hierarchy (View Summary)

    Index
    adaptScaleToCurrentViewport: boolean = false

    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

    alwaysForcePOT: boolean = false

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

    animations: Animation[] = []

    Animations to be used for the post processing

    autoClear: boolean = true

    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

    doNotSerialize: boolean = false

    Specifies if the post process should be serialized

    enablePixelPerfectMode: boolean = false

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

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

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

    Force the postprocess to be applied without taking in account viewport

    height: number = -1

    Height of the texture to apply the post process on

    inspectableCustomProperties: IInspectable[]

    List of inspectable custom properties (used by the Inspector)

    nodeMaterialSource: Nullable<NodeMaterial> = null

    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

    onDisposeObservable: Observable<void> = ...

    An event triggered when the post-process is disposed

    onEffectCreatedObservable: Observable<Effect>

    Executed when the effect was created

    effect that was created for this post process

    onSizeChangedObservable: Observable<PostProcess> = ...

    An event triggered when the postprocess changes its size.

    renderTargetSamplingMode: number

    Sampling mode used by the shader

    scaleMode: number = Constants.SCALEMODE_FLOOR

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

    Width of the texture to apply the post process on

    • 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

      • cameraOrScene: Scene | Nullable<Camera>

        The camera that will be used in the post process. This camera will be used when calling onActivateObservable. You can also pass the scene if no camera is available.

      • sourceTexture: Nullable<InternalTexture> = null

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

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

    • Resizes the post-process texture

      Parameters

      • width: number

        Width of the texture

      • height: number

        Height of the texture

      • camera: Nullable<Camera> = null

        The camera this post-process is applied to. Pass null if the post-process is used outside the context of a camera post-process chain (default: null)

      • needMipMaps: boolean = false

        True if mip maps need to be generated after render (default: false)

      • forceDepthStencil: boolean = false

        True to force post-process texture creation with stencil depth and buffer (default: false)

      Returns void

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

    Parameters

  • defines: Nullable<string> = null

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

  • uniforms: Nullable<string[]> = null

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

  • samplers: Nullable<string[]> = null

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

  • OptionalindexParameters: 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
  • OptionalonCompiled: (effect: Effect) => void

    Called when the shader has been compiled.

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

    Called if there is an error when compiling a shader.

  • OptionalvertexUrl: string

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

  • OptionalfragmentUrl: string

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

  • Returns void