General

Extensions for texture tiles

Mari tiles and the <UDIM> tag

Mudbox tiles and the <UVTILE> tag

The $U and $V tags

Environment variables

User attributes

General

V-Ray allows several different extensions for the names of bitmaps used in the File shading nodes. These are listed below.

Extensions for texture tiles

Some modeling applications allow to specify a different bitmap file for different portions of a model based on the UV coordinates of that model. For example, one file may be used for UVs in the range [0,0]x(1,1), another file may be used for UVs in [1,0]x(2,1) and so on. There are several ways to specify the correct file for each tile, and in each case, a different format for the file name is used in the File node. This is done by using special tags in the file name, which are replaced at render time with a particular string based on the UVs of the current shading point.

 

In the following section, we assume that each UV tile has unique integer coordinates (u,v) based on the integer part of the UVs inside it. For example, the UV tile [0,0]x(1,1) has coordinates (0,0), the UV tile [1,0]x(2,1) has coordinates (1,0) and so on.

 

Upper-case tags usually assume the tile coordinates start from 1, whereas lower-case tags assume the tiles start from 0.

Mari tiles and the <UDIM> tag

Mari forms the file name of textures using a four-digit number equal to 1000+(u+1+v*10). So the UV tile [0,0]x(1,1) is assigned the number 1001, UV tile [0,1]x(1,2) is assigned 1011 and so on. To specify a Mari-style tiled texture, use the <UDIM> tag in the file name, which is then replaced with the respective four digits, for example, my_texture_<UDIM>.exr becomes my_texture_1001.exr and so on during rendering.

Mudbox tiles and the <UVTILE> tag

Mudbox can form the file name in many ways, but the default format is to use _uU_vV in the file name where U=u+1 and V=v+1 are the tile coordinates plus one. So the UV tile [0,0]x(1,1) is marked with _u1_v1, UV tile [0,1]x(1,2) is marked with _u1_v2 and so on. To specify this format, use the <UVTILE> tag in the file name. If you use lower case letters <uvtile>, then the tile coordinates will start from 0, instead of one, so tile [0,0]x(1,1) will be resolved to _u0_v0 and so on. For example, my_texture<UVTILE>.exr becomes my_texture_u1_v1.exr and so on during rendering.

The $U and $V tags

You can also specify the u and v coordinates of the tiles separately by using the $U and $V tags. Each of them is expanded to the respective 1-based coordinate of the tile. For example, if the file name is specified as my_texture_$U_$V.exr, this becomes my_texture_1_1.exr and so on. You can use lower-case tags to make the tile coordinates start from zero, instead of 1, for example my_texture_$u_$v.exr becomes my_texture_0_0.exr and so on.

 

You can put a number right after the $ sign to specify how many digits you want in the resulting tile coordinates, for example my_texture_$2U_$2V.exr is expanded to my_texture_01_01.exr and so on.

Environment variables

You can include environment variables in the form ${VAR_NAME} which are replaced with the value of the respective environment variable during rendering. For example, if the file name is specified as ${TEX_PATH}/${PROJ_FOLDER}/mytexture.exr, then V-Ray will look up the environment variables TEX_PATH and PROJ_FOLDER and replace the tags with their values. Suppose that TEX_PATH is set to c:/textures and PROJ_FOLDER is set to proj1, then the final bitmap file name will be expanded as c:/textures/proj1/mytexture.exr

 

Whether names of environment variables are case-sensitive or not is dependent on the operating system. On Windows, names of environment variables are not case-sensitive. On Linux, the case matters.

User attributes

You can specify user tags between < and > brackets. At render time, V-Ray takes the tag name and looks it up in the V-Ray User Attributes list for the shaded object to determine the value of the tag. This allows a single File node to use different file textures on different scene nodes. For example, you could specify the file name in the File node as /path/to/texture/<objtag>_diffuse.png and then for the objects that use the material, add a V-Ray User Attributes string with values like objtag=head or objtag=body etc. Then during rendering, V-Ray will attempt to load and use the texture file /path/to/texture/head_diffuse.png for the first object and /path/to/texture/body_diffuse.png on the second.