Visual Debugging

The ObiDebugRenderer component can be added to any object containing an ObiSolver component. It helps visualizing underlying simulation data regarding particles and contacts. Here's how its inspector looks:


Draw simplices

Draws each individual simplex in the solver using lines to joint particles belonging to the same simplex. Note individual particles are considered 0-simplices by Obi, but they won't be visible since a line joining each particle to itself has zero length.

Draw simplex bounds

Draws the bounding box of each simplex in the solver.

Draw particles

Draws each individual particle in the solver, similar to what the ObiParticleRenderer component does.

Draw particle principal axis

Draws the principal axis of each particle, as a small orthogonal frame with a different color for each axis.

Particle size scale

Scales the size at which particles are drawn. Use 1 for visualizing the real size.

Color from property

Determines how the color used to render each particle is calculated. Some of the sources (for example, velocity) require providing a range of values and the gradient used to map that range to a color, see below.

Value gradient

Color gradient used to map property values to a color for rendering particles.

Value range

Values of the currently selected property in "Color from property" (see above) within this range will be remapped to the 0,1 range and then used to look up the value color gradient (see above).

Draw particle linear velocities

Draws the linear velocity of each particle as a line originating from it.

Draw particle angular velocities

Draws the angular velocity of each particle as a line originating from it.

Velocity scale

Scales the size of the linear/angular velocity lines drawn (see above)

Draw particle indices

Draws the integer index of each particle in the solver as a camera-facing label.

Digit atlas

Texture atlas containing the digit glyph SDFs used to draw the indices.

Text color

Color used to draw particle indices.

Indices scale

Scale of index labels.

Draw particle contact points

Draws each individual particle-particle (or generalizing, simplex-simplex) contact as a cross oriented on the plane defined by the contact normal.

Draw particle contact batches

Uses colored lines to draw the batches generated for particle-particle collision constraints. This can help you visualize how many batches are being generated and how efficient collision response in your scene is.

Draw collider contact points

Draws each individual particle-collider (or generalizing, simplex-collider) contact as a cross oriented on the plane defined by the contact normal.

Contact point color

Color used to draw the contact points.

Contact separation color

Color used to draw a line that joins each contact with the surface it was generated from.

Contact force color

Color used to draw the force produced by each contact.

Contact scale

Scales the size of the cross used to draw each contact.

Contact force scale

Scales the length of the lines that represent contact forces.