Check out our latest YouTube channel post consisting of a video series that will dive into creating Autodesk Maya XGen grass, making it dynamic, creating a water balloon ball with nCloth, having the two elements interact, and rendering all of this in Arnold!
Check out the first part of our YoutTube video XGen Grass tutorial here. Remember to subscribe to our YouTube channel to be alerted when part 2 is released:
https://www.youtube.com/watch?v=qDF6kulnZ3U&t=68s Starting Code used: Bend Parameter:
$a = rand(.3,1);
$a
Bend U and V $a = rand(-1,1.5);
$a
Color of Grass randomization:
[rand(0,.7),1,rand(0,.2)] Breakdown:
- Set your Maya project
- Create a plane and in xgen tab create description
- Change your width, length, and tappe values
- Under your bend parameters click the icon on the right to add the expressions listed above
- Adjust your density in this xgen window. Go to Xgen's preview/output to adjust the percentage that is viewed in your window
- Create an arnold sky dome and assign an HDRI
- Create an aiStandardShader and an aiUserDataColor node. Connect the aiUserDataColor.outcolor to the aiStandardShader.baseColor
- Name the attribute descriptively in the aiUserDataColor node
- In the Xgen tab under Preview/Output go to your custom shader parameters and type the name of the aiUserDataColor attribute and change the setting to color and click the plus sign.
- Add a random expression to this attribute. The code is the clorod of grass randomization above.
- If you render your grass you should now have random color assigned to each blade.
Finito!
Additional things to do!
Arnold shader:
The only attribute you have changed is the color. You can now play around with all of the other shader attributes and get a grass look you like. Try giving the grass a bit of subsurface scatter to get that light shinning through the blades.
Xgen:
You have so many more settings in the xgen tab to explore. You can make a paint map on your length map to give it random length. You can write that as an expression as well. You can also play with the direction of the grass blades.
Have fun and experiment! Share your questions and comment in this post or in our youtube channel. We love to talk to our followers!