VRayMultiSubTex

This page provides information on the Multi Sub-Object Map.

Overview

The VRayMultiSubTex texture allows the user to create a single material, which shows randomized textures (or solid colors), on each object, face, material ID, or based on other modes. The random textures are distributed among all the objects using this map. In the image shown here Get ID from had its type set to Object ID, and each of the Total IDs were given a different color via a VRayColor texture.

UI Path: ||Material Editor window|| > Material/Map Browser > Maps...

||Material Editor window|| > Material/Map Browser > Maps > V-Ray > VRayMultiSubTex


images/download/attachments/60098123/Max2020_VRay5_Textures_UIpath.gif

images/download/attachments/60098123/VRayMultiSubTex.png

Parameters

Get ID from – Specifies the meaning of the ID parameters.

Face material ID – Considers the face IDs of the object when feeding the data (color or texture) to the material.
Object ID – Considers the Object IDs of the object when feeding the data (color or texture) to the material.
Random - Randomly chooses IDs when feeding the data (color or texture) to the material.

Seed – Allows you to change the randomization pattern.

Randomization - This section is active only when the Random mode is selected. Specifies the elements, based on which the colors of the texture will be randomized.

By Name – Generates a color index based on the name of the node that the texture is applied to. This allows the color to remain consistent if the object is merged into another scene, or X-Ref'd etc.
By InstanceID – Assigns random colors based on InstanceID (works for Alembic instances and VRayInstancer source objects).
By Object ID – Assigns random colors based on object's ID.
By Element
– Assigns random colors based on element (e.g. teapot lid, etc.) IDs of the object.
By ParticleID – Assigns random colors based on ParticleID (works for VRayInstancer source objects and Thinking Particles).
By Node Handle – Each node in 3ds Max is assigned a unique number (a handle) when it is created. This option generates the color index based on that node ID. It is useful because the node handle survives through scene editing - e.g. if you add/remove other objects, or rename them, you will still get the same colors.
By Face material ID – Assigns random colors based on material IDs of the object's faces.
By RenderID – Assigns random colors based on RenderIDs.

When using the By Element option to randomize the elements of VRayPoxy, Optimize for instancing in the V-Ray mesh export dialog needs to be turned on before exporting. The V-Ray mesh export menu can be accessed by right-clicking on the viewport and clicking on V-Ray mesh export.

Random Hue/Sat/Gamma – These three parameters control post-process randomization of output color. Input value is percentage of the HSV/gamma range and specifies the maximum random deviation, where gamma range is fixed to [1/10,10]. See the Random Hue/Sat/Gamma example below .

Total IDs – Can be used to set the number of sub-textures.

Delete unused – Deletes disabled slots from the list.

Loop Through Textures This option works with Face material ID and Object ID modes. When the objects assigned with VRayMultiSubTex map have IDs outside the interval of valid sub-texture IDs, the Loop Through Textures option calculates a wrapped version of these IDs that fit in the interval. Then it picks the corresponding sub-texture. For example, if an object with an ID 5 is assigned a VRayMultiSubTex and the interval of valid sub-texture IDs is [1:4], it is looped and is rendered with some of the sub-textures. See the Loop Through Texture example below.

Blend color and texture – When enabled, the alpha of the sub-textures is used to blend between the color for the respective material ID and the texture color. When disabled, the texture alpha is returned directly and the color specified in the VRayMultiSubTex texture itself for the given material ID is ignored.

Default Color – A default color or texture for objects whose IDs cannot be matched with a sub-texture ID (with or without looping). Works only in Face material ID and Object ID modes.

ID (1-20) – Specifies a color or a texture to be assigned to the material when it is assigned on an object with the current ID.

images/download/attachments/60098123/V-RayMultiSubTex.png

Example: Random Hue/Sat/Gamma


The following example shows how the Random Hue/Saturation/Gamma changes the scene. Each example uses the maximum value of 100.

images/download/attachments/60098123/Maya5_Everything0.png

No Random Hue/Sat/Gamma applied

images/download/attachments/60098123/Maya5_Hue100.png

Hue = 100.0

images/download/attachments/60098123/Maya5_Sat100.png

Saturation = 100.0

images/download/attachments/60098123/Maya5_Gamma100.png

Gamma = 100.0

images/download/attachments/60098123/Maya5_Everything100.png

Hue/Sat/Gamma= 100.0

Example: Loop Through Texture

The following example shows how the Loop Through Textures option affects the distribution of a texture applied to five geometries with different IDs.

Here, we have a MultiSubTex map with four sub-textures whose interval of valid IDs is [1 - 4]. We also have five geometries whose IDs range from 1 to 6. The IDs of the first four geometries fall within the texture's interval. The fifth geometry's ID (6) is outside that interval. We also have a default color - red.

When the Loop Through Textures option is disabled, the geometries with valid IDs get a texture of equal ID number. The texture whose ID is 6 gets a default color.

images/download/attachments/60098123/MultiSub_Examples1.png

images/download/attachments/60098123/Max2020_VRay5_VRayMultiSub_disabled.png

When the Loop Through Textures option is enabled, the geometry with ID = 6 is looped and gets the texture with ID = 2.

images/download/attachments/60098123/MultiSub_Examples2.png

images/download/attachments/60098123/Max2020_VRay5_VRayMultiSub_enabled.png

If we uncheck one of the textures, for example texture with ID = 2, V-Ray detects that there is no valid texture for the geometries with IDs = 2 and 6, and it assigns them a default color.

images/download/attachments/60098123/MultiSub_Examples3.png

images/download/attachments/60098123/Max2020_VRay5_VRayMultiSub_unticked.png

MaxScript Access

The VRayMultiSubTex texmaps list can be managed through several exported functions:

addSubtex – Add the specified number of sub-textures.
deleteSubtex – Delete one or more sub-textures. The first parameter is always the index of the first texture slot to delete, the second is the number of textures to delete (if omitted defaults to 1).
deleteUnused – Delete all sub-textures which are disabled from their respective UI button.
texmap_num – Returns the value of the Num IDs parameter.

Methods
<int>texmap_num
<void>addSubtex <integer>count
count Validated by Range: 1 to 255
<void>deleteSubtex <integer> start <integer> count
deleteSubtex has variable number of arguments
start Validated by Range: 0 to 254
count Validated by Range: 1 to texmap_num-start
<void>deleteUnused()