Interface ITextureProcessOperand
channel?: TextureChannel;
colorSpace?: TextureColorSpace;
dispose?: () => void;
factor?: any;
texture: Nullable<BaseTexture>;
}
Properties
Optionalchannel
Optional channel selection applied to the sampled texture value before any factor
multiplication. When omitted or set to TextureChannel.RGBA, the sample is used
as-is. When set to a single channel, that channel's scalar is broadcast to RGB
(or all four components for TextureChannel.A). Only meaningful when texture is set.
Optionalcolor Space
Color space of the texture data. When set to TextureColorSpace.SRGB, the sampled
RGB channels are converted from sRGB to linear space (IEC 61966-2-1) before the channel
swizzle, factor multiplication, and any arithmetic operation. Alpha is always linear.
Defaults to TextureColorSpace.Linear (no conversion). Only meaningful when texture is set.
Optionaldispose
Disposes the texture produced by a processing operation. Only present on results
returned by the texture processing functions. When a result is passed as an operand
to the next operation in a chain, its dispose is called automatically after the
GPU pass completes. Call dispose explicitly on the final result when the texture
is no longer needed (or skip it if transferring ownership to a material).
Optionalfactor
Optional constant RGBA factor. If texture is also set, the sampled value is
multiplied by this factor. If texture is not set, this becomes the constant output.
When omitted and texture is set, defaults to (1, 1, 1, 1) — no scaling.
texture
Texture to sample. When combined with factor, the sampled value is multiplied
component-wise by the factor. Null when the operand or result is a constant.
Represents an operand for a texture processing operation, or the result of one.
As an operand, the value evaluates to a vec4 per texel:
textureonly →sample(texture)factoronly →factor(constant)sample(texture) * factorAs a result returned by a processing function:
textureholds the GPU-processed output;dispose()releases it when no longer needed.factorholds a CPU-folded constant when all inputs were texture-free; nodisposeis set.Results are directly usable as operands to subsequent operations. When a result with a
disposefunction is passed as an operand, the next operation automatically callsdisposeafter consuming it, so intermediate textures are cleaned up without manual tracking.At least one of
textureorfactormust be provided when used as an operand.