ThinCircleOfConfusionPostProcess | Babylon.js API documentation

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

    Class ThinCircleOfConfusionPostProcess

    Post process used to calculate the circle of confusion (used for depth of field, for example)

    Hierarchy (View Summary)

    Index
    alphaMode: number = Constants.ALPHA_DISABLE

    Type of alpha mode to use when applying the effect (default: Engine.ALPHA_DISABLE). Used only if useAsPostProcess is true.

    camera: Camera

    The camera to use to calculate the circle of confusion

    focalLength: number = 50

    Focal length of the effect's camera in scene units/1000 (eg. millimeter). (default: 50)

    focusDistance: number = 2000

    Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)

    fStop: number = 1.4

    F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)

    lensSize: number = 50

    Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.

    onApplyObservable: Observable<{}> = ...

    Event that is fired (only when the EffectWrapper is used with an EffectRenderer) right before the effect is drawn (should be used to update uniforms)

    onEffectCreatedObservable: Observable<Effect> = ...

    Executed when the effect is created

    effect that was created for this effect wrapper

    Options used to create the effect wrapper

    DefinesDepthNotNormalized: "#define COC_DEPTH_NOT_NORMALIZED"

    Defines if the depth is normalized or not

    ForceGLSL: boolean = false

    Force code to compile to glsl even on WebGPU engines. False by default. This is mostly meant for backward compatibility.

    FragmentUrl: "circleOfConfusion"

    The fragment shader url

    Samplers: string[] = ...

    The list of samplers used by the effect

    Uniforms: string[] = ...

    The list of uniforms used by the effect

    Updates the effect with the current effect wrapper 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