The V-Ray Switch Material can be used to switch between different materials based on a value sampled from a texture.
Switch Mtl doesn't have a default material. If the switch value points to an empty (undefined) material slot, the resulting shading will use the first valid material (the one with the lowest switch value) specified in the V-Ray Switch Material.
Column
width
5%
Column
width
40%
...
Node Input Sockets
...
Section
Column
width
50%
This section describes the input sockets of the node. The sockets have dedicated parameters, which are further described below.
Switch Texture – This allows a texture node to determine the index for switching between textures.
ID (input socket) – Allows a node to determine the index of the materials.
Column
width
5%
Column
width
45%
Image Added
Materials
...
Section
Column
width
50%
Switch –The index used
Wrap ID – When enabled, the material IDs are wrapped to the largest specified ID.
+ Add - – Adds a new material. Clicking on theImage Removedbutton removes a material. Each material slot is created with a corresponding ID assigned to it. Change the ID from the Image Removed arrows.
Switch Texture –The texture that is sampled to switch between the assigned materials. If the index does not correspond to any connected node, the Round Mode determines which node is sampled.
Round Mode– Determines how to round the switch value.
When Round Nearest is selected, the switch range is taken as follows:
Code Block
ID(x) = [x - 0.5; x + 0.49]
For example, a list of 3 materials will have the following range: Material 1 with ID 1 is assigned for values 0.5 - 1.49; Material 2 with ID 2 is assigned for values 1.5 - 2.49; Material 3 with ID 3 is assigned for values 2.5 - 3.49.
When Round Down is selected, the switch range is taken as follows:
Code Block
ID(x) = [x, x + 0.99]
For example, a list of 3 materials will have the following range: Material 1 with ID 1 is assigned for values 1.0 - 1.99; Material 2 with ID 2 is assigned for values 2.0 - 2.99; Material 3 with ID 3 is assigned for values 3.0 - 3.99.
Loop Materials– If the switch value is out of range, V-Ray goes to uses the next available material assigned, skipping empty slots and looping from the beginning.
+ Add - – Adds a new material. Clicking on theImage Addedbutton removes a material. Each material slot is created with a corresponding ID assigned to it. Change the ID from the Image Added arrows.
Column
width
5%
Column
width
45%
Image Added
Material
...
Section
Column
width
50%
ID – Specifies an ID for the switch. This is the value used to loop the texture through the list of materials. See how V-Ray assigns this value based on theRound Modeabove.
Enabled – Enables the use of IDs for material switching.