API

Function MultiScatterToSingleScatterAlbedoAsync

  • Convert a multi-scatter albedo operand to single-scatter albedo using the OpenPBR/KHR approximation. RGB is clamped to [0, 1] before conversion and alpha is preserved.

    If the operand is constant, the conversion is performed on the CPU. Otherwise it is baked into a linear procedural texture. Input color-space conversion, channel selection, factors, UV transforms, metadata propagation, and intermediate disposal follow the other unary texture processor operations.

    Parameters

    • name: string

      Name for the resulting procedural texture (used only when a GPU pass is needed)

    • input: ITextureProcessOperand

      Multi-scatter albedo operand to convert

    • scene: Scene

      Scene to create the texture in (used only when a GPU pass is needed)

    • aniso: number = 0

      Scattering anisotropy in [-1, 1]. 0 (default) is isotropic; positive values are forward-scattering. Matches multiScatterToSingleScatterAlbedo(rho_ms, aniso) in helperFunctions. Clamped to [-0.9999, 0.9999], as in the renderer.

    • Optionalscale: ITextureProcessOperand

      Optional operand multiplied into input (RGBA) before conversion, in the same pass. Use it instead of a separate MultiplyTexturesAsync so that the product (e.g. scatter strength times multi-scatter color) isn't quantized before the nonlinear conversion.

    Returns Promise<ITextureProcessOperand>

    An operand containing the converted single-scatter albedo