XGen

Hair rendered using XGen (image courtesy of Jonas Tornqvist).

 

MtoA supports Maya's XGen, a powerful geometry instancing tool.

Limitations and Warnings

  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. 


Icon

Tutorials about working with XGen can be found here. You can find information on how to render .ass files with XGen here.

Arnold Output Settings

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.

 

Arnold Settings

Render Mode

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.

Tools

Apply default Arnold XGen Hair Shader to the current Description. The shader reacts to root_colortip_color and back_color XGen custom shader parameters.

Arnold Curve Settings

Min Pixel Width - Arnold's minimum pixel width for curves. More information here.

Mode - Curve Primitives can be rendered as ribbon or thick. To get 'oriented' facing splines that do not face the camera, you must disable Face Camera in the XGen tab. 

Spline Opacity 

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. 

Arnold Motion Blur Settings

Choose between Global Settings (uses the MtoA motion blur Render Settings), On or OFF.

Icon

Motion Blur and Splines

It is important that you use the following steps when rendering motion blur with XGen splines.

  • Ensure that your scene is saved.
  • With the geometry and XGen description selected, go to 'File>Export Patches for Batch render'.
  • Enable motion blur in the XGen description or in the Render Settings (remember to choose Global settings in the XGen Description).
  • Save the scene again.

 

Using XGen

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.

Export XGen Archive

  • 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.
Icon

When exporting geometry as an archive, ensure that the name has no colons. For example, a mesh named Head:Group3919Shape will not export properly as an archive using XGen. Deleting the colon will fix the problem.


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....
Icon

If the archive has not exported correctly, check that the MtoA Render Settings are loaded prior to exporting.

Create XGen 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:

 

Preview Viewport Display

  • 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

 

Primitives Placement

Density

Increasing the Density will increase the number of primitives.

Size

  • 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).

Generate Primitives

  • 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).

Spacing

  • 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.

 

Log file

  • 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.

00:01:46 1552MB | -----------------------------------------------------------------------------------------
00:01:46 1552MB | geometric elements: ( min) ( avg.) ( max)
00:01:46 1552MB | objects (top level) 4 ( 4) ( 4.0) ( 4)
00:01:46 1552MB | objects (procs) 378001 ( 0) ( 1.4) ( 266256)
00:01:46 1552MB | polygons 320953 ( 1) ( 80238.3) ( 320940)
00:01:46 1552MB | -----------------------------------------------------------------------------------------
00:01:46 1552MB | triangle tessellation: ( min) ( avg.) ( max) (/ element) (% total)
00:01:46 1552MB | polymeshes 641882 ( 2) ( 320941.0) ( 641880) ( 2.00) (100.00%)
00:01:46 1552MB | unique triangles: 641882
00:01:46 1552MB | visible triangles: 71725596842

378001 head objects (71725596842 visible triangles) rendered with XGen

 

Example Renders

 

 




Thanks to James Busby for the use of his head model scans.

  • No labels