BLI: Group Deduce functions for GroupedSpan #111081
No reviewers
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#111081
Loading…
Reference in New Issue
No description provided.
Delete Branch "mod_moder/blender:group_deduce"
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?
This commit add the general implementations of an algorithms to deal with the geometry groups. Group is a set of the same values in a geometry. The values can be randomly distributed in whole domain. Deduced group is a set of an indices to all the same values in geometry. This indices can be used for read, change, write, copy, edit the currect geometry or to create other one.
This commit is based on 'Grouping of random points by it curve index' paper [1].
One of the main advantages of this solution is its stability with a wide range of group sizes and its amount.
The fluctuation range for 10.000.000 points amount is only ~50 milliseconds .
So, the main parameter of the algorithm, to did predict its time costs, is the amount of data, but not data grouping.
Changes:
BLI_group_deduce.hh
. The file contains base declarations of algorithm and helpful general tools to deal with the groups. All the implementations are multithreaded. All the implementation are in newgroup_deduce.cc
file. All the algorithms is non-template and considerint
as main type.IndexMask::from_groups
method to construct the set of an IndexMask's to represend all groups. It is generally preferable to use a more general iterator instead of span of indices for most other algorithms.Benchmark result below.
226359ec48
.Based on exploring of other ways, parallel algorithm, used in
226359ec48
, is the best solution for many really small groups. But it can be faster via using tempolar buffer (Copy all group indices to this buffer. Rewrite each one by it result index, instead of write it to actual position. This provide better cache in the main loop).Solution from
226359ec48
also used in new code, but only for data with really small groups (is_fragmented
function is used to deduce this fact).Benchmark of comparing old-new speed of code for build edge-to-corner maps provided below.
Benchmarks:
IndexMask::from_groups
bygrouped_indices::from_indices
andIndexMask::from_indices
(implementation of newIndexMask::from_groups
). Test for 1.500.000 points. Example Fileindex_of_nearest_groups_bench
. Milliseconds. Timings of whole node results.build_edge_to_loop_map
andbuild_vert_to_loop_map
functions redone. Tested as part of an Edge Split node. Cube primitive node was used as data. Example Fileedge_to_corner_map_groups_bench
. Milliseconds. Timings of function calls only.points_to_curves_groups_bench
. Milliseconds. Timings of group-function calls only.WIP: BLI: Group Deduce functions for GroupedSpanto BLI: Group Deduce functions for GroupedSpanTODO:
BLI_sort.hh
implementations of radix sort with specific heuristics?Scale Elements
,Points to Curves
,Mesh to Curves
,Sort Elements
, ...)?parallel_for_weighted
.One thing I don't like about the API right now is that it forces the creation of new integer arrays, even for the trivial cases where everything is in the same group (and other cases).
Maybe an API like the following could allow for more even efficiency. Note that we might also need a good way to iterate over
Span
andIndexMask
in the same way to avoid code duplication.Checkout
From your project repository, check out a new branch and test the changes.