Function LerpTexturesAsync
-
LerpTexturesAsync(
name: string,
a: ITextureProcessOperand,
b: ITextureProcessOperand,
t: 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
Start value operand (returned when t = 0)
- b: ITextureProcessOperand
End value operand (returned when t = 1)
- t: ITextureProcessOperand
Blend weight operand. Each channel independently controls the blend for the corresponding output channel.
- scene: Scene
Scene to create the texture in (used only when a GPU pass is needed)
OptionaloutputColorSpace: TextureColorSpaceOptional output color space. When
TextureColorSpace.SRGB, the linear result is converted to sRGB (IEC 61966-2-1) before being written. Defaults toTextureColorSpace.Linear.OptionaloutputChannelMask: ChannelMaskOptional bitmask of channels to write. Excluded color channels are set to
0.0; excluded alpha is set to1.0. Defaults toChannelMask.RGBA(all channels written).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
Linearly interpolate between two texture operands:
result = mix(a, b, t).Each operand can be a texture, a constant factor, or a texture scaled by a factor. The
toperand controls the blend weight per texel, per channel — a value of 0 returnsa, a value of 1 returnsb. Use a grayscale texture or a scalarColor4(v, v, v, v)for uniform blending across all channels.If all three operands are constant (no textures), the interpolation 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.