Particle rendering

Since Obi uses particles to represent all of its actors internally (cloth, ropes, fluids...), sometimes it makes sense to actually draw this particle-based representation in your scene: for debugging purposes, or as an alternative visualization mode. To render an actor's particles, just add an ObiParticleRenderer component to it. Any class that derives from ObiActor can have a particle renderer attached:

  • ObiCloth
  • ObiTearableCloth
  • ObiRope
  • ObiRod
  • ObiSoftbody
  • ObiEmitter

There are two particle renderer components: ObiParticleRenderer and ObiInstancedParticleRenderer (Obi 4.1 and above only). Let's take a look at each one:

Obi Particle Renderer

Particles are rendered as spherical impostors, which are just quads with a special shader applied. They are not actual sphere-shaped meshes (though they look like it), so thousands of them can be rendered at very little performance cost, without the need for GPU instancing support.

Here's how the inspector for ObiParticleRenderer looks:

Render

You can disable this checkbox and the particles won´t be rendered, but the mesh used to render them will still be generated. This is useful in conjunction with components that take this mesh as an input and render it in a different way, like ObiFluidRenderer.

Shader

Shader used to shade the particles. By default, a shader for the built-in render pipeline is used. There's a URP shader available too (ParticleShaderURP). You can also write your own custom shaders.

Particle Color

Tint color of your particles. This color will be multiplied by the particle's own color (solver.colors array, see scripting particles).

Radius scale

This scales the size at which particles are drawn.

Rope, cloth and fluid being rendered as particles.

Obi Instanced Particle Renderer

Particles are rendered as GPU instances of a mesh. They will accurately reflect particle position, orientation and scale. Note that this requires GPU instancing support, and the use of a instancing-enabled material.

Here's how the inspector for ObiInstancedParticleRenderer looks:

Render

You can disable this checkbox and the particles won´t be rendered.

Mesh

Mesh used for instancing.

Material

Material used for instancing. Note that it has to have its "Enable GPU instancing" property on.

Instance scale

This scales the size at which particles are drawn in the local X, Y and Z axis.

Particles w/rolling contacts being rendered as rock instances.