API

Function TransmissionFractionAsync

  • Compute the component-wise fraction result = a / (a + b * (1 - a)) in a single GPU pass.

    For OpenPBR this is the transmission fraction of the dielectric's transmitted light, where a is the transmission weight T and b the subsurface weight S (subsurface covers only the remaining 1 - T). The subsurface fraction is 1 - result. The denominator T + S(1 - T) equals 1 - (1 - T)(1 - S) but avoids subtracting values near one, and fusing the whole expression into one pass means no intermediate is quantized; only the final output is. The denominator is guarded with max(..., 0.00001), so the result is 0 where both inputs are 0.

    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)

    • a: ITextureProcessOperand

      Transmission weight operand (T)

    • b: ITextureProcessOperand

      Subsurface weight operand (S)

    • 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