Hair rendered using XGen (image courtesy of Jonas Tornqvist).
MtoA supports Maya's XGen, a powerful geometry instancing tool.
There are some current limitations when using XGen with MtoA. These are as follows:
The Primitive Type 'Card' is not supported.
Ensure that the MtoA plugin is loaded prior to the XGen plugin otherwise Arnold will not appear in the Renderer list.
The XGen MtoA attributes can be found under the Preview/Output tab. You must first change the Renderer to Arnold Renderer. You will then see custom Arnold curve and motion blur settings.
Live allows XGen to query patches and guide animation directly from Maya. This does not support Motion Blur and will try to reuse information the preview generated.
Batch Render mode will always read geometry and animation from files. Batch render mode is always on when doing a batch render. You must first export the patches and guide animation to caches. Use this mode to make sure your caches are properly exported before doing a batch render.
Apply default Arnold XGen Hair Shader to the current Description. The shader reacts to root_color, tip_color and back_color XGen custom shader parameters.
In order to change the Opacity of XGen splines you must first select the XGen description and then disable Ai Opaque within the Extra Attributes of the Attribute Editor.
Choose between Global Settings (uses the MtoA motion blur Render Settings), On or OFF.
The following steps go through the process of rendering a head model (kindly provided by Lee Perry Smith) as an XGen archive.
- Open the head scene file. You will need to assign an Ai Skin shader is to it and connect the relevant texture maps to it (remember to convert the texture maps to .tx format using the TX Manager in order to get faster feedback when rendering). A guide to rendering realistic skin can be found here.
- Before you export the mesh as an archive, you must first save the scene, otherwise XGen will fail to export it.
- Select the head mesh and go to XGen>Export Selection as Archive(s)... (alternatively you can convert a saved scene to an archive using Create from Selection... under Archive Files once the description has been created).
- The Export Selection as Archive(s) window should appear. Change the Archive Name to Head.
- Select a folder where you want XGen to save the archive file and select Export. XGen will then export the model as an archive file within the selected folder.
You should see the Export Selection as Archive(0) Progress window when XGen is exporting the mesh:
- The next stage is to create a new scene with which we can render the head model as an XGen archive.
- Create a polygon plane. We will add the XGen description to the plane and it will also double up as a floor plane. Select the polygon plane and select XGen>Create Description. The XGen window should appear. Click on Create New Description....
- The Create XGen Despcription window will appear. Change the New Description Name to Heads.
- Choose Custom Geometry/Archives (use for any model you have created) as indicated in the image below:
- The XGen window should replace the attribute editor. Before opening the archive file, reduce the Percent value to a low value in the Preview Settings (Preview/Output tab). This is a good habit to get into as XGen could automatically create many instances in the viewport, depending on settings such as the Density. If the percentage is too high it can cause Maya to crash without any prior warning.
- Go back to the Primitives tab. Scroll down to Archive Files and select Add.
- Go to the location where you saved the XGen archive file and select it. It should be called something like Head-model.xarc
- You will be prompted with the following window. Select Yes to import the materials that were saved with the archive file (you can change the material assignment later if you wish to do so).
Import head material into scene
Increasing the Density will increase the number of primitives.
- To view the XGen archive model in the viewport, slowly increase the Percent value in the Preview Settings. If you cannot see the head model, you may have to adjust the Size value (underneath the Add... button in Archive Files).
- XGen has placed the heads randomly across the surface because this is the default option when creating a description. If you want the primitives to be placed in rows and columns, you can do so by selecting In uniform rows and columns in the Generate Primitives menu under Generator Attributes (Primitives tab).
- When Generate Primitives is set to In uniform rows and columns the Spacing attribute replaces Density. Increasing the Spacing attribute increases the distance between the primitives.
- If we save a log file we can view the total number of unique objects and polys within the scene (increase the Max. Warnings to 6 ). For example, if we look at the log file for the render below, we can see that it contains 378001 head objects and a total of 71725596842 visible triangles.
378001 head objects (71725596842 visible triangles) rendered with XGen
Thanks to James Busby for the use of his head model scans.