Regression: Physics force field strength affect varies inversely proportion to physics substeps per frame #98272
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#98272
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows 10 Enterprise
Graphics card: Nvidia Quadro RTX 4000
Blender Version
Broken: 3.1.0 (same in 3.3.0 alpha)
Worked: 2.83.20
Caused by
1aa54d4921
Short description of error
Physics force field affect is inversely proportional to the rigid body world solver substeps per frame. For example if you increase steps per frame by x10, the force effect is x1/10. Thus to maintain the same force result you have to match any changes to the substeps per frame to changes to the factor on force strength.
This issue doesn't exist with 2.83.20 and I noticed that this older version had 'steps per second' which has since changed to 'substeps per frame', so I suspect there might be some issue related to this change.
Exact steps for others to reproduce the error
See attached '2022-05-19 force substep dependence.blend'. 2022-05-19 force substep dependence.blend
Alternatively the issue is easy to recreate...
Added subscriber: @badbunny_uk
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Can confirm, will check
Added subscribers: @JacquesLucke, @ZedDB, @brecht
Caused by
1aa54d4921
I will dare setting this to High prio since we know what caused this and it basically makes using substeps in combination with forcefields useless.
(but prio could be lowered again since rigidbodies lack a dev atm)
CC @ZedDB
CC @JacquesLucke
CC @brecht
Physics force field strength affect varies inversely proportion to physics substeps per frameto Regression: Physics force field strength affect varies inversely proportion to physics substeps per frameIt seems like the issue is that the beginning of
btDiscreteDynamicsWorld::stepSimulation
computes that there should only be one subset.clampedSimulationSteps
always ends up being 1 for me. I don't really know why that is yet. The meaning of thetimeStep
andfixedTimeStep
input to the function is not clear to me.This might have been broken by the change to the parameters that are passed to
RB_dworld_step_simulation
.Added subscriber: @sreich
CC @sreich
Added subscriber: @LukasTonne
The problem here is that the force value of the RigidBody is temporary and gets reset to zero after each Bullet simulation step. The first (Blender) substep has the correct value set by
rigidbody_update_simulation
(called outside the substep loop), but after that the external force on the body is zero and no further impulse is added.The smaller substep number makes a larger timestep which increases the impulse added in the first timestep. In the remaining substeps the body just coasts at a constant velocity and no further impulse is added. If the force was set correctly in each substep we could expect the smaller per-step impulse to be compensated by the larger step number and the overall impulse over the whole timestep to be the same.
So the solution should be to call
rigidbody_update_simulation
for each of the substeps to ensure correct force values.The arguments to the Bullet step function are actually correct (stackoverflow explanation ):
timeStep
: Overall actual time step in seconds. Physical time sincestepSimulation
was last called.fixedTimeStep
/timeSubStep
(C++ vs C-api, same thing): A fixed time step (typically 1/60 second) which is the actual step used by Bullet internally and help stabilize simulation. Variable timestep is usually not recommended because it causes stability issues in many cases, but since Blender already has a fixed, frame-based timestep this doesn't matter.maxSubSteps
: If > 0 then it will perform fixed timesteps adding up to thetimeStep
count (min(maxSubSteps, (int)(timeStep / fixedTimeStep))
), and the remainder is filled by an extra step and then interpolating to the fraction of time remaining. We just use 0 for a "variable" timestep, which is actually just fixed to the Blender substep.This issue was referenced by
f4d8382c86
Changed status from 'Confirmed' to: 'Resolved'