Rendering With Katana

In this tutorial, we present a method to render Golaem Crowd simulations with Katana and Arnold or Renderman. 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

Notice that you need the following versions of software for this process to work:

  • Golaem 6.2 and above
  • Katana 2.5 and 2.6 (reach us here for another version)
  • Compatible versions of Arnold and Renderman for Katana and Golaem. Please check the Release Notes

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 and Renderman 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}
# Set Environment Variables for Renderman For Katana
export RMAN_DSOPATH=${GOLAEM_INSTALL_PATH}/procedurals
export RMAN_RIXPLUGINPATH=${GOLAEM_INSTALL_PATH}/shaders:%RMANTREE%\lib\plugins
# Launch Katana
/usr/local/Katana2.5/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 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
:: Launch Katana
"C:\Program Files\Katana2.5v4\bin\katanaBin.exe"

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

Editing the Simulation

All parameters relative to the Render Proxy (motion blur, frustum culling, subdivision, visibility...) can be changed directly on the Katana Golaem node. The actual transformation and scale of the node in the Katana scene is also 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).

Finally, if you'd like to change the assets repartition or the shading assignment, it must be done in the Character Maker in Maya. When done, you just need to save the changes in the Character File. Reexporting the .xml file is not required.