Geometry Nodes: Add SDF grid boolean nodes #118879

Merged
Hans Goudey merged 23 commits from HooglyBoogly/blender:geometry-nodes-sdf-grid-boolean into main 2024-04-23 14:49:11 +02:00
Member

Add a simple node to compute the intersection, difference, or union
between SDF grids. This should be the first new use case for the
new volume grid nodes that wasn't possible before.

For naming and multi-inputs, the node uses the same design as the
mesh boolean node. We considered splitting each operation into a
separate node, but though most users considered these different
"modes" of the same operation.

One thing to keep in mind is that it's important for the grids to
have exactly the same transform. If they have different transforms,
the second grid must be resampled to match the first, because the
OpenVDB CSG tools have that requirement. Resampling is expensive
(for SDF grids it means a grid -> mesh -> grid round trip) and should
be avoided.


image

Add a simple node to compute the intersection, difference, or union between SDF grids. This should be the first new use case for the new volume grid nodes that wasn't possible before. For naming and multi-inputs, the node uses the same design as the mesh boolean node. We considered splitting each operation into a separate node, but though most users considered these different "modes" of the same operation. One thing to keep in mind is that it's important for the grids to have exactly the same transform. If they have different transforms, the second grid must be resampled to match the first, because the OpenVDB CSG tools have that requirement. Resampling is expensive (for SDF grids it means a grid -> mesh -> grid round trip) and should be avoided. --- ![image](/attachments/9640264f-9d80-4085-98a9-4a12f415da07)
Hans Goudey added 1 commit 2024-02-29 02:25:25 +01:00
Hans Goudey added the
Interest
Geometry Nodes
label 2024-02-29 02:25:53 +01:00
Hans Goudey added this to the Nodes & Physics project 2024-02-29 02:25:59 +01:00
Hans Goudey added 2 commits 2024-03-01 21:31:00 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
d5afdcbb76
Cleanup
Author
Member

@blender-bot build

@blender-bot build
Hans Goudey requested review from Lukas Tönne 2024-03-01 21:37:52 +01:00
Hans Goudey requested review from Jacques Lucke 2024-03-01 21:37:52 +01:00
Hans Goudey force-pushed geometry-nodes-sdf-grid-boolean from 80090abed9 to 84c792dfa1 2024-03-01 21:48:59 +01:00 Compare
Member

What do you think about splitting this node up into multiple and using multi-inputs where appropriate?

What do you think about splitting this node up into multiple and using multi-inputs where appropriate?
Author
Member

I like that idea!

I like that idea!
Hans Goudey changed title from Geometry Nodes: Add SDF Grid Boolean Node to Geometry Nodes: Add SDF Grid Boolean Nodes 2024-03-02 22:59:47 +01:00
Hans Goudey changed title from Geometry Nodes: Add SDF Grid Boolean Nodes to Geometry Nodes: Add SDF grid boolean nodes 2024-03-02 22:59:57 +01:00
Hans Goudey added 4 commits 2024-03-02 23:00:04 +01:00
Jacques Lucke reviewed 2024-03-03 00:07:17 +01:00
Jacques Lucke left a comment
Member

Too bad that Difference seems difficult to use as verb, otherwise we could use Union SDF Grids and Intersect SDF Grids as names.

Too bad that `Difference` seems difficult to use as verb, otherwise we could use `Union SDF Grids` and `Intersect SDF Grids` as names.
@ -0,0 +18,4 @@
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>("SDF Grid 1").hide_value();
b.add_input<decl::Float>("SDF Grid 2").hide_value();
Member

Second input could probably be a multi-input too.

Second input could probably be a multi-input too.
@ -0,0 +17,4 @@
static void node_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Float>("SDF Grid").hide_value().multi_input();
Member

Feels like the name should be plural, same in other multi-inputs.

Feels like the name should be plural, same in other multi-inputs.
Jacques Lucke requested changes 2024-03-03 00:19:15 +01:00
Dismissed
Jacques Lucke left a comment
Member

