Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  ObiCloth + character interpolation - how to fix jittering?
#3
(10-01-2022, 08:36 AM)josemendez Wrote: The only way to get this to work without resorting to update cloth in LateUpdate is to take full control over the update order of both your character controller and the cloth simulation. Things must happen in this specific order:

1) - Character animation
2) - Character interpolation
3) - Cloth simulation.

You will have to modify your character controller so that it performs the interpolation before cloth simulation. This can be done in a variety of ways, the simplest being:

Hey Jose, apologies for necroing this thread after so long! I'm (finally) revisiting the issue.

Yep, totally understand that cloth needs to be updated in `FixedUpdate` (and, because of the way my game works, characters also need to be updated in the `FixedUpdate` timestep as well). I think I did a poor job of explaining the original issue:

My character controller (which is updated in FixedUpdate) performs interpolation in Update, similar to how `ObiUpdater.Interpolate` works. That is, it interpolates between the previous and current states of the characters transform's position and rotation, just before scene rendering. No simulation is happening in this interpolate step; I update my characters (and the rest of the game logic) at 30fps, but render at 60+ fps, and so the interpolation just smoothes out character motion. 

In other words, the game's characters get rendered at a slightly different location than they were last simulated at. What I'd like to do is have the cloth's render location match up with the interpolated character location (WITHOUT performing any additional cloth simulation; the cloth is already simulated, but now it just needs to be shifted slightly to the new interpolated location for rendering purposes - and then shifted back to its proper location before the next cloth simulation step executes).

Does this clarify things at all? Is it possible to achieve what I'm looking for?

Thanks!
Reply


Messages In This Thread
RE: ObiCloth + character interpolation - how to fix jittering? - by timconkling - 27-09-2023, 07:34 PM