Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: typo

...

Section
Column
width55%

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
width5%


Column
width40%

Switch Material

...


Node Input Sockets

...

Section
Column
width50%

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
width5%


Column
width45%

Image Added


Materials

...

Section
Column
width50%

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 the Image Removed button 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 the Image Added button removes a material. Each material slot is created with a corresponding ID assigned to it. Change the ID from the Image Added arrows.

Column
width5%


Column
width45%

Image Added


Material

...

Section
Column
width50%

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 Mode above. 

Enabled – Enables the use of IDs for material switching. 

Column
width5%


Column
width45%

Image Added