split
split
A fundamental node used to extract, separate, or reorder one or more data channels from a multi-channel vector (e.g., a vec4 color or vec3 coordinate).
Core Advantages
It enables independent operations on specific components of a vector (like the R/G/B channels of a color or the X/Y/Z axes of a position), forming the basis for advanced techniques like channel packing, chromatic aberration, and procedural animation.
Common Uses
Extracting masks from packed textures
Implementing Chromatic Aberration effects
Procedural vertex animation
How to adjust
By changing its `channels` string parameter, you can precisely select which channels to extract (e.g., 'r', 'gb', 'xy') or reorder them (e.g., 'bgr') to achieve channel separation, data restructuring, or swizzling.
Code Examples
1// Extract the green channel (float) from a color vector
2const greenChannel = split( colorNode, 'g' );
3
4// Reorder (swizzle) the channels of a position vector
5const swizzledPos = split( positionNode, 'xzy' );