API

Function CreateTextureWithFactorOperand

  • Create an operand from a texture multiplied by a constant RGBA factor. This is the standard glTF pattern (e.g. baseColorTexture * baseColorFactor). If texture is null, returns a factor-only operand.

    Parameters

    • texture: Nullable<BaseTexture>

      The texture to sample, or null to use the factor alone

    • factor: Color4

      The constant factor to multiply by

    • Optionalchannel: TextureChannel

      Optional channel selection. When set, the sampled value is swizzled before factor multiplication (e.g. TextureChannel.G → GGGA, then multiplied by factor). Defaults to TextureChannel.RGBA (no swizzle).

    • OptionalcolorSpace: TextureColorSpace

      Optional color space. When TextureColorSpace.SRGB, the sampled RGB channels are linearized before factor multiplication. Defaults to TextureColorSpace.Linear.

    Returns ITextureProcessOperand

    An operand that evaluates to sample(texture) * factor, or factor if texture is null