27-03-2025, 09:15 PM
(This post was last modified: 27-03-2025, 09:21 PM by josemendez.)
(27-03-2025, 05:49 PM)natko1412 Wrote: I am using Compute backend.
In my server app, the simulation is running and everything is fine. On my client, I am setting the positions and velocities like this:
where positions and velocities are synchronized lists. This worked very well in Obi 6, but now it doesn't work no matter what. Can you tell me if something else changed. It seems from documentation like positions and velocities are automatically synced to GPU so I don't know what I'm missing.Code:for (int i = 0; i < positions.Count; ++i)
{
int solverIndex = actor.solverIndices[i];
actor.solver.positions[solverIndex] = positions[i];
actor.solver.velocities[solverIndex] = velocities[i];
.
.
.
Hi!
Positions and velocities are read back from the GPU at the end of each simulation step, and uploaded to the GPU at the start of the next step as per the manual:
Quote:Obi will automatically upload particle data to the GPU at the start of every simulation step (only those data lists that have been modified by the CPU since the last time they were uploaded).
You’ve disabled simulation by setting the maximum amount of steps per frame to zero, so they won’t be automatically sent to the GPU. You must send them manually. Call the Upload() method on both the positions and velocities solver arrays after your for loop to do so.
Kind regards,