Slow Physics Meshes


A common problem in OpenSim is that objects that have complex physics meshes can cause the world to start slowly. A physics mesh is the part of the object that determines where it’s solid, and where avatars can walk through it. For example, suppose you have a large arch in your world. The object’s physics mesh would also be in the shape of an arch: this is what allows users to walk back and forth under the arch.

Most physics meshes are simple and don’t cause a problem. However, if these physics meshes are very complex (i.e., they contain many triangles), then it takes OpenSim a long time to parse them. This makes the world start slower, because this parsing is performed when the world starts. In some cases we’ve seen worlds that take an extra 10 minutes (!) to start, just because of the time that they have to spend parsing complex physics meshes.

Note that all objects have a physics mesh; not only mesh objects. However, in practice, usually only mesh objects (and some sculpties) can have a physics mesh that’s complex enough to cause a problem.

Automatic Handling of Slow Physics Meshes

When a world starts, we automatically find objects that take 2 seconds or more to parse, and we make them Phantom. When this happens, we also send an email to the world owner with a list of the slow objects.

Technically, we actually handle slow objects in one of two ways:

  • If the object is standalone (not part of a linkset) then we make it Phantom.

  • If the object is the root prim of a linkset then we make the entire linkset Phantom. That's because in Second Life and OpenSim, it isn't possible to make only the root prim of a linkset Phantom.

  • If the object is part of a linkset, but not the root prim, then we change the object's "Physics Shape Type" to "None". This has the same effect as making it Phantom, but without having to make the entire linkset Phantom.

How to Make Complex Objects Non-Phantom Again

If you received an email that notified you that we made some objects Phantom, and you don't want them to be Phantom, then you need to do the following:

  1. Find the slow objects (they are listed in the email that you received).

  2. For each object, edit its physics mesh in order to make it simpler (use fewer triangles). For objects that are themselves meshes, this may be as simple as re-uploading the mesh, while selecting a simpler Physics mesh in the upload dialog.

  3. Remove the Phantom flag from these objects. (Or, if the object was part of a linkset but not the root prim, then change the object's "Physics Shape Type" from None to Prim.)

We check for slow physics meshes every time a world starts, so if the new physics mesh is still too complex then we'll notify you about it the next time the world is started.

Alternative for Linksets: Change the Root Prim

As explained above, if a slow object is the root prim of a linkset then we make the entire linkset Phantom. One way to solve this is to optimize the object's physics mesh; that solution is described above. However, there's a trick that may be much easier: just rearrange the linkset so that the slow object isn't the root prim. Then, we can make just the slow object Phantom, instead of making the entire linkset Phantom.

If you want to use this trick then follow this procedure:

  1. Remove the Phantom flag from the linkset.

  2. Unlink the linkset.

  3. Re-link the linkset, but this time make sure that the root prim isn't the slow object.

If you complete these steps, then the next time your world starts our system will only change to Phantom the individual slow objects that are in the linkset, instead of the entire linkset.