Setting it up

First of all, import the Obi package of your choice (cloth, softbody, rope or fluid) into your project. You can do this via Unity's Package Manager, via the Asset Store, or from disk by right clicking on your project folder in the Unity editor and selecting Import Package->Custom package.

If you own several Obi assets, you can just import them all one after another as long as they have the same version. Do not mix and match packages with different versions, this might break your Obi installation.

Once imported, you can find Obi installed in the /Assets/Obi folder. You may move the entire /Obi folder around, but you should not modify its contents.


The asset is organized in 4 subfolders:

Editor/
Contains editor scripts and tools, only used when running Obi inside the Unity editor.

Resources/
Contains resources used at runtime, mainly materials and shaders.

Samples/
Contains sample scenes, resources and scripts. If you're not interested in these, it's safe to remove the entire Samples folder from your project.

Scripts/
Contains scripts and tools used at runtime.

Installing package dependencies

Most shaders included with Obi have been created using Shader Graph, Unity's visual node-based shader editor. In order for these shaders to compile, you must install Shader Graph 12.1.7 or newer via the Package Manager.

Obi can run simulations in either the CPU or the GPU. CPU simulation is performed using the Burst backend, while GPU simulation is performed using the Compute backend. In order to use Burst and perform simulation in the CPU, you must install several packages:

  • 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

See the backends page for details.

Compatibility with SRPs (Scriptable Render Pipelines)

Obi is a physics engine. With the important exception of Obi Fluid (see below), Obi assets do not perform or require any custom rendering, nor are they tied to specific materials or shaders. This means they're pipeline-agnostic, and will work regardless of the render pipeline used in your project.

However, the included sample scenes are made for Unity's default, built-in render pipeline. When objects in a scene use shaders/materials incompatible with the current render pipeline, Unity will just draw them in a flat pink color. So if you're using URP, HDRP, or a custom pipeline, you will probably want to convert the sample scenes content to your pipeline for adequate rendering.

This can be done using Unity's automatic material conversion, up to an extent. Unity may fail to convert all materials in a scene, in that case you can just select the remaining pink objects and change their material/shader to an URP/HDRP compatible one:


If you're not using SRPs but the built-in pipeline, it's safe to delete the /Obi/Resources/ObiMaterials/URP folder. Otherwise Unity will raise an error at build time, stating that it cannot find the URP pipeline installed.

Obi Fluid

To render fluid surfaces, Obi Fluid generates a mesh which uses a custom vertex format. For more information on how to create and setup shaders for the different render pipelines, see the fluid rendering page.