Fracture Modifier 2.8 port #54888
Open
opened 2018-04-29 20:51:26 +02:00 by Martin Felke
·
32 comments
No Branch/Tag Specified
temp-sculpt-dyntopo
temp-sculpt-dyntopo-hive-alloc
main
blender-v3.6-release
node-group-operators
brush-assets-project
asset-shelf
tmp-usd-python-mtl
blender-v2.93-release
blender-v3.3-release
universal-scene-description
asset-browser-frontend-split
temp-sculpt-attr-api
blender-v3.5-release
realtime-clock
sculpt-dev
gpencil-next
bevelv2
microfacet_hair
blender-projects-basics
principled-v2
v3.3.7
v2.93.18
v3.5.1
v3.3.6
v2.93.17
v3.5.0
v2.93.16
v3.3.5
v3.3.4
v2.93.15
v2.93.14
v3.3.3
v2.93.13
v2.93.12
v3.4.1
v3.3.2
v3.4.0
v3.3.1
v2.93.11
v3.3.0
v3.2.2
v2.93.10
v3.2.1
v3.2.0
v2.83.20
v2.93.9
v3.1.2
v3.1.1
v3.1.0
v2.83.19
v2.93.8
v3.0.1
v2.93.7
v3.0.0
v2.93.6
v2.93.5
v2.83.18
v2.93.4
v2.93.3
v2.83.17
v2.93.2
v2.93.1
v2.83.16
v2.93.0
v2.83.15
v2.83.14
v2.83.13
v2.92.0
v2.83.12
v2.91.2
v2.83.10
v2.91.0
v2.83.9
v2.83.8
v2.83.7
v2.90.1
v2.83.6.1
v2.83.6
v2.90.0
v2.83.5
v2.83.4
v2.83.3
v2.83.2
v2.83.1
v2.83
v2.82a
v2.82
v2.81a
v2.81
v2.80
v2.80-rc3
v2.80-rc2
v2.80-rc1
v2.79b
v2.79a
v2.79
v2.79-rc2
v2.79-rc1
v2.78c
v2.78b
v2.78a
v2.78
v2.78-rc2
v2.78-rc1
v2.77a
v2.77
v2.77-rc2
v2.77-rc1
v2.76b
v2.76a
v2.76
v2.76-rc3
v2.76-rc2
v2.76-rc1
v2.75a
v2.75
v2.75-rc2
v2.75-rc1
v2.74
v2.74-rc4
v2.74-rc3
v2.74-rc2
v2.74-rc1
v2.73a
v2.73
v2.73-rc1
v2.72b
2.72b
v2.72a
v2.72
v2.72-rc1
v2.71
v2.71-rc2
v2.71-rc1
v2.70a
v2.70
v2.70-rc2
v2.70-rc
v2.69
v2.68a
v2.68
v2.67b
v2.67a
v2.67
v2.66a
v2.66
v2.65a
v2.65
v2.64a
v2.64
v2.63a
v2.63
v2.61
v2.60a
v2.60
v2.59
v2.58a
v2.58
v2.57b
v2.57a
v2.57
v2.56a
v2.56
v2.55
v2.54
v2.53
v2.52
v2.51
v2.50
v2.49b
v2.49a
v2.49
v2.48a
v2.48
v2.47
v2.46
v2.45
v2.44
v2.43
v2.42a
v2.42
v2.41
v2.40
v2.37a
v2.37
v2.36
v2.35a
v2.35
v2.34
v2.33a
v2.33
v2.32
v2.31a
v2.31
v2.30
v2.28c
v2.28a
v2.28
v2.27
v2.26
v2.25
Labels
Clear labels
Issues relating to security: https://wiki.blender.org/wiki/Process/Vulnerability_Reports
Apply labels
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
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
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
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
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
Issues relating to security: https://wiki.blender.org/wiki/Process/Vulnerability_Reports
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 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
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
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
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
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
Milestone
Set milestone
Clear milestone
No items
No Milestone
Projects
Set Project
Clear projects
No project
Assignees
Assign users
Clear assignees
No Assignees
23 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#54888
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
This is a summary of my design thoughts for porting the Fracture Modifier to 2.8
based on https://lists.blender.org/pipermail/bf-committers/2018-February/049150.html and following.
It is intended to open a hopefully fruitful discussion about what to consider during the Fracture modifier port and even the cache design.
For now, I assume Alembic will be used as cache backend, like described in https://developer.blender.org/T54690
There duplis are mentioned to represent streamed geometry in blender.
The Fracture Modifier should hold internally some representation of streamed geometry too, but return a regular mesh datablock, so it can be used as a regular modifier in the stack.
Using duplis here on object level would fix the geometry streaming to the base object thus being like always the first modifier.
But it is useful to have other modifiers before the FM, to be able to fracture this content and use it nondestructively.
Generally the geometry cache just shall avoid continouous refractures which are computationally expensive.
For example this is bmesh boolean and bisect for less suitable / nonmanifold geometry.
Modularization of Geometry Generation
Maybe it is wise decouple the actual "cutting" method ? For example just feed in raw voronoi cells, "process" them and write result to alembic geometry cache.
Process is boolean or bisect or maybe something else.
Even more generally spoken, decouple geometry generation from storage.
The generation process can be nonvoronoi too, like island decomposition or even vdb-based volume fracturing.
(just to make sure design is modular and extendible here)
Base / previous modifier Geometry → geometry generator operator (voronoi shatter (+intersect provider), island decompose, packing separate objects) → FM
Modularization of Cache
It is important in case we decide to have different backends / or backend has major update.
Suggestion would be to split the cache logically to a Geometry Cache and a Transform Cache.
Geometry Cache
The storage engine should be encapsulated in a "geometry storage provider".
(can be abc, can be different format for static geometry atleast, just to decouple it)
And how to keep geometry "parts" apart ? natural mesh islands, user selectable facemaps, generated facemaps
vertexgroups (something which isnt awfully slow, since it will be needed to advance the simulation)
storage provider needs to be dynamic, as in must be able to store more geometry (or less) per frame, without doubling the existing geometry, which is there on subsequent frame ranges
as in change contents at change events, but keep indifferent pieces only once. kinda smart geometry storage (vs Alembic dumping all in each frame)
Thats why each cache item should have an own frame range, but additionally we quickly need to query what is on frame x (lookup structure, update during simulation, slower at sim, faster playback)
for faster sim maybe option for "dumb/ big storage" ? and "smartify" in an additional post step to reduce persistent file footprint
Transform Cache
The simulation cache should be a "transformation provider", which can transform the geometry parts. for rigidbody this has been the traditional blender pointcache,
but each geometry item could get an own loc/rot or even transform matrix (and even more custom data, velocity, acceleration, etc)
But as transform changes over time, this needs to be a sequence per item and its valid frame range.
For the dynamic fracture case, make sure to take over last old transform to new "child" shards, setting a suitable start transform.
As backend we could have alembic here too, transformation provider(item) would write xform property data to the abc file.
So the abc file has as seen from FM a geometry provider part(store geometry once per update step, nothing inbetween...
prefracture is 1 initial step, dynamic are multiple) and a transform (sequence) provider
FM → geometry cache (untransformed) → abc
FM → transform sequence cache(per item, for frame range) → abc
FM → transformed geometry provider (cachestream) → Mesh
disabled FM, empty FM(before first fracture) → Mesh passthrough
Fitting in the simulation provider
Here we have the rigidbody bullet wrapper, decouple this from "Object" and object group in world.
The rigidbody world maybe needs to know contained objects, or even only the rigidbody parts....
since those are the cached items... shape per item is generated from geometry provider,
bullet updates loc/rot and feeds into transform provider (making matrix transform, writing to abc)
item could have as customdata an object name/ index + local object shard index.
FM → simulation provider → shape geometry, transform → rigidbody wrapper → bullet
bullet → rigidbody wrapper → transform update, rigidbody object → FM
FM → transformed geometry provider (mesh output),
FM → transform provider (item) (write to sequence); dynamic (new initial transform)
FM → geometry provider (item) (dynamic, new items)
Update (27.05.2018)
(just a rough outline)
typical fracturing case: pointcloud → voronoi (bbox) → bisect / boolean → shard
shard holds an own mesh, own customdata
(other cases, cutter plane based fracturing for example, but we get shards too there)
we only need indexes to polys for quick access (instead of storing parts of the mesh elsewhere like in mesh islands → vertices)
so:
so better keep an array of polys → can we use facemaps for it ? is Lookup quick enough ? like... get faces of map x... vertexgroup lookup was awfully slow before (2.7x) for example
would like to avoid a custom structure
or... just an int cd layer per poly... meshisland_index.... extract Meshisland structure from it at load time and store as runtime structure in FM ?
another layer (or 2) per island... rigidbody index in world ←→ which object / island is this rigidbody ?
to avoid searches... a lookup map ... now we have cache_index_map / cache_offset_map in the world
would rather give each rigidbody that "address" info directly (ob / island) and each island the rb index (another cd poly int layer)
The FM, holds a Mesh representing the current state of geometry (with current transforms, and maybe the start transform too)
this is a case for Alembic, Islands should be stored like objects are, + transforms over time... start transform is transform on start frame then
each island should have a defined range of validity, like frame 10 to 50 or so, so each shard is stored only once and is has valid transforms in that range
(each island could have some kind of ID, too.. a Name, an unique number, or both) → useful for later python exposure.. this is island X, this is island Y... etc
FM "queries" the rigidbody each frame and updates the matrix if necessary (keep lastloc, lastrot for quick comparision, to avoid matrix ops)
currently the FM geometry flickers / looks broken because the rb sim loop updates the geometry (a bad approach)
Proposal: remove the old Rigidbody system... replace by FM, each classical rigidbody could be an FM with 1 island
also handle constraints properly... cases: 1:1 1:n n:n... FM should handle this, but empties cant carry modifiers.... → use "empty mesh" here, hidden / not rendered, maybe with the axis shape of empty
in this case we need to be able to edit individual constraints (even if FM holds multiple, they just must not be objects !!!!, but pickable somehow
alternative, keep objectbased constraints, but its duplicate code...
further considerations: shard-space texture space... like duplis but for islands (since the object stays in place, only the mesh moves... for correct displacement, where the texture moves with each shard)
Added subscriber: @scorpion81
whoops, this was automagically added to the codequest workboard... just wanted to tag it properly with "code quest"...
Added subscriber: @jta
Using Alembic as a cache format has a big downside: it can't be updated. Alembic performs certain compression and deduplication operations while writing to the file, which disallows partial updates to an already-existing file. If we want to be able to read frames 1-100 from the cache and then write 101-200 to it, we need either a way to split those ranges into separate Alembic files, or not use Alembic.
Added subscriber: @origindesign
hi,teacher!
The Fracture Modifier will support blender2.8?
Well, or we just don't care and for baking always write the entire frame range. That's fine by me too.
Added subscriber: @juang3d
New proposal is to split the old Fracture Modifier into a geometry and simulation component.
Optionally the live postprocessing part (autohide, automerge) could be a separate modifier, too.
Fracture Modifier (FM):
It has a runtime Mesh Cache with poly customdata Layer which marks the shard index per poly.
An Object can have multiple FMs, where each FM will have a Refresh Operator. This operator will refresh the FM and all other FMs above this FM in the stack. For this purpose each FM needs to store its input mesh, and pass its output down to the next FM or the RBM, which will store it as their respective input.
Each FM will have own fracturing settings (pointsource, algorithm etc) and have optionally an ability to restrict the fracturing to certain pieces, for instance by specifying the indexes. Ideally those
could be picked from a visualization in the viewport. (Assign vertex colors, materials maybe ?)
Rigid Body Modifier (RBM):
It has a runtime geometry cache and a runtime motion data cache.
It will also have a Cache File with a reference to an Alembic file.
A Bake Operator will write the full geometry and the motiondata to the abc file, including "invalid" shards.
The concept of valid and invalid shards is explained below.
To handle dynamic fracture, the geometry runtime cache will just grow and contain a history, where each shard will appear once.
Each shard will have a validity range in frames. If the current frame is outside the range, the respective shard will not be simulated and not be rendered / displayed, which means it will not be part of the output mesh either.
If a fracture event happens, either manually invoked or during the sim, the affected shards will be fractured.
The end frame of those shards will be set to the current frame, and the start frame of their "children" will be also set to the current frame.
If the blend file is loaded or after a bake, if there are abc files present and valid for the RBM, their geometry and motion data will be used.
It needs to be ensured FMs above this baked RBM do not refresh their geometry. Can be disabled manually, or could be ensured automatically, by suppressing their execution internally with a refresh flag.
Constraint handling will happen in the RBM too (same way as its being done in the old FM, currently).
The rigidbody world group will only contain objects and there will be one pointcache read / write call per Object. Inside that call for each found RBM there will be an iteration over all valid shards. The motion data for them will be updated or read back. So the pointcache will only serve as facade for this RBM motion data cache.
Advantages:
Having a separate cache per RBM makes the concept of the cache index map in the world unnecessary. The order of the shards was subject to be corrected after loading a baked file if multiple FM objects and regular rigidbodies were involved. This would have implied to store the order inside the DNA or the ABC file either.
The writing to alembic will happen similarly to the export operator, but specifically for that particular object only. So it should be ensured the user can only scrub in either the ram cache or the fully written abc file.
Scrubbing in halfly-written abc files can be avoided this way.
Disadvantages:
Except for more rewrite work none at the moment :)
Added subscriber: @slakiper
Removed subscriber: @slakiper
Added subscriber: @juhis.jo
Removed subscriber: @juhis.jo
Added subscriber: @zebus3dream
Added subscriber: @capnm
Added subscriber: @ConradDueck
Added subscriber: @FinbarrORiordan
Added subscriber: @lemenicier_julien
Added subscriber: @AntonioJavierTorralbaMoreno
Added subscriber: @icem4n
Added subscriber: @Gadas
Added subscriber: @DirSurya
Added subscriber: @spiraloid-3
Added subscriber: @Hartmut
Added subscriber: @BeckersC
Added subscriber: @N005
Added subscriber: @JGwinner
Is this being worked on? I needed FM for a project, and had to bounce back and forth ... and boy is the 2.79 UI painful after using 2.8+
Yes it is still being worked on. Martin has submitted an OpenVDB based remesher patch that's part of the new Fracture Modifier technology. I'm working on several new aspects and the blender core devs still need to do some fixes in blender itself in 2.8/9x. For example, Jacques Lucke is working on some of the needed changes.
See this report for more info:
https://devtalk.blender.org/t/2020-07-28-particle-nodes-status/14588
I'm also working on a better connection between versions for a temporary solution so you can stay in 2.8/9x for the most part while having 2.79x FM do its magical work in the background. There are also other new developments for the FM technology that we will be announcing in the coming months.
You can check our forum thread to keep up on Fracture Modifier technology developments and our team's work.
https://blenderartists.org/t/custom-build-blender-fracture-modifier/616502/1937
Fracture ON!
Added subscriber: @EvertonSchneider
Is it possible to update the fracture_modifier branch as it is right now to the recent blender master state? Or it's something very complicated? (sorry if it's not a place for this question...) I'm trying to build the branch but getting lots of errors with cmake, libraries... maybe it's too deprecated to the recent build system?
Added subscriber: @BEHE