Backends

A backend is the actual physics engine used by a solver to step the simulation forward. Different backends might have different platform compatibility, performance, and capabilities. While you can select a different backend for each individual solver in your scene, most of the time you will want all solvers to use the same backend. To select a different backend for a solver, use the "Backend" dropdown in the solver inspector:


Obi 5.5 ships with two backends to choose from: Oni and Burst.

Oni

Oni is the 'classic' backend used since Obi 2.x. It is a native library written in C++11, that comes precompiled for each platform. For this reason, only a few platforms are supported by it: Windows, Mac, Linux, Android, iOS. It is a fully CPU-based backend, that makes heavy use of multithreading and SIMD intrinsics (single-instruction, multiple-data). It can be used for small to mid scale simulations on a wide range of devices. It is used as a fallback in case the Burst backend dependencies are not installed, see below.

When profiling a simulation backed by Oni, it is useful to add the ObiProfiler component to your solver. This will overlay profiling data over your game view while in play mode.


Burst

Burst is the default backend since Obi 5.6. It is fully written in high-performance C#, making use of Unity's Burst compiler and job system. It supports all platforms that can run jobs and that the Burst compiler can compile for. Like Oni, it is fully CPU-based, and makes heavy use of multithreading and SIMD (thanks to the job system and Burst, respectively). Performance on most platforms -specially mobile devices- is slightly better when using Burst. For this reason, Burst should be preferred over Oni when possible.

Using the Burst backend requires having the following Unity packages installed (if you don't have these installed, Obi will try to fall back to the Oni backend):

  • Burst 1.3.3 or newer
  • Collections 0.8.0-preview 5 or newer
  • Mathematics 1.0.1 or newer
  • Jobs 0.2.9-preview.15 or newer

If you don't have these installed, ObiSolver will show a warning in the inspector and try to fall back to the Oni backend:


When profiling a simulation backed by Burst, you can use Unity's built-in profiler, no need to use ObiProfiler. In timeline mode, you will see all worker threads busy during the physics update call:


The full source code for the Burst backend is included in your Obi installation, it can be found at /Obi/Scripts/Common/Backends/Burst/.