Skip to main content

Static Batching

Static Batching is a feature that helps improve rendering performance by reducing draw calls. It works by combining non-moving (static) GameObjects that use the same materials and vertex layout into a single mesh at loading time or runtime. Then combined mesh gets drawn in single draw call instead of several.

This is especially useful in large scenes with lots of environment objects like buildings, trees, rocks, or props that don’t move.

Plugin Version

Static Batching is available starting from Playworks Plugin 6.4.0

How does Static Batching work with Playworks Plugin ?

When Plugin performs static batching, it:

  1. Transforms each mesh into world space.
  2. Combines all eligible meshes into one big mesh.
  3. Creates a shared vertex and index buffer.
  4. Draws all the combined objects using one draw call.

This reduces CPU overhead because not needed to send separate draw calls for each object, but this increases the startup time since the static batch is assembled at the stage of loading the scene (so as not to increase the playable build size).

The feature as a trade-off between increasing startup time and improving performance in real time.

caution

Static batching increases startup time, so it’s not always ideal for all playables.

When to Use It

Use static batching when:

  • You have many static (non-moving) objects in the scene.
  • The objects use the same material or shader configuration.
  • You want to reduce CPU load and improve frame rates, especially on low-end hardware.
caution

Static batching uses more CPU memory (RAM), so it’s not always ideal for memory-constrained platforms.

Requirements for Static Batching

To be included in a static batch, each GameObject must:

  • Be active.
  • Have a Mesh Filter component that is enabled and has a valid mesh.
  • Have a Mesh Renderer that is enabled.
  • Use shaders that are compatible with static batching.

    By default, shaders allow batching — you don’t need to change anything.
    However, if a shader uses object space calculations (e.g., for custom lighting or effects), it may include the DisableBatching tag set to true. Such shaders will be excluded from batch because object space data is lost after batching.

  • Have a mesh with more than 0 vertices.
  • Use a mesh that is not already combined.
  • Share the same vertex attributes (e.g., position, normal, UVs).
  • Be marked as static in the Editor (for load-time batching).

How to Enable Static Batching

At loading Time

  1. Open Plugin window.
  2. In the Settings section and select the Advanced Settings tab (Settings → Advanced).
  3. Enable the Static Batching checkbox.
  4. In the Hierarchy or Scene view, select the GameObjects you want to batch.
  5. In the Inspector, check the Static flag.

After you enable the Static Batching checkbox, static objects are combined into batches during scene loading.

Use this method if the GameObjects already exist in the scene before running the playable.

The key difference between Unity and our implementation is when they can create static batches:

  • Unity creates static batches at build time, not at load time.
  • Playable creates static batches at load time, but not at build time.
caution

Check the performance of your Playable on target devices.

At Runtime

If you create GameObjects at runtime (e.g., procedurally), use the StaticBatchingUtility.Combine() method:

StaticBatchingUtility.Combine(gameObjectArray, parentTransform);
  • You can move/rotate/scale the root GameObject after combining, but not individual children.
  • Enabling the Static Batching option is not required for Runtime Static Batching.
caution

Do not change the parity of negative scale components on statically batched GameObjects.
If the parity changes (even ⇄ odd), the mesh may be rendered flipped or with incorrect normals.

For example, changing scale from (1, -1, 1) to (1, 1, 1), or from (-1, 1, -1) to (-1, -1, -1) can lead to incorrect rendering or artifacts.

The engine expects the number of negative scale axes (X, Y, Z) to remain even or odd consistently across the lifetime of a static batch.

Supported Features

NameSupportedComment
Built-in Render Pipeline (BIRP)✅ Yes
Universal Render Pipeline (URP)✅ Yes
High Definition RP (HDRP)🚫 NoHDRP is unsupported
Skinned meshes🚫 NoCurrently unsupported to combine into static batch
Build time static batch🚫 NoInstead of build time static batch there are possibility to use load-time static batch
Runtime time static batch✅ Yes

Unity versions support

Static Batching works on all versions of Unity that Playable can run.

Limitations and Performance Characteristics

You can disable objects that were statically batched, but this may reduce rendering performance, since the GPU buffer will be changed, which may incur additional overhead.

All static meshes will try to render first, regardless of where they are located on the scene/screen.

Try not to use static batching for transparent objects. They will be rendered as usual and most likely the static batch will not affect rendering performance.

Each static batch can include up to 64,000 vertices. If there are more, the Unity Playworks Plugin creates another batch.

important

If Static Batching is negatively impacting performance or resulting in distortions in the final image, it is recommended to turn it off.
Please report any issues with Static Batching to our support team via this form.

Recommendations for using Static Batching

  • Use the same material for multiple objects.
  • Try using static packaging at runtime instead of loading time. Use it after loading and wait some time. Playable user will see your creative faster and there will be no delay in loading playable.
  • Measure the playable performance and loading time on the target device.

User Guide

  1. Open a project of your choice.
  2. Import the Playworks Plugin plugin.
  3. Create or open existing scene.
  4. Add batchable objects to your scene.
    1. See our supported features for Static Batching to check what objects are batchable.
  5. Open the Unity Playworks Plugin Window and enable Static Batching:
    1. Check Settings → Advanced → Static Batching option. images-medium
  6. Export the project and test the results:
    1. You can make sure batching is working by taking a look at the frame debugger (See the spector argument documentation). In the captured frame you could see that some of the draw calls are rendering several objects and will have name with static (use scene with disabled Static Batching for comparison).
    2. You can also toggle Static Batching in runtime (to apply changes/trigger the static batching creating process you need to reload the scene or load the next one), and measure performance, for that you could use built-in fps counter. See FPS Counter.
      Use the next method for change Static Batching option at Unity Playworks Plugin:
      void ConfigureStaticBatching( bool enableStaticBatching ) 
      {
      #if UNITY_LUNA
      // update the batching option
      Bridge.Script.Write( "pc.ProjectSettings.instance.enableStaticBatching = enableStaticBatching;" );
      #endif
      // reload the current scene - to trigger the batching process at loading scene
      UnityEngine.SceneManagement.SceneManager.LoadScene( UnityEngine.SceneManagement.SceneManager.GetActiveScene().buildIndex );
      }