Simulation nodes: Automatic cache reset behavior #105724
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#105724
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
Terminology
To make discussion of inputs and outputs easier, the following naming convention is be used:
Stepping
Some node evaluations don’t involve a time step (e.g. loading a file). In those cases the simulation inputs are used unmodified as simulation outputs.
If an iteration is computed during node evaluation then the simulation outputs are defined as follows:
When cached data is available for the exact current frame the outputs simply expose the cached data.
Simulation inputs are ignored.
When cached data for the current frame is not available, but exists for an earlier frame, an iteration is performed with the necessary time step.
Simulation inputs are ignored.
Iteration inputs are cached data.
When previous data is unavailable or invalid, then the current simulation inputs are used and piped straight to iteration inputs.
This is only correct for the start frame (to keep results deterministic), so on other frames a warning should be shown if no cached input is available.
Invalidating Caches
A cache becomes invalid if the scene data is changed such that the output for the current frame will be different. This could be because
In practice it will be difficult to determine precisely when changes do or do not affect the simulation. False positives have to be expected, that is: invalidating the cache when it wouldn’t have to be. This is because we have to rely on coarse depsgraph dependencies. It is preferable to invalidate the cache unnecessarily than to keep cached results and miss potential changes. Over time the dependencies affecting nodes may be refined for more stable caching.
Reset
The term "reset" describes the point when a simulation reverts to the initial scene data, typically when animation jumps back to the start frame (Point 3 in Stepping).
Conditions that can cause a reset (only when cache is invalid!)
A reset should not happen just because the cache got invalidated. For example: A particle simulation might use an object as emitter. The user moves this object manually during simulation, which constantly invalidates the cache. However, the particle simulation should not reset: all the current particles remain in the simulation.
The last valid simulation state is always retained even if the rest of the cache is invalidated. That way simulations can be tested dynamically.
Baking
Baked caches are never invalidated automatically.
If a baked cache exists then the simulation input should never be used and no further iterations should happen. The simulation output is always read from the cache.
A baked cache must be freed explicitly, at which point it reverts back to a dynamic cache.
Notes
Updated Hans' initial comment.