Function TransmissionFractionAsync
-
TransmissionFractionAsync(
name: string,
a: ITextureProcessOperand,
b: ITextureProcessOperand,
scene: Scene,
outputColorSpace?: TextureColorSpace,
outputChannelMask?: ChannelMask,
outputOptions?: ITextureProcessorOutputOptions,
): Promise<ITextureProcessOperand>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: TextureColorSpaceOptional output color space.
OptionaloutputChannelMask: ChannelMaskOptional bitmask of channels to write.
OptionaloutputOptions: ITextureProcessorOutputOptionsOptional render-target type, sampling, and mipmap settings.
Returns Promise<ITextureProcessOperand>
An operand whose
textureholds the GPU result, or whosefactorholds the CPU-folded constant - name: string
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
ais the transmission weight T andbthe subsurface weight S (subsurface covers only the remaining1 - T). The subsurface fraction is1 - result. The denominatorT + S(1 - T)equals1 - (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 withmax(..., 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
disposefunction), their intermediate textures are automatically released after the GPU pass completes.