|On this page|
Perform an arbitrary permutation of the channels of the input stream, returning a new stream of the specified type. Individual channels may be replicated or omitted, and the output stream may have a different number of channels than the input.
A string of one, two, three or four characters (one per channel in the output), each of which may be 'r', 'g', 'b' or 'a' for colorN inputs, or 'x', 'y', 'z' or 'w' for vectorN inputs. E.g. 'bgra' would output a four-channel stream with the red and blue channels swapped, and 'zzz' would output a three-channel stream with the Z component replicated to all channels. The number of characters in channels must be the same as the number of channels for the swizzle node’s output type, e.g. exactly 2 characters for a swizzle of type 'vector2', or 4 characters for a swizzle of type 'color4'. If the input’s type is 'float', then either 'r' or 'x' may be used interchangeably to represent the one incoming data channel. Default is a string of characters that replicates the first channel from the input into all channels of the output.