---
title: "XGen General"
canonical: "https://documentation.chaos.com/space/VMAYA/111741685/XGen%20General"
format: markdown
---
This page provides prerequisites and basic information on using XGen with V-Ray for Maya.

## **Overview**

---

This page covers the basics of using XGen with V-Ray for Maya, including a step-by-step guide to controlling XGen Attributes through texture maps.

Want to follow along but don’t have a license?


> Macro (ui-button)




** **

## **Prerequisites**

---


---


## **Basics**

---


---


The following images show how instanced primitives look when the base mesh has a low versus a high subdivision. Note how XGen clumps primitives more to the center of each face. This is the same behavior for all kinds of primitives.



Base meshes onto which XGen populates primitives, should use Maya's subdivision settings, as V-Ray's own subdivision settings will not work with them.

Working with XGen and a multitude of primitives can be faster by reducing the percentage of drawn primitives in the viewport through the **Percent** attribute found in the **Preview/Output** tab of the XGen window.

Patches may be added or removed to or from descriptions.

Normally, shape nodes have visibility attributes in the **Render Stats** section, but the XGen patch/description placeholder shapes do not have them visible. To control such visibility flags, use [V-Ray Object Properties](https://docs-chaos.atlassian.net/wiki/spaces/VMAYA/pages/111739008).

Materials and **V-Ray Object Properties** may be assigned to descriptions and all primitives for that description will share them; they can also be assigned on a per-patches basis for fine-grained control over primitives on different patches. This means two patches in the same description can use different materials and have separate **V-Ray Object Properties**.


![image](media://fe817cf4-33c7-4c4c-acec-53d19e82200a)



For example, if you have a description with four patches in it, you can assign a master material to the description and give a specific material to one of the patches, such as in the example shown below:


![image](media://b7c0534e-26f2-4288-8362-098ac76ecdeb)



> Macro (ui-text-box)
> 
> Assign the description material to the **transform** node, not to the **shape** node. Such assignments are hierarchical, meaning they affect the selected node and all its children: the patches are children of the description transform, not the description shape.

## **Controlling XGen Attributes**

---

The following section describes two ways of controlling XGen attributes: through expressions or through texture maps.


### **Part I: Through Expressions**

---


---



### **Part II: Through Texture Maps**

---

Here we show how to use a texture map to control the **Length** attribute:

#### **Set Up the XGen Splines**

1. Create a plane and create an XGen description on it, with splines randomly across the surface.
2. Increase the **Density** from the **Primitives** tab of the XGen window to 50.

---

**Set Up the Map**


---



---



---



---



---




#### **Editing the Expression**

1. If we edit the expression of the **Length** attribute through the **Sigma** button from this:
  to this, we can invert the result of the map:
2. Add a dome light with an HDRI dome tex to the scene, apply V-Ray Materials, and render. We should see something like this:


![image](media://53d8b0d2-dcac-4edf-a23c-7a5eab1d58d4)