Simulation Nodes: Implement subframe mixing #107599

Merged
Hans Goudey merged 5 commits from HooglyBoogly/blender:simulation-subframe-mixing into main 2023-05-12 15:59:01 +02:00
Member

Add an implementation for the placeholder to subframe mixing.
Generally render engines can do subframe mixing themselves, but the
purpose of subframe mixing in the simulation output node is to support
higher quality motion blur with bakes when there are topology-changing
operations after the simulation output node. Linear mixing can fill the
gaps while maintaining lower memory usage.

All point/instance domain attributes are mixed, but mixing is only
supported when the domain size is unchanged, or when an id attribute
gives a mapping between elements. Theoretically it may be possible, but
nested instance geometry is not mixed in this commit due to the
difficulty of finding matching geometries across arbitrary instance
hierarchy changes. Attributes that are completely unchanged are ignored
using implicit sharing for better performance.

Add an implementation for the placeholder to subframe mixing. Generally render engines can do subframe mixing themselves, but the purpose of subframe mixing in the simulation output node is to support higher quality motion blur with bakes when there are topology-changing operations after the simulation output node. Linear mixing can fill the gaps while maintaining lower memory usage. All point/instance domain attributes are mixed, but mixing is only supported when the domain size is unchanged, or when an `id` attribute gives a mapping between elements. Theoretically it may be possible, but nested instance geometry is not mixed in this commit due to the difficulty of finding matching geometries across arbitrary instance hierarchy changes. Attributes that are completely unchanged are ignored using implicit sharing for better performance.
Hans Goudey added 1 commit 2023-05-04 05:26:52 +02:00
4ba30ee257 WIP: Simulation Nodes: Implement subframe mixing
Add an implementation for the placeholder to subframe mixing.
The purpose of subframe mixing is higher quality motion blur,
without requiring baking the entire geometry output for every
substep. Linear mixing can fill the gaps while maintaining lower
memory usage. All attributes are mixed, besides builtin topology
storage attributes. Mixing is only supported when the domain size
is unchanged, or when an `id` attribute gives a mapping between
items when the topology is changed. Attributes that are ignored
for better performance.

TODO?
- [ ] ID attribute based mixing on domains besides points
- [ ] Mixing geometries from nested instances
- [ ] Testing and demo file
Hans Goudey added this to the Nodes & Physics project 2023-05-04 05:27:13 +02:00
Jacques Lucke reviewed 2023-05-04 10:17:14 +02:00
@ -369,0 +377,4 @@
if (a != b) {
return false;
}
if (a->version() != b->version()) {
Member

This line probably does not make sense. Comparing versions across different sharing info is kinda meaningless, and if it is the same sharing info, the version will be the same. Two check if two attributes are the same, just check if the data pointer is the same.

Using the version makes sense when you want to compare the old state of an attribute with the new state without having keep the old state around if no one uses it anymore. But here you always keep the old and new state around anyway.

This line probably does not make sense. Comparing versions across different sharing info is kinda meaningless, and if it is the same sharing info, the version will be the same. Two check if two attributes are the same, just check if the data pointer is the same. Using the version makes sense when you want to compare the old state of an attribute with the new state without having keep the old state around if no one uses it anymore. But here you always keep the old and new state around anyway.
HooglyBoogly marked this conversation as resolved
@ -369,0 +645,4 @@
}
void *prev = value_or_field_type.get_value_ptr(prev);
const void *next = value_or_field_type.get_value_ptr(next);
Member

Need to check if next is a field as well. No need to mix between field and non-field simulation states for now (even though it should be possible)

Need to check if `next` is a field as well. No need to mix between field and non-field simulation states for now (even though it should be possible)
Hans Goudey added 4 commits 2023-05-09 21:52:52 +02:00
Hans Goudey changed title from WIP: Simulation Nodes: Implement subframe mixing to Simulation Nodes: Implement subframe mixing 2023-05-09 21:59:05 +02:00
Hans Goudey requested review from Jacques Lucke 2023-05-09 21:59:15 +02:00
Jacques Lucke approved these changes 2023-05-12 14:43:51 +02:00
Hans Goudey merged commit e6e6fb3a62 into main 2023-05-12 15:59:01 +02:00
Hans Goudey deleted branch simulation-subframe-mixing 2023-05-12 15:59:02 +02:00
Howard Trickey referenced this issue from a commit 2023-05-29 02:51:40 +02:00
Sign in to join this conversation.
No reviewers
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 Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#107599
No description provided.