This page provides information about the Switch Material in V-Ray for Blender.
Overview
The V-Ray Switch Material can 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.
Node Input Sockets
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.
Materials
Switch – The index used 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:
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:
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 uses the next available material assigned, skipping empty slots and looping from the beginning.
+ Add - – Adds a new material. Clicking on the button removes a material. Each material slot is created with a corresponding ID assigned to it. Change the ID from the arrows.
Material
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 the Round Mode above.
Enabled – Enables the use of IDs for material switching.