Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  ObiCloth + character interpolation - how to fix jittering?
#6
(12-10-2023, 06:47 AM)josemendez Wrote: Hi Tim,

Sorry for taking so long to reply, your post slipped trough the cracks. Very sorry for that.

Yes, it is possible to do what you need. Particles in Obi have a "renderablePosition" property, which is used to store interpolated positions (when solver interpolation is enabled, which I assume you're already using but found it doesn't work in your case due to the specifics of your custom interpolation system) and used for rendering the cloth. 

The physics simulation outputs particle "positions" in FixedUpdate(), then every frame in LateUpdate() it interpolates the previous and current particle positions and stores the result in "renderablePositions". These values are then used to update the cloth mesh. Renderable positions are not fed back into the next simulation step, they're discarded and re-calculated the next LateUpdate().

So if you're performing custom character interpolation, you can shift the values in solver.renderablePositions so that they match up with your character. This is best done in the solver.OnInterpolate callback event, which is called
after the solver populates the renderablePositions array, but before using it to update the cloth mesh. This will basically overwrite the results of Obi's internal interpolation with your own values right before rendering each frame.

kind regards,

This makes sense - thanks so much! I'll post back here once I've had a chance to implement.
Reply


Messages In This Thread
RE: ObiCloth + character interpolation - how to fix jittering? - by timconkling - 17-10-2023, 05:35 PM