Texture Switch Node
The Texture Switch node allows you to dynamically choose between multiple textures based on an Input Value. The input textures' connections are ordered from bottom to top, so that when Interpolate is on, only adjacent neighbors are interpolated. The Input Value is also wrapped, meaning that the last texture is interpolated to the first, and negative values are interpolated in the reverse direction.
Usage
You can add the Texture Switch node to the Schematic viewport using the Add function, found in the pop-up menu under Shader Inputs > Texture Switch. The textures are connected to the node by way of their relationship connection (rather than a texture output channel connected to an input). An input must also be connected to the Input Parameter to determine the switch criteria. This can be a Particle ID feature when used with Replicators (and obviously a particle source of some type) or switched on ray types or surface features, such as normal. For information on working with node graphs, see the Schematic Viewport topic.
Schematic Node: Texture Switch
• Textures: This parameter receives the various relationship inputs from the source nodes. The input texture's connections are ordered from bottom to top, so that when Interpolate is on, only directly adjacent neighbors are interpolated. The Input Value is also wrapped, meaning that the last texture is interpolated to the first, and negative values are interpolated in the reverse direction.
In addition to linking textures as inputs, you can also link groups, and any textures contained within the group is used.
• Interpolate: When disabled, only a single input is expressed in the result, when enabled it acts as a blend between the various inputs.
• Input Value: This is used for the switching criteria. Input Value is only used if Switch is set to Input Value. You can drive the Input Value any way you like, for example, you can drive it with a gradient to control the weighting of the texture choice.
• Switch: This specifies the parameter that is to be used by the switching criteria. By default, it uses the Input Value channel but it can also be set to Particle ID or Surface ID. If the Switch is set to an ID then it uses the ID value from the surface directly and Input Value has no effect. This provides a quick way of using the ID. The range of the input is evenly split according to the number of texture inputs.
Particle ID is expressed as a random value between 0 and 1. This can be used when applying surfacing to a group of replicators. For two inputs this would show the first texture for any IDs between 0.0 - 0.5, and the second texture for any ID between 0.5 - 1.0. For a surface normal input the value switches based on the angle of incidence relative to the camera.
The image below shows the detail from the Properties panel for the Texture Switch node in the diagram above.
Example
In this example, a sphere is cloned using a Replicator and a particle source. The Texture Switch node is output to the surface's Diffuse Color channel and chooses between three possible texture inputs: Grid, Cellular, or Dots. Switch is set to Particle ID, which is a random value between 0 and 1. In the image on the left, with Interpolate off, we see that replicas with ID's between 0 and 1/3 use the Dots texture, between 1/3 and 2/3 use the Cellular texture, and between 2/3 and 1 get the Grid texture. In the image on the right, with Interpolate on, we get a blend of the adjacent textures.