OpenVDB seems to throw an exception when the first input to the difference operation is empty (maybe other cases too). Probably simplest to just catch them instead of trying to do preprocessing.

OpenVDB seems to throw an exception when the first input to the difference operation is empty (maybe other cases too). Probably simplest to just catch them instead of trying to do preprocessing.
Member

What do you think about splitting this node up into multiple and using multi-inputs where appropriate?

I concur, would add more flexibility.

When i tried this first a while ago it didn't work because the multi-input would have required CPPTypes for all the grid types. Now i think this should be possible with the SocketValueVariant.

> What do you think about splitting this node up into multiple and using multi-inputs where appropriate? I concur, would add more flexibility. When i tried this first a while ago it didn't work because the multi-input would have required `CPPTypes` for all the grid types. Now i think this should be possible with the `SocketValueVariant`.
Author
Member

Too bad that Difference seems difficult to use as verb, otherwise we could use Union SDF Grids and Intersect SDF Grids as names.

How about "Subtract" instead of "Difference"? Subtract SDF Grids? Not sure if it would be confused with the math operation.

> Too bad that `Difference` seems difficult to use as verb, otherwise we could use `Union SDF Grids` and `Intersect SDF Grids` as names. How about "Subtract" instead of "Difference"? `Subtract SDF Grids`? Not sure if it would be confused with the math operation.
Hans Goudey added 5 commits 2024-03-04 19:09:04 +01:00
Member

Subtract SDF Grids

Works for me too, but unsure if it's too unconventional. (I used the same in ExprBuilder in #117805 btw)

