ThinMeshBlendingPostProcess | Babylon.js API documentation

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

    Class ThinMeshBlendingPostProcess

    Shared WebGL2 and WebGPU effect wrapper used to visually blend SceneColor across validated contacts between opaque or alpha-tested meshes.

    The effect does not modify geometry, depth, normals, collisions, or shadows. Transparent rendering is caller-controlled; overlapping transparent surfaces can make SceneColor inconsistent with the single-layer geometry inputs. Meshes opt in with a packed tag whose group is in the range 1..63; group 0 disables blending. Surfaces in the same nonzero group are treated as one logical object and do not blend with one another. The four radius classes combine an authored world-space radius with a minimum radius measured in physical render-target pixels.

    Perspective and orthographic cameras are supported. Search noise is spatially stable and never varies by frame. Optional base-color input enables shadow estimation; without it, the related sampler and shader work are compiled out. The effect does not require or implement TAA.

    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: Nullable<Camera> = null

    Camera used to project radii and reconstruct view-space positions.

    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

    radiusClasses: MeshBlendRadiusDefinitions = ...

    The four configurable radius definitions indexed by packed radius class.

    Both values are projected against the active camera and the physical depth-texture height.

    ForceGLSL: boolean = false

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

    FragmentUrl: "meshBlending"

    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