When you are dealing with a complex scene, or complicated 3D models with many surface details, every bit helps when it comes to optimizing performance. Shadow volumes are low polygon versions of an asset that is placed inside the original mesh for the purpose of generating dynamic shadows. This simplifies the calculation and makes drawing the shadow less costly in terms of computing power.
|Click to expand||Click to expand|
To create a shadow volume for a model, add one or more empty nodes and rename them “Shadow Volume.” Set the “Visible” checkbox to “off,” but keep the node(s) casting shadows. Use a low polygon graphic geometry in the node, and leave the graphic material field empty (the node is invisible anyway). Set all “Cast Shadow” to “off” on the nodes of your detailed 3D model. The computer will only use the low polygon model to calculate the shadow, instead of figuring out all the interaction between the lighting and the complex structure of the visible model.
Note that nothing prevents the low-poly graphic geometry used for a distant Level of Detail to do double-duty as a shadow volume. You don’t have to make a custom one … Several nodes can point to the same graphic geometry.
The values in your graphic gallery will then look something like this:
|Node – Main Model||Node – Shadow Volume|
|– Visible: On||– Visibility Off|
|– Receive Fog: On||– Receive Fog: Off|
|– LOD 0: Geo 1 (high poly) & Graphic Material||– LOD 0: Geo 3 (low poly) & no Graphic Material|
|– LOD 1: Geo 2 (med poly) & Graphic Material||– Cast Shadow: On (in all LODs)|
|– LOD 2: Geo 3 (low poly) & Graphic Material||– Receive Shadow: Off (in all LODs)|
|– Cast Shadow: Off (in all LODs)|
|– Receive Shadow: On (in all LODs)|
Obviously this is a very simplified example. You don’t have to create shadow volume nodes for every node of your model — we recommend implementing this for visually complex meshes primarily, as the process can be time-consuming.