XGenΒΆ

Guerilla Render can render the XGen's procedural geometries. Curves, Archives and Spheres are supported. No support for Cards.

Installation

Linux

Make sure the MAYA_PATH/lib and the MAYA_PATH/plug-ins/xgen/lib are present in the LD_LIBRARY_PATH before running "guerilla".

XGen is dependent on libtbb.so, and thus you may experience linking incompatibilities with Yeti 1.3, as they link with different versions of libtbb.so.

Windows

Make sure the MAYA_PATH/bin and the MAYA_PATH/plug-ins/xgen/bin have been added to the PATH variable before running "guerilla" or "render".

Export from Maya

You first need to export the XGen geometry using the Maya XGen command XGen -> File -> Export Patches For Batch Render.

Then, export the project from Maya to Guerilla. A XGen node will be created in Guerilla, referencing the XGen collection and geometies, with live controls on density, width, length and depth.

Reference XGen files

You can also create yourself a XGen node with Create/Create XGen to render a XGen geometry. Set the File, Geom, Palette, Patch and Description attributes as required.

Using PTex textures

To control the XGen geometry shaders with XGen textures (ptex), simply use the PTex texture files like a standard texture file, using a Texture node.

You can't texture XGen curves with a standard texture. You have to use ptex files.

Using XGen attributes in a shader

All the generated XGen attributes are readable from a shader or a subshader using the primattr node or the primattr SL function.

A subshader using a PrimAttr to read the ri_XP XGen attribute and drive a cell noise to get a random color per instance.

In an SL box, one can retrieve a XGen attribute like this :

float ri = primattr ("ri_XP", 0);

Here is some exemples of XGen attributes:

  • ri_XP : random integer per instance/curve/sphere
  • rf_XP : random float per instance/curve/sphere
  • length_XP : the primitive length
  • width_XP : the primitive width
  • etc...
The XGen documentation for details on the generated attributes. User Guide/Rendering/Logs And Diagnostics to learn how to inspect the generated XGen attributes by inspecting the Shape diagnostic log.

XGen archives

To render XGen archives with Guerilla, you will have to prepare Guerilla archive file (*.rib) for every archive file used in XGen.

Create a Guerilla archive file
  • Create a Guerilla project with the archive content (all the objects and the shading).
  • For every root node in the scene, set the Transform > Hierarchy Mode attribute to the Inherit mode.
  • Check the look of the asset.
  • Remove the lights from this project if they don't need to be instanciate.
  • Export the archive with the File/Create Archive command.
Setup XGen to render with the Guerilla archive files
  • In Maya, open the the XGen window.
  • Select a description using archives.
  • In Archive Files, select an archive file and click Edit...

  • Replace the file in the slot 3, 4, 5 by the Guerilla archive file previously exported.
  • Save the Maya project.

You can also edit the content of the XGen archive files (*.xarc) to make them use the Guerilla archive files.

Troubleshooting

Can't load DSO xgen

If you get this message in the console, make sure the MAYA_PATH/bin and the MAYA_PATH/plug-ins/xgen/bin have been added to the PATH on Windows and to the LD_LIBRARY_PATH on Linux, see the installation chapter.

Nothing is rendered

With no message in the console, make sure you've exported the XGen geometry using the Maya XGen command XGen -> File -> Export Patches For Batch Render.