Rendering From Katana

In this tutorial, we present a method to render Golaem Crowd simulations with Katana and Arnold, Renderman or Redshift. The really big advantage of this method is that it uses the procedural rendering (saving a lot of space and enabling to customize shading and asset repartition after simulation) in Katana.

Supported Versions

Check the Release Notes to see which Golaem, Katana, Arnold / Renderman / Redshift versions are compatible together

Workflow

The figure below details the workflow of the render of Golaem Crowd simulations with Katana. For a better understanding of the process, check the Golaem Crowd Rendering Workflow.

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 NodegraphXML .xml files for Katana (in the Katana Attributes):

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

  • cacheName.proxyNodeName.xml which stores all the parameter values of the Crowd Render Proxy required to render exported Simulation Caches as Crowd Characters. Details about this .xml file can be found here.

Setup Katana

A few steps must be undertaken for Katana to be able to load and render with the Golaem plugin.

Installing the Golaem For Katana Plugin

The Golaem for Katana plugin can be found along with the Maya 2018 plugin in [Golaem installation directory]\procedurals\katana\ (install the Maya plugin for the version of 3ds Max you're running: Golaem for Maya 2017 for 3ds Max 2017 for example) and is made of four directories:

Adding Golaem For Katana Plugin to your Environment

Then, for Katana to be able to find the Golaem For Katana Plugin, its path needs to be added to the predefined KATANA_RESOURCES environment variable. Depending on the used rendering engine, it is also required to define where can be found the Golaem for Arnold, Renderman or Redshift plugins. There are many ways to add a path to an environment variable, however for our test, we chose to create a bat / shell file to launch Katana with the correct environment.

Linux

#!/bin/sh
# Set Environment Variables for Golaem

export GOLAEM_INSTALL_PATH=/home/golaem/GolaemCrowd-6.0-Maya2016
# Set Environment Variables for Katana
export LD_LIBRARY_PATH=${GOLAEM_INSTALL_PATH}/lib:${LD_LIBRARY_PATH}
export KATANA_RESOURCES=${GOLAEM_INSTALL_PATH}/procedurals/katana:${KATANA_RESOURCES}
export KATANA_POST_PYTHONPATH=${GOLAEM_INSTALL_PATH}/procedurals/katana/Python
# Set Environment Variables for Arnold For Katana
export ARNOLD_PLUGIN_PATH=${GOLAEM_INSTALL_PATH}/procedurals;${GOLAEM_INSTALL_PATH}/shaders:${ARNOLD_PLUGIN_PATH}
export DEFAULT_RENDERER=arnold
# Set Environment Variables for Renderman For Katana
export RMAN_DSOPATH=${GOLAEM_INSTALL_PATH}/procedurals
export RMAN_RIXPLUGINPATH=${GOLAEM_INSTALL_PATH}/shaders:${RMANTREE}/lib/plugins
export DEFAULT_RENDERER=prman
# Set Environment Variables for Redshift
export REDSHIFT_PROCEDURALSPATH=${GOLAEM_INSTALL_PATH}/procedurals:${REDSHIFT_PROCEDURALSPATH}
export DEFAULT_RENDERER=Redshift
# Launch Katana
/usr/local/Katana3.1/katana

Windows

:: Set Environment Variables for Golaem
set GOLAEM_INSTALL_PATH=C:\Golaem\GolaemCrowd-6.0-Maya2016
:: Set Environment Variables for Katana
set PATH=%GOLAEM_INSTALL_PATH%\bin;%PATH%
set KATANA_RESOURCES=%GOLAEM_INSTALL_PATH%\procedurals\katana;%KATANA_RESOURCES%
set KATANA_POST_PYTHONPATH=%GOLAEM_INSTALL_PATH%\procedurals\katana\Python
:: Set Environment Variables for Arnold For Katana
set ARNOLD_PLUGIN_PATH=%GOLAEM_INSTALL_PATH%/procedurals;%GOLAEM_INSTALL_PATH%/shaders;%ARNOLD_PLUGIN_PATH%
set DEFAULT_RENDERER=arnold
:: Set Environment Variables for Renderman For Katana
set RMAN_DSOPATH=%GOLAEM_INSTALL_PATH%/procedurals;%RMAN_DSOPATH%
set RMAN_RIXPLUGINPATH=%GOLAEM_INSTALL_PATH%/shaders:%RMANTREE%/lib/plugins
set DEFAULT_RENDERER=prman
:: Set Environment Variables for Redshift
set REDSHIFT_PROCEDURALSPATH=%GOLAEM_INSTALL_PATH%/procedurals;%REDSHIFT_PROCEDURALSPATH%
set DEFAULT_RENDERER=prman
:: Launch Katana
"C:\Program Files\Katana3.1\bin\katanaBin.exe"
Beware, to this date, Renderman For Katanana does not interpret ; (semicolon) as a valid separator for his own variables. So although all other variables will need ; as a separator, you need to use : (colon) for the RMAN_RIXPLUGINPATH variable

Rendering a Simulation in Katana

A GolaemCache op node is a Katana GeolibOp node which handles the display and the rendering of a Golaem Crowd simulation in Katana. It can be created from the Node Graph panel by pressing the TAB key.

To define the values of the parameters of a GolaemCache node, one can use the Shelf Action "Feed a GolaemCacheOp node from a XML file" attached to the node and load a previously exported Katana .xml file. This will fill all the values of a node with the values from Maya.

Once the Katana .xml file is loaded, the attributes of the GolaemCache node will be automatically filled according to the content of the file. They now can be edited to change the rendering results (motion blur properties, subdivision attributes...). The GolaemCache node attributes are the same than the Maya Crowd Render Proxy.

Once set, a GolaemCache node defines the following locations:

  • golaem: the GolaemCache op node
  • crowdField: the GolaemCrowdField op node which handles the display of a Golaem Crowd simulation in Katana
  • entity: the GolaemEntity op node which is not used for now
  • renderer procedural: the node which handles the rendering of a Golaem Crowd simulation in Katana at render time

When the crowdField location is expanded, each crowdField will display the Crowd Entities as bounding boxes within the Katana viewport (notice that frames 0 and 1 are not exported and nothing will be displayed for those):

When you're happy with everything, render with Katana and you're done!

Notice that this method has the same properties than rendering inside of Maya. It means that it supports 3d motion blur, displacement, frustum culling, subdivision surfaces, shading variation, render passes... More here.

Assigning Katana Materials with Arnold

Assigning Katana Materials with Renderman

In Renderman For Katana, you just have to create your Materials in the scene graph location specified in the materialsPrefix attribute of the GolaemCache node (root/materials per default) and name them the same way than in the Character File within the Character Maker in Maya.

Assigning Katana Materials with Redshift

In Redshift For Katana, to force your Materials to be exported with a specific name, you need to set two attributes on them using the AttributeSet node:

  • forceMaterialName [string]: to specify the name of the Material when exported (it should match the name of the Shading Group set in the Character File within the Character Maker in Maya
  • forceCreate [int]: to force the Material to be exported in the final scene even if it is not assigned to a geometry

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 or Unreal. You can see the results once saving the Layout File with these edits and using the Refresh Layout button in the Golaem Cache node in Unreal Engine.

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 Katana 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 Katana (see above).