---
title: "Rendering an AO pass and using it with VRayMtlBlend"
canonical: "https://documentation.chaos.com/space/VRAYNUKE/110626776/Rendering%20an%20AO%20pass%20and%20using%20it%20with%20VRayMtlBlend"
format: markdown
---
This page provides a guide on rendering an Ambient Occlusion pass in V-Ray for Nuke and using it with the V-Ray Blend Material.

## **Overview**

---


> Macro (anchor)



## **Part I: Setting up the AO Pass**

---

In this first section, we set up a **VRayDirt** node and connect it to the diffuse channel of a VRayMtl, which will be used temporarily to tune-in the AO settings before later use as a mask.


1.  Create a **VRayDirt** texture.


![image](media://66bf9b65-34cc-47fe-9f46-d5d5fa36f3fc)



2.  Create a **VRayMtl,** name it *VRayMtl_TestAO_Material* and then connect the **VRayDirt** texture as its diffuse input.


![image](media://02bc5bf5-e636-40e4-8c69-75d8fa604db4)



3.  Connect the VRayMtl_Test_AO_Material to the *img* input of the geometry within the scene.



4. Currently at the default **VRayDirt **settings, there are not a lot of dark areas to later use to blend the two materials. So using the test VRayMtl we have set up so far, the **VRayDirt** texture can be tuned to reach the look desired to act as that blending mask when we eventually use the **VRayMtlBlend**. For tuning, it is easier if the viewer in Nuke is set to the diffuse channel.


![image](media://2dd4f557-7aa6-4f5f-80a0-719ac896b00c)


![image](media://b2fa0e5a-31f4-4fe5-a9e7-6f81710acab9)



In the examples below, the **VRayDirt** texture has been tuned to give it a darker and broader output, by using a large **Radius** of *1000* and a high Distribution value of *75* (which tightens the dark areas). Also, the **Subdivs** have been raised to *8* so that the resulting texture is not overly noisy.

> ℹ️ For a full explanation of all the parameters of the VRayDirt texture, please see the [Occlusion or Dirt Map page](https://docs-chaos.atlassian.net/wiki/spaces/VRAYNUKE/pages/110625435).




> Macro (anchor)



## **Part II: Using the AO pass as a mask for a VRayMtlBlend**

---

In this section, we learn how to use the AO pass as a mask for a VRayMtlBlend to control blending between two materials.


1.  Create a **VRayMtlBlend** material and connect the VRayDirt texture as a mask.


![image](media://2df3064e-8b5c-4296-9c78-9649b44a33fa)



2.  Create a **VRayMtl** material, name it *VRayMtlRust,* and connect the **B input** of the VRayMtlBlend material.


3.  Create a **VRayTexNoise **texture and connect it to the diffuse input of the** *****VRayMtlRust ***material. This acts as a basic rust color and gives some mild variation to the diffuse channel.


![image](media://f1162dd5-2f02-40d9-ba32-6942bf66949f)



4.  Create a **VRayMtlCarPaint** material, name it *VRayMtlCarPaint,* and connect the **A Input** of the VRayMtlBlend material.



![image](media://f06eac80-9131-4367-b8ed-1ceb187c5b72)



> Macro (anchor)



## **Part III: Adding variation the VRayDirt used as a mask for a VRayMtlBlend**

---

In this section we learn how to add some variation to the **VRayDirt** which is being used as a blend control mask for the **VRayMtlBlend** and its two materials.


1.  Create a **VRayTexNoise** texture and connect it to the Occluded Color channel of the **VRayDirt**.


2.  Ensure that **Color 1** of the **VRayTexNoise** texture is set to *black* and that **Color 2 ** of the **VRayTexNoise** texture is set to *white*.


![image](media://d6c289ec-583c-4f1d-8afa-d95a2dd95591)



3.  Change the **Type** in the **VRayTexNoise** texture to **Fractal**, with **Iterations** set to *2,* and **Size** set to *10*.


![image](media://c1eb43d3-c494-455c-b80e-b7f346677606)



4.  Render the image.