API

Function MultiplyTexturesAsync

  • Multiply two texture operands together, component-wise: result = a * b.

    Each operand can be a texture, a constant factor, or a texture scaled by a factor. This is useful for applying glTF-style factors to textures (e.g. baseColorTexture * baseColorFactor), or for modulating one texture by another.

    If both operands are constant (no textures), the multiplication 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

      First operand

    • b: ITextureProcessOperand

      Second operand

    • scene: Scene

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

    • OptionaloutputColorSpace: TextureColorSpace

      Optional output color space. When TextureColorSpace.SRGB, the linear result is converted to sRGB (IEC 61966-2-1) before being written. Defaults to TextureColorSpace.Linear.

    • OptionaloutputChannelMask: ChannelMask

      Optional bitmask of channels to write. Excluded color channels are set to 0.0; excluded alpha is set to 1.0. Defaults to ChannelMask.RGBA (all channels written).

    • 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