Rendering through USD

Setup Simulation in Maya

Create your Crowd Simulation within Maya using Golaem Crowd. In our example we will use the stadium scene from the Golaem Crowd Samples. Once the simulation is done, open the Simulation Exporter to export the Simulation Cache. Once the Simulation Cache will be exported, a Simulation Cache Proxy and a Crowd Render Proxy node will be created and Golaem will be switched in Cache Replay Mode. .

The Crowd Render Proxy node defines attributes to export USD .usda files (in the USD Attributes):

Specify the directory in which you'd like the files to be exported and press the "Export USD file" button. You will obtain two files:

  • cacheName.proxyNodeName.usda which stores all the parameter values of the Crowd Render Proxy required to render exported Simulation Caches as Crowd Characters. Details about this .usda file can be found here.
  • cacheName.proxyNodeName.glmusd which is an empty file required by USD to register the Golaem plugin extension.

Setup USD

Rendering a Simulation with USD

To render a Golaem Simulation, you can reference the generated usda file in your mainSceneFile USD file. If the Golaem For USD plugin is correctly installed, the Golaem Entity geometries will be generated in the scene hierarchy as a USD geometry. They can be manipulated as any USD object at this point.

 

Assigning Materials

Material Files can be referenced in the Golaem For USD file (.usda). They should match the name of the Surface Shader or the Shading Groups set in the Character File within the Character Maker in Maya. The parameters glmMaterialPath can be used to define the path to the USD Materials to link and glmMaterialAssignMode to use Surface Shader Names (set to 0, default) or Shading Group Names (set to 1) An example can be found below:

#usda 1.0
def "GolaemCacheProxy1" (
   GolaemUSD_Params = {
      # Golaem parameters  
      ...
      token glmMaterialPath = "/Root/Materials"
      int glmMaterialAssignMode = 0
   }
    payload = @./Golaem.glmusd@
)
{
    def Scope "Materials"
    (
        add references = [@./Materials/CasualMan.usda@, @./Materials/CasualWoman.usda@]
    )
   {}
}

Attributes

Shader Attributes

If Shader Attributes are defined within the Character File of an Entity, the Shader Attributes will be assigned at the USD Mesh level. These attributes can be used to make shading variations if required

 
Two Shader Attributes are defined for the Tshirt Mesh. Those attributes can be read as properties in the generated USD Mesh.

Golaem Attributes

If Golaem Attributes or PPAttributes are exported in the Simulation Cache as "Additional Attributes" in the Simulation Exporter, these will be assigned at the Entity XForm level.

 
Three additional attributes are defined for the Simulation. Those attributes can be read as properties in the generated Entity XForm.

Editing the Simulation

Simulation results (character positions, orientations, postures) and Assets repartition or shading assignment (shader, shader attributes...) can be edited using the Simulation Layout Tool in Maya. You can see the results once saving the Layout File with these edits and by refreshing the Golaem For USD file in your USD environment.

Assets repartition or shading assignment (shader, shader attributes...) can also be edited using the Character Maker in Maya. When done, you just need to save the changes in the Character File. Reexporting the library file is not required.

The actual transformation and scale of the node in the USD scene is taken into account.

If you'd like to change any Crowd Shader properties (texture, color, displacement, multi matte IDs...), it can be done on the assigned Materials in USD (see above).