Switch

Routes one of its inputs to one of its outputs, chosen by index.

Outputs

NameTypeDescription
Output [0, 1, …][Data Type]The outputs to choose between, all of the chosen data type. Output Count sets how many there are.

Inputs

NameTypeDescription
Input [0, 1, …][Data Type]The inputs to choose between, all of the chosen data type. Input Count sets how many there are.

Parameters

NameTypeDescription
Data TypeEnumWhat the inputs and outputs carry. The choices are all data types ZigZag knows.
Input CountIntHow many inputs there are, from 1 to 8.
Output CountIntHow many outputs there are, from 1 to 8.
Active InputIntWhich input is passed through, counting from 0.
Active OutputIntWhich output receives it, counting from 0.
Clear OutputsBoolWhether the outputs that are not active are emptied.

Switch routes data from one of its inputs to one of its outputs. All inputs and outputs carry the same data type, and two indices pick which input and which output are active. Whatever arrives at the active input is passed on to the active output, unchanged. An index past the last port routes nothing.

Changing a count adds or removes ports at the end, so the other ports keep their connections. Changing the data type replaces every port, and all connections are lost.

With Clear Outputs on, every output except the active one carries nothing. With it off, each output keeps the last thing it received until it is chosen again. With large textures this can cost a lot of memory, because every output holds on to a texture of its own.

Keywords: select, route, multiplexer, choose