---
title: "XGen Spline Primitives"
canonical: "https://documentation.chaos.com/space/VMAYA/111740390/XGen%20Spline%20Primitives"
format: markdown
---
This page provides a tutorial for using XGen Spline Primitives with V-Ray.

## **Overview**

---


## **Part I: Creating a Grass in a Simple Scene**

---

These steps will guide you through creating a simple grass surface.



---


From the Preview/Output tab, set the **Percent** attribute to 10 (this will affect only the viewport).

From the Primitives tab

1. 
  1. Set the **Density** attribute to 100.
  2. Set the **Length** attribute with the following expression:
  3. Set **Taper** to 0.8 and **Taper Start** to 0.5 to make the splines more pointy like grass.
  4. Set **Width** to 0.05.
  5. Set the following expression to the ***Bend U/V*** attribute through the expression editor:
  6. And this one to the Bend Param

### **Set Up the Render**

Assign a [VRayMtl ](https://docs-chaos.atlassian.net/wiki/spaces/VMAYA/pages/111739405)material to the description (select the description from the **Outliner**, right-click in the viewport, and choose **Assign New Material**). Change the **Diffuse Color** to green.

Create a [V-Ray Dome Light](https://docs-chaos.atlassian.net/wiki/spaces/VMAYA/pages/111740805) in the scene and render. Your rendering should look similar to the image below.


![image](media://fefffd9e-613a-4ced-bdb6-754b55f4df42)


** **

## **Part II: Randomizing Hair Strand Color**

---

Splines can be uniquely colorized with the use of expressions and texture maps through the use of Custom Shader Parameters.

There are two parameters that control the color of each strand: **root_color** and **tip_color**. If different colors are assigned to both, the color of each hair strand will be interpolated upwards from the root color to the tip color. If only one color is assigned to both, the whole strand will be colored evenly with that color.



---



---



![image](media://5322e17a-200f-4514-9437-b115c0dd28e4)


---



---


![image](media://b0c1f5f9-2177-482a-acf0-9cd33b0e3fcd)


---


---



## **Tessellation Parameters**

---





## **Limitations and Problems**

---

When working with groomable splines, if a render or a IPR render happens, to continue updating the splines with respect to the groom splines, one has to refresh XGen, groom a bit more and refresh again. Only then will the splines regenerate accordingly to the groom splines (which are only for the viewport).