separate rendering and simulation threads

sakanch
Posts: 1
Joined: Wed Jul 03, 2013 8:54 am

separate rendering and simulation threads

Post by sakanch »

Hi

I'm trying to separate the simulation and rendering computations into two threads. But i can't get rid of the jittering. I think the problem is the interpolation.
So far i have tried it with no interpolation, running the simulation thread with a much higher frequency in the hope that interpolation is not necessary, and different time steps for the interpolation.
The stepSimulation() function interpolates with the time that remains after advancing the simulation with the fixed timestep. I think i have to interpolate with the time that passes between the simulated time and the beginning of the rendering (correct?). Im trying to measure this time and then interpolate with the rigidbody's predictIntegratedTransform() function, but jittering is still there...
The two threads are approximately running at the same frequency.

Has someone made experiences with this problem and can give me some advices?
Thanks in advance for any help.

Edit: forgot to mention: no jittering when i use only one thread.