Fix #117515: Geometry Nodes: Count of unique face neighbors #118848

Merged
Hans Goudey merged 4 commits from mod_moder/blender:tmp_change_face_neighboards_num into main 2024-04-14 01:08:23 +02:00

Regular topology mapping does not care about deduplication of relations. And
this is correct for a lot of the case where we expect creating difference of this
relations in next operations. But this is not the case for users, since this should
be actually trivial info. Due to this reason, construct full topology map and count
number of unique connections. Performance side: difference linear check and
hash set for different sizes of connections set.

Regular topology mapping does not care about deduplication of relations. And this is correct for a lot of the case where we expect creating difference of this relations in next operations. But this is not the case for users, since this should be actually trivial info. Due to this reason, construct full topology map and count number of unique connections. Performance side: difference linear check and hash set for different sizes of connections set.
Iliya Katushenock added the
Interest
Geometry Nodes
label 2024-02-28 13:42:16 +01:00
Iliya Katushenock added this to the Nodes & Physics project 2024-02-28 13:42:36 +01:00
Iliya Katushenock changed title from Fix #1133939: Geometry Nodes: Count of unique face neighbors to Fix #117515: Geometry Nodes: Count of unique face neighbors 2024-02-28 13:43:22 +01:00
Jacques Lucke reviewed 2024-02-28 22:12:19 +01:00
@ -34,1 +33,3 @@
face_count[face_index] += edge_count[edge] - 1;
Array<int> face_count(face_edges.size());
threading::parallel_for(face_edges.index_range(), 2048, [&](const IndexRange range) {
Set<int, 16> faces;
Member

Can you if this is faster if you use a Vector<int, 16> with append_non_duplicates as long as there are only very few edges? Might even be worth to optimize this for the case of triangles and quads to completely remove the need for the temporary set.

Can you if this is faster if you use a `Vector<int, 16>` with `append_non_duplicates` as long as there are only very few edges? Might even be worth to optimize this for the case of triangles and quads to completely remove the need for the temporary set.
Author
Member

100-face connected edge stars still can be there, it is really faster to do not use Set in such case?

100-face connected edge stars still can be there, it is really faster to do not use Set in such case?
Member

No, but that's why I'm saying that there can be an optimized code path for the case when a face has few edges.

No, but that's why I'm saying that there can be an optimized code path for the case when a face has few edges.
Author
Member

Timer 'build_edge_to_face_map': (Average: 94.76 ms, Min: 87.78 ms, Last: 91.32 ms)

Timer 'face_count: Set': (Average: 45.45 ms, Min: 43.29 ms, Last: 44.13 ms)
Timer 'face_count: Vector': (Average: 30.72 ms, Min: 26.79 ms, Last: 27.73 ms)
Timer 'face_count: unique_num': (Average: 37.44 ms, Min: 34.96 ms, Last: 36.54 ms)

Timer 'build_edge_to_face_map': (Average: 94.76 ms, Min: 87.78 ms, Last: 91.32 ms) Timer 'face_count: Set': (Average: 45.45 ms, Min: 43.29 ms, Last: 44.13 ms) Timer 'face_count: Vector': (Average: 30.72 ms, Min: 26.79 ms, Last: 27.73 ms) Timer 'face_count: unique_num': (Average: 37.44 ms, Min: 34.96 ms, Last: 36.54 ms)
Hans Goudey requested changes 2024-03-12 16:53:18 +01:00
Dismissed
@ -21,3 +24,3 @@
}
static VArray<int> construct_neighbor_count_varray(const Mesh &mesh, const AttrDomain domain)
static bool enught_large_total(const GroupedSpan<int> values,
Member

Grammar: large_enough_total_size

Grammar: `large_enough_total_size`
mod_moder marked this conversation as resolved
@ -38,0 +46,4 @@
}
return unique_values.size();
}
else {
Member

else after return is unnecessary

else after return is unnecessary
Member

Looks like this isn't resolved right now

Looks like this isn't resolved right now
mod_moder marked this conversation as resolved
@ -38,0 +64,4 @@
GroupedSpan<int> edge_to_faces_map;
{
SCOPED_TIMER_AVERAGED("build_edge_to_face_map");
Member

I guess these timers can be removed now

I guess these timers can be removed now
mod_moder marked this conversation as resolved
mod_moder changed target branch from main to blender-v4.1-release 2024-03-12 19:14:25 +01:00
Iliya Katushenock force-pushed tmp_change_face_neighboards_num from 3b2aa03d93 to 2a5b5a4123 2024-03-12 19:14:36 +01:00 Compare
Iliya Katushenock requested review from Hans Goudey 2024-03-12 19:15:08 +01:00
Iliya Katushenock added 1 commit 2024-03-13 10:50:15 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
c52461f7ab
progress
Hans Goudey approved these changes 2024-04-10 21:46:32 +02:00
Member

@blender-bot build

@blender-bot build
mod_moder changed target branch from blender-v4.1-release to main 2024-04-14 00:55:12 +02:00
Iliya Katushenock force-pushed tmp_change_face_neighboards_num from c52461f7ab to aa04229ddc 2024-04-14 00:55:34 +02:00 Compare
Hans Goudey merged commit dd672c38b1 into main 2024-04-14 01:08:23 +02:00
Iliya Katushenock deleted branch tmp_change_face_neighboards_num 2024-04-14 01:09:03 +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
3 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#118848
No description provided.