When you enable the physics substepping, if you run the console command p.Chaos.Solver.DebugDrawSpatialAccelerationStructure 1, you can see how does not follow the physical object. The user that reported the case has attached a repro project where you can test this issue immediately.

The issue happens mainly when the application runs at 30-40 fps or less. Due to the process of substepping altering physics deltatime, there must be an error that makes SpatialAccelerationStructure to break.

I've been debugging and if it helps, it looks like KinematicsParticles of PBDRigidsSOAs.h is setting the position wrong.

Lastly, if you force the application to run at 2 frames, you can see the issue more clearly. The Spatial Structure is rendered 1 position to the final one. If substepping calculates 6 possible positions, the physical cube moves to the 6th, while the Spatial Structure stays at the 5th.


Steps to Reproduce

Use the repro SpatialAcceleration project or create a new one:

1- Go to ProjectSettings/Physics/Framerate and enable Substepping
2- Create a Level and with a Cube.
3- In the Level Blueprint, execute the following commands:

  • p.Chaos.DebugDraw.Enabled true
  • p.Chaos.Solver.DebugDrawSpatialAccelerationStructure 1
  • p.Chaos.Solver.DebugDrawShapes 1
  • t.MaxFPS 30
    4- Also set a looping timer event, moving the cube between two positions.
    5- You should see How the Spatial Acceleration Structure is totally out of sync with the cube shape. If you now set the application manually to 2 FPS, you can see all the Spatial Substepping being drawn, and which one the Spatial Acceleration Structure is choosing.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-209877 in the post.

Login to Vote

ComponentUE - Simulation - Physics
Affects Versions5.3.2
Target Fix5.5
CreatedMar 15, 2024
UpdatedApr 5, 2024