> Subtract SDF Grids Works for me too, but unsure if it's too unconventional. (I used the same in `ExprBuilder` in #117805 btw)
Jacques Lucke reviewed 2024-03-05 09:17:34 +01:00
@ -0,0 +1,83 @@
/* SPDX-FileCopyrightText: 2024 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#define WITH_OPENVDB
Member

that looks wrong

that looks wrong
Lukas Tönne approved these changes 2024-03-06 10:47:38 +01:00
Lukas Tönne left a comment
Member

Looks good to me.

I guess the "combine topology" node in the volume-grid-nodes branch should also be separate nodes instead of an operation enum?
aac1167f6f/source/blender/nodes/geometry/nodes/node_geo_combine_grid_topology.cc (L73-L86)

Would be nice to have it consistent with the Mesh Boolean node though.

Looks good to me. I guess the "combine topology" node in the `volume-grid-nodes` branch should also be separate nodes instead of an operation enum? https://projects.blender.org/LukasTonne/blender/src/commit/aac1167f6f965139ee8d42571dcc80a931b7bc89/source/blender/nodes/geometry/nodes/node_geo_combine_grid_topology.cc#L73-L86 Would be nice to have it consistent with the Mesh Boolean node though.
Contributor

This design makes creating mid-level node group for Boolean impossible since one of them needs two inputs and others multi socket.

This is creating problems with non-English speaking (and non-technical artists) that I spoke of in chat.

I kindly ask you to reconsider that anti-user UX or at least open devtalk thread and gather feedback from users about splitting nodes. Lot of other voices need be to heard and taken into consideration besides usual couple technical artists.

This design makes creating mid-level node group for Boolean impossible since one of them needs two inputs and others multi socket. This is creating problems with non-English speaking (and non-technical artists) that I spoke of in chat. I kindly ask you to reconsider that anti-user UX or at least open devtalk thread and gather feedback from users about splitting nodes. Lot of other voices need be to heard and taken into consideration besides usual couple technical artists.
Member

This design makes creating mid-level node group for Boolean impossible

I don't understand how the design makes anything impossible. Can you clarify?

> This design makes creating mid-level node group for Boolean impossible I don't understand how the design makes anything *impossible*. Can you clarify?
Contributor

@JacquesLucke I want to create Grid Boolean node-group, because I know my students will find it easier than remembering words like Union, Difference, Intersection, which are not related to 3D and are general English words, not easy to remember when English is second or third language (especially if native is Georgian).

But that is impossible. I can create node group that has two grid geometry inputs, but that means group will not be able to take advantage of multi-socket inputs that Grid and Intersection have, they'll be limited to two inputs only if you use node group. And there is no way to make sockets dynamically change, and probably will not be for years.

Me and many other users laid out arguments against splitting nodes in module chat, but namings are biggest problem for me. They make them less discoverable, especially for non-English speakers, and words like Difference and Union are not translateable in any meaningful way that will tell user what they are. If you don't already know what Union and Difference are you won't guess what they do. While boolean is something users are already familiar with from modeling when they approach geometry nodes. Design that splits nodes might be good for technical artists who are at home in Geometry Nodes already, but they're intimidating and not user-friendly for beginners. How will user find those nodes if they want to perform boolean, without going in internet and searching for tutorials? Typing Boolean in menu will not give them the result.

I apologize I talk about node names a lot, but that's because I see what works and doesn't work for beginners daily and deal with that, and I can talk about that for long time.

@JacquesLucke I want to create Grid Boolean node-group, because I know my students will find it easier than remembering words like Union, Difference, Intersection, which are not related to 3D and are general English words, not easy to remember when English is second or third language (especially if native is Georgian). But that is impossible. I can create node group that has two grid geometry inputs, but that means group will not be able to take advantage of multi-socket inputs that Grid and Intersection have, they'll be limited to two inputs only if you use node group. And there is no way to make sockets dynamically change, and probably will not be for years. Me and many other users laid out arguments against splitting nodes in module chat, but namings are biggest problem for me. They make them less discoverable, especially for non-English speakers, and words like Difference and Union are not translateable in any meaningful way that will tell user what they are. If you don't already know what Union and Difference are you won't guess what they do. While boolean is something users are already familiar with from modeling when they approach geometry nodes. Design that splits nodes might be good for technical artists who are at home in Geometry Nodes already, but they're intimidating and not user-friendly for beginners. How will user find those nodes if they want to perform boolean, without going in internet and searching for tutorials? Typing Boolean in menu will not give them the result. I apologize I talk about node names a lot, but that's because I see what works and doesn't work for beginners daily and deal with that, and I can talk about that for long time.
Author
Member

Based on feedback here and elsewhere, I'll probably switch back to a single node here, the same as the mesh boolean node. We're still working on finding a balance in the "splitting nodes" topic, and I think I've come down on the "no-split" side for this feature in particular.

Based on feedback here and elsewhere, I'll probably switch back to a single node here, the same as the mesh boolean node. We're still working on finding a balance in the "splitting nodes" topic, and I think I've come down on the "no-split" side for this feature in particular.
Hans Goudey added 5 commits 2024-04-12 19:48:46 +02:00
Hans Goudey requested review from Jacques Lucke 2024-04-12 19:51:14 +02:00
Hans Goudey added 1 commit 2024-04-12 19:51:28 +02:00
e770136c5c Remove "SDF" from socket names
It's already in the name of the node
Jacques Lucke requested changes 2024-04-22 17:55:37 +02:00
Dismissed
Jacques Lucke left a comment
Member
  • I get a crash when using link-drag-search.
* [x] I get a crash when using link-drag-search.
Hans Goudey added 1 commit 2024-04-22 18:51:47 +02:00
Hans Goudey added 1 commit 2024-04-22 19:05:10 +02: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
a563931c4d
Fix link drag seach crash and set difference by default
Author
Member

@blender-bot build

@blender-bot build
Hans Goudey requested review from Jacques Lucke 2024-04-22 19:05:27 +02:00
Hans Goudey added 2 commits 2024-04-22 19:55:29 +02:00
Jacques Lucke approved these changes 2024-04-23 13:17:21 +02:00
Hans Goudey merged commit 0c3763ddda into main 2024-04-23 14:49:11 +02:00
Hans Goudey deleted branch geometry-nodes-sdf-grid-boolean 2024-04-23 14:49:14 +02:00
Sign in to join this conversation.
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
4 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#118879
No description provided.