---
title: "Utility Materials"
canonical: "https://documentation.chaos.com/space/APPSDK/132781340/Utility%20Materials"
format: markdown
---
## **V-Ray 2 Sided Material**

---

V-Ray 2 Sided Material is translucent material intended to simulate thin bodies - little or no volume. It's not a separate material but a utility node - it allows other materials to inherit its qualities. It will enable the light to flow bidirectionally through the object. The types of objects simulated with it include paper, thin fabric, curtains, blinds, and leaves. It's pretty fast to render, making it useful for translucent objects.

### Opaque

![image](media://3df962c2-a79d-43ce-b095-bb0e35abf998)

See the comments in the "2Sided Simple.vrscene" file from the [scene bundle.](https://drive.google.com/file/d/1y6RrXhhgpQsDleNcRet3dzfyUY9G54C8/view?usp=sharing)

### Translucent

![image](media://c531bac1-5b14-4cdc-b15b-d924b74b45f1)

See the comments in the "2Sided Translucent.vrscene" file from the [scene bundle](https://drive.google.com/file/d/1y6RrXhhgpQsDleNcRet3dzfyUY9G54C8/view?usp=sharing).

### Parameters

The main plugin of interest is called *Mtl2Sided*.

- **front** - this material will be used for front-side faces as defined by the object normals.
- **back** - this is the material V-Ray will use for back side faces as defined by their normals.
- **translucency** determines which side (front or back) relative to the camera is more visible in the rendering process. By default, this value is 0.5, which means that both the side facing the camera and the one facing away from it will be visible to the same degree. When this parameter is closer to 0.0, more of the material facing the camera will be seen. When closer to 1.0, more of the back material is seen.
- **force_1sided** - when it is on (the default), the sub-materials will be rendered as one-sided materials. Turning this option off is not recommended.


## **V-Ray Blend Material**

---

*BRDFLayered* can be used to layer several V-Ray compatible materials efficiently. It can be used to create complex materials like car paints, human skin (when used with *VRayFastSSS*, which we'll discuss later as a base material), etc.

An advantage of *BRDFLayered* is that you can use the VRayMtl Select render element to split the different sub-materials of BRDFLayered into different render elements.

*BRDFLayered* takes a base material and applies other materials (coatings) on top of it. This works like a stack, where each coat material blends between its shading and that of the materials below it in the stack.

To use it, we need the *BRDFLayered* plugin, which contains a collection of brdfs and weights to blend them.

### Parameters

- **brdfs** - List of [BRDF](https://docs-chaos.atlassian.net/wiki/spaces/APPSDK/pages/132781024)s to blend.
- **weights** - List of weights to multiply the contribution of each BRDF. The indices in this list correspond to the indices in the previous one.
- **opacities **– The opacity of each coat texture.
- **additive_mode** - Whether to enable Additive (Shellac) mode. Shellac material mixes two materials by superimposing one over the other. We can produce an over-burnt color in this mode, and the results are not physically realistic.
- **channels** - List of render channels the result of this BRDF will be written to.

### Examples

Here's an example of the Shellac mode mixing:

![image](media://ca3deca2-998d-44b2-b36d-2b7e130bd119)

### **Code example**


<details>
<summary>Python</summary>

```python
# Load scene from a file.
renderer.load(os.path.join(SCENE_PATH, 'material.vrscene'))

# Create a bitmap buffer which can load data from a file
newBitmap = renderer.classes.BitmapBuffer()
newBitmap.file = os.path.join('assets', 'bricks01.jpg')

# TexBitmap is used for file-based texturing. Other Tex{*} plugins offer procedural and combination textures
newTexture = renderer.classes.TexBitmap()
# Set the texture to use the loaded buffer
newTexture.bitmap = newBitmap

# Create a new BRDFVRayMtl
diffuseBRDF = renderer.classes.BRDFVRayMtl()
# We specify a bricks texture
diffuseBRDF.diffuse = newTexture

# Create a new BRDFVRayMtl
reflectBRDF = renderer.classes.BRDFVRayMtl()
# We also make the material reflective with white color, semi-transparent
reflectBRDF.diffuse = vray.AColor(1.0, 0.0, 0.0, 0.5)
reflectBRDF.reflect = vray.AColor(1.0, 1.0, 1.0, 0.5)

# Create a new BRDFLayered material
newMaterial = renderer.classes.BRDFLayered()
# Assign the previously created BRDFs
newMaterial.brdfs = [diffuseBRDF, reflectBRDF]
# Assign equal weights for blending them
newMaterial.weights = [vray.AColor(0.5, 0.5, 0.5), vray.AColor(0.5, 0.5, 0.5)]

newNode = renderer.classes.Node()
newNode.material = newMaterial
newNode.geometry = renderer.plugins['CubeShape@mesh2']
newNode.transform = vray.Transform(vray.Matrix(1), vray.Vector(-15, 0, 0))
```
</details>

<details>
<summary>C++</summary>

```c++
// Load scene from a file.
renderer.load("material.vrscene");

// Create a bitmap buffer which can load data from a file
BitmapBuffer newBitmap = renderer.newPlugin<BitmapBuffer>();
newBitmap.set_file("assets" PATH_DELIMITER "bricks01.jpg");

// TexBitmap is used for file-based texturing. Other Tex{*} plugins offer procedural and combination textures
TexBitmap newTexture = renderer.newPlugin<TexBitmap>();
// Set the texture to use the loaded buffer
newTexture.set_bitmap(newBitmap);

// Create a new BRDFVRayMtl
BRDFVRayMtl diffuseBRDF = renderer.newPlugin<BRDFVRayMtl>();
// We specify a bricks texture
diffuseBRDF.set_diffuse(newTexture);

// Create a new BRDFVRayMtl
BRDFVRayMtl reflectBRDF = renderer.newPlugin<BRDFVRayMtl>();
// We also make the material reflective with white color, semi-transparent
reflectBRDF.set_diffuse(AColor(1.0f, 0.0f, 0.0f, 0.5f));
reflectBRDF.set_reflect(AColor(1.0f, 1.0f, 1.0f, 0.5f));

// Create a new BRDFLayered material
BRDFLayered newMaterial = renderer.newPlugin<BRDFLayered>();
ValueList brdfsList;
brdfsList.push_back(Value(diffuseBRDF));
brdfsList.push_back(Value(reflectBRDF));
// Assign the previously created BRDFs
newMaterial.set_brdfs(brdfsList);
ValueList weightsList;
weightsList.push_back(Value(AColor(0.5f, 0.5f, 0.5f)));
weightsList.push_back(Value(AColor(0.5f, 0.5f, 0.5f)));
// Assign equal weights for blending them
newMaterial.set_weights(weightsList);

Node newNode = renderer.newPlugin<Node>();
newNode.set_material(newMaterial);
newNode.set_geometry(renderer.getPlugin("CubeShape@mesh2"));
newNode.set_transform(Transform(Matrix(1), Vector(-15, 0, 0)));
```
</details>

<details>
<summary>C#.NET</summary>

```csharp
// Load scene from a file.
renderer.Load("material.vrscene");

// Create a bitmap buffer which can load data from a file
BitmapBuffer newBitmap = renderer.NewPlugin<BitmapBuffer>();
newBitmap.File = Path.Combine("assets", "bricks01.jpg");

// TexBitmap is used for file-based texturing. Other Tex{*} plugins offer procedural and combination textures
TexBitmap newTexture = renderer.NewPlugin<TexBitmap>();
// Set the texture to use the loaded buffer
newTexture.Bitmap = newBitmap;

// Create a new BRDFVRayMtl
BRDFVRayMtl diffuseBRDF = renderer.NewPlugin<BRDFVRayMtl>();
// We specify a bricks texture
diffuseBRDF.Diffuse = newTexture;

// Create a new BRDFVRayMtl
BRDFVRayMtl reflectBRDF = renderer.NewPlugin<BRDFVRayMtl>();
// We also make the material reflective with white color, semi-transparent
reflectBRDF.Diffuse = new AColor(1.0f, 0.0f, 0.0f, 0.5f);
reflectBRDF.Reflect = new AColor(1.0f, 1.0f, 1.0f, 0.5f);

// Create a new BRDFLayered material
BRDFLayered newMaterial = renderer.NewPlugin<BRDFLayered>();
// Assign the previously created BRDFs
newMaterial.Brdfs = new object[] { diffuseBRDF, reflectBRDF };
// Assign equal weights for blending them
newMaterial.Weights = new object[] { new AColor(0.5f, 0.5f, 0.5f), new AColor(0.5f, 0.5f, 0.5f) };

Node newNode = renderer.NewPlugin<Node>();
newNode.Material = newMaterial;
newNode.Geometry = renderer.GetPlugin("CubeShape@mesh2");
newNode.Transform = new Transform(new Matrix(1), new Vector(-15, 0, 0));
```
</details>

<details>
<summary>Node.js</summary>

```javascript
// Load scene from a file synchronously.
renderer.loadSync("material.vrscene");

// Create a bitmap buffer which can load data from a file
var newBitmap = renderer.classes.BitmapBuffer();
newBitmap.file = path.join("assets", "bricks01.jpg");
  
// TexBitmap is used for file-based texturing. Other Tex{*} plugins offer procedural and combination textures
var newTexture = renderer.classes.TexBitmap();
// Set the texture to use the loaded buffer
newTexture.bitmap = newBitmap;
  
// Create a new BRDFVRayMtl
var diffuseBRDF = new renderer.classes.BRDFVRayMtl();
// We specify a bricks texture
diffuseBRDF.diffuse = newTexture;
  
// Create a new BRDFVRayMtl
var reflectBRDF = new renderer.classes.BRDFVRayMtl();
// We also make the material reflective with white color, semi-transparent
reflectBRDF.diffuse = new vray.AColor(1.0, 0.0, 0.0, 0.5);
reflectBRDF.reflect = new vray.AColor(1.0, 1.0, 1.0, 0.5);
  
// Create a new BRDFLayered material
var newMaterial = new renderer.classes.BRDFLayered();
// Assign the previously created BRDFs
newMaterial.brdfs = [diffuseBRDF, reflectBRDF];
// Assign equal weights for blending them
newMaterial.weights = [new vray.AColor(0.5, 0.5, 0.5), new vray.AColor(0.5, 0.5, 0.5)];

var newNode = renderer.classes.Node();
newNode.material = newMaterial;
newNode.geometry = renderer.plugins["CubeShape@mesh2"];
newNode.transform = vray.Transform(vray.Matrix(1), vray.Vector(-15, 0, 0));


```
</details>


## **MtlMulti (V-Ray Switch Material)**

---

<span style="color: #272727">MtlMulti can switch between different materials based on a value sampled from a texture. </span>Use this material together with `GeomStaticMesh::face_mtlIDs` to set different materials for subsets of triangles on one geometric object.


- **mtls **(deprecated) – A list of two-element lists with the material id and the material plugin.
- **mtls_list **– <span style="color: #272727">Materials to be used based on the switch texture's value.</span>
- <span style="color: #272727">**volumes_list **</span><span style="color: #272727">– A list of volumes.</span>
- <span style="color: #272727">**ids_list **</span><span style="color: #272727">– A list of material IDs for the matching elements of mtls_list.</span>
- <span style="color: #272727">**shader_sets_list**</span><span style="color: #272727"> – A list of shader set names to be matched to the materials. On GPU, this only works with one geometry per material.</span>
- <span style="color: #272727">**use_shader_set_patterns **</span><span style="color: #272727">– Allow the use of wildcard patterns in shader_sets_list. On GPU, this only works with one geometry per material.</span>
- <span style="color: #272727">**mtlid_gen **</span><span style="color: #272727">– An integer texture that generates material ids; if not present, neither mtlid_gen_float is present then surface material id will be used.</span>
- <span style="color: #272727">**mtlid_gen_float **</span><span style="color: #272727">– A float texture that generates material ids; if not present, neither mtlid_gen is present then surface material id will be used.</span>
- <span style="color: #272727">**mtlid_gen_float_round_mode **</span><span style="color: #272727">– Use this option to round the values returned by '</span><span style="color: #272727">**mtlid_gen_float**</span><span style="color: #272727">' when converting them to an integer.</span>
- <span style="color: #272727">**wrap_id **</span><span style="color: #272727">– </span><span style="color: #272727">**True **</span><span style="color: #272727">to wrap the material ID's to the largest specified ID for the material.</span>
- <span style="color: #272727">**scene_name **</span><span style="color: #272727">– A list of string identifying the original scene node name for which this VRay Plugin was generated. The first string is directly the node name.</span>
- <span style="color: #272727">**channels **</span><span style="color: #272727">– Render channels in which the result of this BRDF will be written to.</span>


## **MtlWrapper**

---

<span style="color: #272727">The VRayMtlWrapper can be used to specify additional surface properties per material.</span>


- **base_material **– <span style="color: #272727">Specifies the actual surface material.</span>
- <span style="color: #272727">**use_irrad_map **</span><span style="color: #272727">– When enabled, the Irradiance Map approximates diffuse indirect illumination for the material. If this is off, brute force GI is used. You can use this for objects in the scene that have small details and are not approximated very well by the Irradiance Map.</span><span style="color: #272727">** **</span>
- <span style="color: #272727">**generate_gi **</span><span style="color: #272727">– Controls the GI generated by the material.</span>
- <span style="color: #272727">**receive_gi **</span><span style="color: #272727">– Controls the GI received by the material.</span>
- <span style="color: #272727">**generate_caustics **</span><span style="color: #272727">– When disabled, the material does not generate caustics.</span>
- <span style="color: #272727">**receive_caustics **</span><span style="color: #272727">– When disabled, the material does not receive caustics.</span>
- <span style="color: #272727">**alpha_contribution**</span><span style="color: #272727"> – Determines the appearance of the object in the alpha channel of the rendered image. A value of 1.0 means the alpha channel is derived from the transparency of the base material. A value of 0.0 means the object does not appear in the alpha channel at all and shows the alpha of the objects behind it. A value of -1.0 means that the transparency of the base material cuts out from the alpha of the objects behind. Matte objects are typically given an alpha contribution of -1.0. Note that this option is independent of the Matte surface option (i.e., a surface can have an alpha contribution of -1.0 without being a matte surface). V-Ray GPU works with a value of either 1 or -1.</span>
- <span style="color: #272727">**matte_surface **</span><span style="color: #272727">– Makes the material appear as a matte material, which shows the background, instead of the base material, when viewed directly. Note that the base material is still used for things like GI, caustics, reflections, etc.</span>
- <span style="color: #272727">**shadows **</span><span style="color: #272727">– When enabled, makes the shadow visible on the matte surface.</span>
- <span style="color: #272727">**affect_alpha **</span><span style="color: #272727">– When enabled, makes shadows affect the alpha contribution of the matte surface. Areas in perfect shadow produce white alpha, while completely unoccluded areas produce black alpha. Note that GI shadows (from skylight) are also computed; GI shadows on matte objects are not supported by the light cache GI engine when used as the primary engine. You can safely use it with matte surfaces as secondary engines.</span>
- <span style="color: #272727">**shadow_tint_color**</span><span style="color: #272727"> – An optional tint for the shadows on the matte surface.</span>
- <span style="color: #272727">**shadow_brightness **</span><span style="color: #272727">– An optional brightness parameter for the shadows on the matte surface. A value of 0.0 makes the shadows completely invisible, while a value of 1.0 shows the full shadows.</span>
- <span style="color: #272727">**reflection_amount **</span><span style="color: #272727">– Shows the reflections from the base material. </span><span style="color: #000000">V-Ray GPU always renders this parameter with a value of 1. </span>
- <span style="color: #000000">**refraction_amount **</span><span style="color: #000000">– </span><span style="color: #272727">Shows the refractions from the base material. </span><span style="color: #000000">V-Ray GPU always renders this parameter with a value of 1. </span>
- <span style="color: #000000">**gi_amount **</span><span style="color: #000000">– </span><span style="color: #272727">Determines the amount of GI shadows. V-Ray GPU always renders this parameter with a value of 0.</span>
- <span style="color: #272727">**no_gi_on_other_mattes **</span><span style="color: #272727">– Causes the object to appear as a matte object in reflections, refractions, GI etc for other matte objects. Note that if this is on, refractions for the matte object might not be calculated (the object appears as a matte object to itself and is not able to "see" the refractions on the other side). </span><span style="color: #272727">*Not available with V-Ray GPU.*</span>
- <span style="color: #272727">**matte_for_secondary_rays **</span><span style="color: #272727">– Normally, the base material is used when an object with a VRayMtlWrapper is seen through reflections/refractions. Turn this option on if you want the VRayMtlWrapper to show the environment when seen through reflections/refractions. V-Ray can also do projection mapping to increase the realism.</span>
- <span style="color: #272727">**gi_surface_id **</span><span style="color: #272727">– This number can be used to prevent the blending of light cache samples across different surfaces. If two objects have different GI surface IDs, the light cache samples of the two objects are not blended. This can be useful for preventing light leaks between objects of vastly different illumination.</span>
- <span style="color: #272727">**gi_quality_multiplier **</span><span style="color: #272727">– A multiplier for the amount of GI generated by the material.</span>
- <span style="color: #272727">**maya_background_shader_compatibility **</span><span style="color: #272727">– Setting this to </span><span style="color: #272727">**True **</span><span style="color: #272727">will make the matte alpha opaque, so that the alpha of objects behind the matte won't be seen.</span>
- <span style="color: #272727">**alpha_contribution_tex **</span><span style="color: #272727">– Same as </span><span style="color: #272727">**alpha_contribution **</span><span style="color: #272727">but used for Maya's useBackground shader, which supports textures as alpha contribution.</span>
- <span style="color: #272727">**shadow_brightness_tex **</span><span style="color: #272727">– An optional brightness parameter for the shadows on the matte surface. A value of 0.0 makes the shadows completely invisible, while a value of 1.0 shows the full shadows.</span>
- <span style="color: #272727">reflection_filter_tex – </span>
- <span style="color: #272727">**trace_depth **</span><span style="color: #272727">– The maximum reflection depth (-1 is controlled by the global options).</span>
- <span style="color: #272727">**channels **</span><span style="color: #272727">– Render channels, the result of this BRDF will be written to.</span>
- <span style="color: #272727">**generate_render_elements **</span><span style="color: #272727">– When enabled, V-Ray will generate zDepth, velocity, extra tex, and multi matte render elements for matte objects. When this checkbox is disabled, V-Ray does not generate any render elements for matte objects.</span>
- <span style="color: #272727">**reflection_exclude **</span><span style="color: #272727">– A list of plugins that will be excluded from reflections.</span>
- <span style="color: #272727">**reflection_list_is_inclusive **</span><span style="color: #272727">– Setting this to true will turn the reflection exclude list into inclusive (inverted).</span>
- <span style="color: #272727">**refraction_exclude **</span><span style="color: #272727">– A list of plugins that will be excluded from refractions.</span>
- <span style="color: #272727">**refraction_list_is_inclusive **</span><span style="color: #272727">– Setting this to true will turn the refraction exclude list into inclusive (inverted).</span>


## **MtlRoundedEdges**

---

It smooths sharp edges within a given radius by modifying normals.

![image](media://1217c687-fe39-4214-b025-f67520ff9451)

The above example can be rendered using this [scene bundle](https://drive.google.com/open?id=1h9FN2PBh3M0DKmqtWYRTcOwa6fb4pfB5), check the comments inside.