Luna: Cloth Simulation and Hair Setup with XGen

Luna: Cloth Simulation and Hair Setup with XGen

Anda Deng talked about his project Luna: sweater simulation in Marvelous Designer and fabric shader, hair creation, and lighting. 


Hi, I’m Anda Deng. I graduated from the University of Utah with degrees in Game Development. Currently, I work as a Digital Artist/Character Artist at Pinscreen where I make 3D assets for ultra-realistic characters and set them up in UE4 as well as work on the technology that can generate stylized heads from a single image. Previously, I have worked for AAA game studio Survios, VFX studio BOND, and freelanced for some start-up game studios. 

1 of 2

Luna: Goals

“Luna” is a small project that I designed on my own with inspirations from multiple references. I started this portrait for a few reasons. First, I always wanted to try something new so I could learn new things. As I was searching for ideas to get inspired, I came across some Barbie dolls. Then I figured that it would be a cool idea to make a character that feels like a doll but doesn't lack realism. Furthermore, I wanted to learn and discover how to make the hair with gradient by setting up the Arnold hair shader. On top of that, I also wanted to see if I can set up the shader attributes in Arnold for the realistic fabric instead of using normal generated from high poly or Substance.

Clothes SImulation

  • I made some simple patterns to fit the A pose model in Marvelous first.
  • Then comes the most important part which is to set up the animation for simulation later on in Marvelous. In Maya, let’s bring in the neutral pose and the posed models. First, click on the source model which is the neutral one, then shift-click on the target model which is the posed one. Then Deform - Blendshape like this:

Then set the keys in the animation slide by pressing S, like this:

Eventually, select the model with the animation, click Cache - Geometry Cache - Export Cache.

  • The final step is to import the animation MC file in Marvelous:

Usually most of the time, you will need to attach your clothing to the model because the clothing might slip away, something like this:

Finally, in Marvelous, go to the animation viewport. Hit the record button and it will generate the garment in the animation editor, like this:

Most likely, you will have to go back to the simulation viewport and fix the shape by pulling and pushing the clothing accordingly to get the desired look.

Sweater Shader

Here’s an overview of the sweater shader setup:

(This is my improved version based on the fabric shader setup from the xyz website, for more details explanation, please visit

Hair Setup

There are already a lot of tutorials online about creating hair and I’m not going to share how to make hair here. But I have done a lot of hair in my career and I will share some tips from what I learned.

First thing first, the most important thing to remember is to place guides layer by layer.

There’re basically two ways of how I place guides.

The first way is what I used for this project. As you can see I painted different colors for different guide layers. Here’s an example, basically 3 cannot exceed 2, 2 cannot exceed 1, that’s it!

1 of 2

The second way is to place guides group by group.

This way works with hair like this where you can see the hair group by group: 

Then the next step is to add modifier for the hair details:

Here’s the overview of what I have:

Here’s a list of xgen expressions I often use:



rand() < $percentStray/100.0 ? 1: 0

Random (min,max):


Random Based on the Hair Length:


There’re a lot more xgen expressions algorithm, please refer to Maya’s documentation for more examples. 

Here’s also another often used function for noise modifier (you can also try using it for other things to see how it looks).

Click on the right side triangle thing - Load Expression - samples - XGen - WaterRelatedExpressions - Noise - noise_smoothstep.

Basically it gives you a map like this:

Nothing is better than just trying it on your own. Try giving them different values and you will understand it immediately.

And here’s how I made the hair with gradient color and also with some random hair colors just like the realistic dyed hair:


For the lighting in this project, I tried out a bunch of lighting setups before I eventually got the lighting similar to this reference here.

Basically, I set up three lights plus a dome light (HDRI light).

Let’s break it down!

The first step is to set up an HDR light in order to determine the overall visual feeling of the scene. The best way to judge if it looks good is to see if there’s a shadow line.

With only HDR light:

The second step is to set up a key light s to officially determine the shadow line. Make sure there’s no overexposed area.

With only key light:

The third step is to add a fill light to fill the areas that need a bit more attention. I also made the fill light a bit bluish to make a contrast for primary and secondary visions.

With only fill light:

The last step is to add a rim light to serve the purpose of highlighting the outline. It’s already good enough as long as you can see it. Don’t make the rim light too strong!

With only rim light:

Eventually, turn on all the lights and do some minor adjustments for the overall look.


If you're interested in more tutorials from me, please check out “Female Character Creation Guide".

Anda Deng, Character Artist

Interview conducted by Arti Sergeev

Keep reading

You may find this article interesting

Join discussion

Comments 0

    You might also like

    We need your consent

    We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more