We have been posting more and more content to our Youtube channel as of late and our latest post consists of a video series that will dive into creating 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 the video tutorial here and subscribe to be alerted when part 2 is relesed!:
https://www.youtube.com/watch?v=qDF6kulnZ3U&t=68s Starting Code used: Bend Parameter:
$a = rand(.3,1);
Bend U and V $a = rand(-1,1.5);
Color of Grass randomization:
- 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.
Additional things to do!
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.
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! If you have any questions comment in this post or in our youtube channel. We love to talk to our followers!