API

Function TransmissionScatterToSingleScatterAlbedoAsync

  • Recover the single-scatter albedo of an OpenPBR 1.1 transmission volume, scatter / extinction, using the renderer's extinction: the absorption -log(transmissionColor) - transmissionScatter is shifted so its smallest channel is non-negative, and the extinction is recomputed from it. The transmission depth cancels out of the ratio, so both operands are given per unit depth. The result alpha is taken from the scatter operand.

    If both operands are constant (no textures), the operation is performed on the CPU and the result is returned as a factor-only operand with no texture allocated.

    When operands are results of previous operations (i.e. they carry a dispose function), their intermediate textures are automatically released after the GPU pass completes.

    Parameters

    • name: string

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

    • transmissionColor: ITextureProcessOperand

      Linear transmission color operand

    • transmissionScatter: ITextureProcessOperand

      Transmission scatter operand

    • scene: Scene

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

    • OptionaloutputColorSpace: TextureColorSpace

      Optional output color space.

    • OptionaloutputChannelMask: ChannelMask

      Optional bitmask of channels to write.

    • OptionaloutputOptions: ITextureProcessorOutputOptions

      Optional render-target type, sampling, and mipmap settings.

    Returns Promise<ITextureProcessOperand>

    An operand whose texture holds the GPU result, or whose factor holds the CPU-folded constant