This page provides information about the Switch Material in V-Ray for Blender.


Overview


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.


Switch Material


Materials


Wrap ID – When enabled, the material IDs are wrapped to the largest specified ID.

+ 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.

Switch Texture The texture that is sampled to switch between the assigned materials.


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 goes to the next available material assigned, skipping empty slots and looping from the beginning.