Geometry Nodes: Freeze Node #106497
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#106497
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?
The
Freeze Geometry
node can store the procedurally generated input geometry, allowing it to output the geometry without having to recompute it every time. It's also capable of storing different geometries for different frames. This is also a first step towards the strictly more generalEdit Geometry
node that has been discussed before.Even without the ability to manually edit the frozen geometry (which is what the
Edit Geometry
node would allow) this node has important use cases:Baking using Freeze Geometry vs. special purpose simulation baking
The main reason I'm writing this document now is that I was working on baking for simulation nodes. Doing that, I noticed that what makes this hard is the same thing that would make the
Freeze Geometry
node hard. There are some benefits to using the more general solution than something that is specific to simulation:Freeze Geometry
node can be worked on independently of simulation nodes.There are also some disadvantages which don't outweigh the benefits currently:
Freeze Geometry
node does not store the entire simulation state (but only the output geometry), it's not (easily) possible to continue baking a partially baked simulation after restarting Blender. This functionality could be added separately in the future of course.Storing the Geometry
It should be possible to store the frozen geometry in within the .blend file and to store it externally.
The storage within the .blend file is not entirely trivial because a
GeometrySet
is not just an ID data block that is inMain
. Also we likely want to support compression across multiple non-main geometry data blocks, because animated geometry often contains duplicate data at different frames. Handling instances is also a bit tricky since they are not anID
data block either (other than e.g.Mesh
).An alternative would be to actually store the frozen geometry data blocks in
Main
(except for instances for now, probably). The downside is that this might add a relatively large number of data blocks, especially when freezing an animation. It's unclear whether all the individually frozen geometries should just be normal data blocks or whether they should be hidden from the user in some way.For storing frozen geometry externally, the same considerations done in #105251 apply. A custom format likely works best for this use case because it allows us to store all the data we want without overcomplicating the
.blend
file format (this is kind of similar to.geo
and.bgeo
files).Manual vs. Automatic Caching
Ideally, we would implement automatic caching in geometry nodes before manually freezing geometries, because that would solve some use cases of the
Freeze Geometry
node in a better way. The problem with that is that people learn to use theFreeze Geometry
node in cases where it is not necessary in the future. Longer term, it's likely less relevant which form of caching is implemented first, because it shouldn't be too hard to unlearn adding aFreeze Geometry
node once it doesn't help performance anymore.Store geometry per node vs. per node per context
There are two main places where the frozen geometry can be stored. Both approaches have valid use cases, so it may be necessary to support both (now or longer term).
Anonymous Attributes
Anonymous attributes present a challenge because which attributes a node propagates depends on what happens to the right of the node (more precisely on which anonymous attributes are used there). The consequence of that is that anonymous attributes that are not needed when the geometry is frozen are not available later on when the anonymous attribute is used because something later in the tree changed.
There are three possible solutions here:
Freeze Geometry
in the middle of an existing node setup and users would be forced to use named attributes.Freeze Geometry
node using additional sockets (this was originally mentioned here). This makes it possible for users to use the freeze node without having to resort to named attributes, but it's still not trivial to add the node in the middle of an existing setup. This also has the problem that it doesn't work well when an anonymous attribute only exists on parts of the geometry set (e.g. only on a mesh, but there is also a point cloud that doesn't have it).Currently, I think option 3 would work best. This is easier now than it used to be during the last discussion because of
2ffd08e952
.Global Simulation Baking
In cases where there are multiple simulations on potentially multiple objects, we want to have the ability to freeze them all with the click of one button. It's not entirely clear to me yet how this should be done in a good way. Somehow the user would have to specify which
Freeze Geometry
nodes should be frozen. If there are multiple simulations in a chain, it should only be necessary to cache the output of the last simulation (I expect this case to become fairly common as simple simulations are abstracted away using node group assets). The even more tricky thing is to unfreeze, because we likely don't actually want to unfreeze everything in case the user explicitly wanted to keep something frozen.In either way, with the
Freeze Geometry
node replacing other special purpose simulation baking, the user would have to add and configure the node whenever an object has a simulation. Otherwise it can't be baked using a global button. In a production environment that is unlikely to be an issue and might even be benefitial because of the added control. Simple Python scripts could be used to freeze/unfreeze exactly as desired. It's mostly the simple "out of the box" experience that suffers a bit..Main Unknowns
What would a combination of
Freeze
andEdit
nodes look like? It seems to me thatEdit Geometry
is an extension ofFreeze
, with the edit mode built on top of the existing caching. Will theEdit
node be usable on its own or do you still need toFreeze
first and thenEdit
, and does that mean caching data twice?Would it be fair to say that baking is necessary for efficient (parallel) rendering? In principle you can currently render single-threaded and in sequence, doing simulations on-the-fly. That's not recommended for final rendering, but should currently be possible by design (at least if our physics code would support it properly).
If there was a general "Prepare for Render" stage at the end to cache all the things, would it be able to detect existing cache nodes and re-use them to avoid unnecessary duplication?
That's exactly what I meant.
We don't have a full design of the edit functionality yet, and it could probably be implemented either way.
Yeah, I think so. The main difficulty here might be that the rendering code might have to know substeps the simulation needs exactly
Long term, we should try that even if there are multiple cache nodes, there is no significant memory duplication even when they store the same geometries. At run-time that will be relatively easy to do with implicit-sharing, but the .blend file format doesn't really support that yet.
For the records, this patch was discussed here: https://devtalk.blender.org/t/2023-04-04-nodes-physics-module-meeting/28457
I've been thinking about an alternative. Basically to embrace the concept of checkpoints a bit more.
What is a check-point? Any point in the node-tree that you can bake and use the baked result instead.
Checkpoints:
The checkpoints are scattered inside the node-trees and they store specific baking setting. There is an overview on the object level (or scene level?) that allow you to see all the checkpoints inside an object.
On that level you can check for each of the checkpoints:
That means that a simulation zone is a check-point on its own, but it doesn't need to be included when baking. Also chained simulations can be disabled for object-level baking, leaving only the last one (or a freezing node).
Final thoughts:
I agree freezing and caching/baking are very similar, and the node implementation and UI can be almost entirely shared. But I think there should still be some distinction on the UI level.
Freeze/unfreeze to me is an explicit action that a user takes for a specific point in the node graph or modifier stack. Where you say, I'm done editing this part of the node graph, and now I will continue editing beyond this either with more procedural nodes or manual editing.
Caching/baking on the other hand should be mostly automatic and globally controlled. Here I think a users wants to set things up in such a way that they can safely clear the cache/bake and re-bake, or have a render farm do it. Whereas unfreezing all frozen nodes would not be something you can do so casually.
I don't really care if cache/bake is built into simulation nodes somehow, or rather a separate node that is part of default node groups. But I think if it's a separate node it should not be the same as the freeze node even practically if all its settings end up being the same.
There is a new proposal that replaces this one.
https://devtalk.blender.org/t/geometry-nodes-checkpoints-proposal/29266