Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Interpolation frame delay
#4
(25-09-2018, 11:08 AM)Sewy24 Wrote: Hello Jose,


thanks for the reply. 

"Fixed particles are not interpolated, which I believe it is what led you to use skin constraints instead." this is exactly the thing.
Unfortunately moving the code with summary 
Code:
/**
* Transforms the position of fixed particles from local space to simulation space and feeds them
* to the solver. This is performed just before performing simulation each frame.
*/
from OnSolverStepBegin() to OnSolverFrameEnd() has no interpolation effect on the fixed particles. (Every other particle is butter smooth in both cases). - I've try to move it to other functions as well in case of typo, but not change at all.

My bad, there's another important difference that affects the fixed particle behaviour when paired with skinned meshes. In ObiSolver.cs, SimulateStep() method, you'll see a call to Oni.UpdateSkeletalAnimation();. Move this call to the solvers Update() method, right after the loop calling actor.OnSolverFrameBegin();. Would look like this:

Code:
void Update(){

        if (!Application.isPlaying)
            return;

        if (OnFrameBegin != null)
            OnFrameBegin(this,null);

        foreach(ObiActor actor in actors)
           actor.OnSolverFrameBegin();

       // Update Oni skeletal mesh skinning after updating animators:
       Oni.UpdateSkeletalAnimation(oniSolver);

        if (IsUpdating && simulationOrder != SimulationOrder.LateUpdate){
            AccumulateSimulationTime(Time.deltaTime);
        }

    }

This will ensure that the actual skinned mesh is updated every frame, not only during physics steps.

Also note that for this to work, the transform that the cloth is attached to (Cube_simul) must be translated in Update(), not in LateUpdate() (there would be a 1-frame delay) or FixedUpdate() (fixed particles would not be interpolated) as you're currently doing.
Reply


Messages In This Thread
Interpolation frame delay - by Sewy24 - 24-09-2018, 09:30 AM
RE: Interpolation frame delay - by josemendez - 24-09-2018, 11:13 AM
RE: Interpolation frame delay - by Sewy24 - 25-09-2018, 11:08 AM
RE: Interpolation frame delay - by josemendez - 26-09-2018, 03:02 PM
RE: Interpolation frame delay - by Sewy24 - 04-10-2018, 04:58 PM