API

Class ImageProcessingConfiguration

This groups together the common properties used for image processing either in direct forward pass or through post processing effect depending on the use of the image processing pipeline in your scene or not.

Index
colorCurves: Nullable<ColorCurves> = ...

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

onUpdateParameters: Observable<ImageProcessingConfiguration> = ...

An event triggered when the configuration changes and requires Shader to Update some parameters.

outputTextureHeight: number = 0

Height of the output texture used in the post process. If not provided, uses the height of the screen.

outputTextureWidth: number = 0

Width of the output texture used in the post process. If not provided, uses the width of the screen.

vignetteCameraFov: number = 0.5

Camera field of view used by the Vignette effect.

vignetteCenterX: number = 0

Vignette center X Offset.

vignetteCenterY: number = 0

Vignette center Y Offset.

vignetteColor: Color4 = ...

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

vignetteStretch: number = 0

Vignette stretch size.

vignetteWeight: number = 1.5

Vignette weight or intensity of the vignette effect.

PrepareSamplers: (
    samplersList: string[],
    defines: IImageProcessingConfigurationDefines,
) => void = PrepareSamplersForImageProcessing

Prepare the list of samplers associated with the Image Processing effects.

Type Declaration

    • (samplersList: string[], defines: IImageProcessingConfigurationDefines): void
    • Parameters

      • samplersList: string[]

        The list of uniforms used in the effect

      • defines: IImageProcessingConfigurationDefines

        the list of defines currently in use

      Returns void

PrepareUniforms: (
    uniforms: string[],
    defines: IImageProcessingConfigurationDefines,
) => void = PrepareUniformsForImageProcessing

Prepare the list of uniforms associated with the Image Processing effects.

Type Declaration

    • (uniforms: string[], defines: IImageProcessingConfigurationDefines): void
    • Parameters

      • uniforms: string[]

        The list of uniforms used in the effect

      • defines: IImageProcessingConfigurationDefines

        the list of defines currently in use

      Returns void

TONEMAPPING_ACES: 1

ACES Tone mapping (used by default in unreal and unity). This can help getting closer to other engines rendering to increase portability.

TONEMAPPING_KHR_PBR_NEUTRAL: 2

Neutral Tone mapping developped by the Khronos group in order to constrain values between 0 and 1 without shifting Hue.

TONEMAPPING_STANDARD: 0

Default tone mapping applied in BabylonJS.

  • get temperature(): number

    Gets the correlated color temperature, in Kelvin, of the illuminant to neutralize when whiteBalanceEnabled is set to true - i.e. the light the scene is assumed to have been lit with, not a "warm"/"cool" creative adjustment. Lower values (e.g. ~2000-3500 K) correspond to warm/orange sources such as tungsten or candle light; higher values (e.g. ~7000-10000 K) correspond to cool/blue sources such as shade or overcast sky. Clamped to the tabulated range (roughly 1667 K and above) - the getter reflects the clamped value. Default is 6500.

    Returns number

  • set temperature(value: number): void

    Sets the correlated color temperature, in Kelvin, of the illuminant to neutralize when whiteBalanceEnabled is set to true - i.e. the light the scene is assumed to have been lit with, not a "warm"/"cool" creative adjustment. Lower values (e.g. ~2000-3500 K) correspond to warm/orange sources such as tungsten or candle light; higher values (e.g. ~7000-10000 K) correspond to cool/blue sources such as shade or overcast sky. Clamped to the tabulated range (roughly 1667 K and above) - the getter reflects the clamped value. Default is 6500.

    Parameters

    • value: number

    Returns void

  • get tint(): number

    Gets the white balance tint offset used in the effect if whiteBalanceEnabled is set to true, on the green/magenta axis perpendicular to temperature - e.g. to correct for illuminants (such as some fluorescent lights) that a color temperature alone can't fully neutralize. Positive values shift the corrected image toward magenta (compensating a green-tinted illuminant); negative values shift it toward green (compensating a magenta-tinted illuminant). Clamped to [-150, 150] - the getter reflects the clamped value. Default is 0 (no tint offset).

    Returns number

  • set tint(value: number): void

    Sets the white balance tint offset used in the effect if whiteBalanceEnabled is set to true, on the green/magenta axis perpendicular to temperature - e.g. to correct for illuminants (such as some fluorescent lights) that a color temperature alone can't fully neutralize. Positive values shift the corrected image toward magenta (compensating a green-tinted illuminant); negative values shift it toward green (compensating a magenta-tinted illuminant). Clamped to [-150, 150] - the getter reflects the clamped value. Default is 0 (no tint offset).

    Parameters

    • value: number

    Returns void

  • Prepare the list of defines associated to the shader.

    Parameters

    • defines: IImageProcessingConfigurationDefines

      the list of defines to complete

    • forPostProcess: boolean = false

      Define if we are currently in post process mode or not

    Returns void