Function DivideTexturesAsync
-
DivideTexturesAsync(
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
Numerator operand
- b: ITextureProcessOperand
Denominator 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
Component-wise safe division of two texture operands:
result = a / max(b, 0.00001).Each operand can be a texture, a constant factor, or a texture scaled by a factor. Division by zero is guarded with a small epsilon so the result is always finite.
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.