How do I enable static/dynamic batching for the shadows?

Added on by Gustav Olsson.

The toolkit uses Unity's Graphics.DrawMesh() internally and meshes submitted to the renderer this way are not batched.

To mitigate this problem, the ShadowComponentToGO.cs script is bundled with the toolkit. Attach this script to any game object with a ShadowVolume component and during Play-mode, shadow game objects will be created to take care of the shadow rendering instead of the Graphics.DrawMesh() call. This will enable dynamic batching for the shadow game objects in question.

Keep in mind that the shadow meshes need to have a vertex count of 300 or lower in order to qualify for dynamic batching. See the Unity documentation here.

Unfortunately, it is not possible to easily get static batching to work with the toolkit since it requires the shadow game objects to be instantiated at build-time.