Function TransmissionScatterToSingleScatterAlbedoAsync
-
TransmissionScatterToSingleScatterAlbedoAsync(
name: string,
transmissionColor: ITextureProcessOperand,
transmissionScatter: 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)
- 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: 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
Recover the single-scatter albedo of an OpenPBR 1.1 transmission volume,
scatter / extinction, using the renderer's extinction: the absorption-log(transmissionColor) - transmissionScatteris 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
disposefunction), their intermediate textures are automatically released after the GPU pass completes.