Dealing With LOD Characters

Ever wondered how many render cycles you lost to render "less-than-one-pixel-characters-in-the-far-far-background-of-your-shot" using a full resolution mesh? Too many for sure! Those little guys have wasted too much of your time and it's your turn to rule now: use level of details!

So, how can you deal with LOD characters in Golaem Crowd? First, you need different LOD of a same character (obvious, isn't it?): try to keep mesh names, shaders, uvs... identical amongst the different versions. Here is an example of 2 lods of the Character Pack CrowdMan generated in 5 min with the Smooth Mesh tool of Maya.

LODs

The two characters are then stored in two separate geometry files (fbx or gcg) and referenced in the Character Maker's Geometry Tab as two new Geometry Files:

 And now it's up to you to decide when / why / where you'd like to use either one or the other thanks to the Geometry behavior and a bunch of triggers. Here's an example based on camera distance.

 

Behavior Editor

1/ Configure an EntityType, open its Behavior Editor and create a new Container called LOD. We'll use it to manage the LOD affectattion.

Lod1

2/ Enter the container and create two Geometry behaviors . Configure one behavior to reference the low definition character and the other with the high definition one. The Geometry behavior is designed to switch / play geometry files whenever you'd like during a simulation. It can also be used to replay secondary animations (baked cloth, facial, blenshapes, spiders...).

Lod2

3/ Now, let's use the Alternative operator to choose one way or the other depending on the distance. The Alternative operator acts as a "IF condition is true, THEN do this, ELSE do that". You can easily control the behavior of an Alternative operator by selecting it and looking at its Attribute Editor. Notice that the first arrow coming out of the Alternative operator corresponds to the ELSE case and all the next ones will be associated to a trigger (see the little dots included in the arrows).

Lod3

4/ In the image above, with the default configuration, we have : IF trueTrigger is true THEN use lowDefinition geometry ELSE use highDefinition geometry. Which means that all the characters will have the low definition geometry. Let's change this to make it relative to the distance of each character with the camera. Double Click on the trigger used in the the Alternative Operator to open the Trigger Editor, create a Distance Trigger, rename it distanceToCamera, map a camera node to its In Objects Attribute and set it as root: Following the same mechanism, you can add as many Geometry behavior as you want and deal with a lot of different levels of detail.

5/ You're done! Now you can add your regular behaviors in parrallel with the LOD container and let Golaem Crowd load the correct geometry for you at render time!

6/ Don't forget to save this LOD Container as a template (right click on the Container and "Save as template...") to add it to your custom behaviors and use it in further shots / scenes.

SaveasTemplate

 

Switching LOD during the Simulation

As you may have noticed, the LOD Behavior explained above will make each character pick a Geometry File at the beginning of the simulation and will keep it, even if his distance to the camera changes. This is because the Alternative trigger will only be evaluated once. Even if this can be changed by creating a Behavior loop, it is clearly not a good idea... Changing a geometry of an object on-the-fly can really mess up the rendering engine : how to compute deformation motion blur between two topologies, how to deal with the visual popping... But it's up to you :)

 

Rendering

Here's how the render looks like with Arnold in Maya after exporting the simulation and adding a proxy to the scene:

Render

And to give you an idea of which geometry has been used where (red are low def characters and green are high def)

Render2

Thanks to LOD, the scene polygon count felt from 3millions to 1.6millions and render times reduced by more than 30% for this simple image!