Geometry Nodes: Distribute Points in Volume #85898
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
28 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#85898
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
Why Volume Point Distribution Is Needed
There are many use cases for distributing points (which other objects can be instanced) in a volume
Volumetrics or Geometry Volume?
Geometry Volume:
Volumetrics:
Geometry Volume: I just want to scatter some points in a box/sphere
Volumetrics: I need to be able to scatter points in this model/sim
Given that sampling volumes is far more useful this design task will focus on that.
Approach 1: Add to the Point Distribute Node
Bundle it into the existing point distribute node. This approach would likely lead to making the point distribute node's code a bit of a mess as it is currently only designed to work with surfaces. Volumes can have their own distribution methods which do not cleanly integrate with the existing distribute methods. Volumes and geometry volume could be implicitly treated as the same when switching to a volume distribution mode, but this again gets messy and would produce the worst of both worlds.
Approach 2: Make it it's own Distribute Node
Rename the "Point Distribute" node to something like "Point Distribute Surface" and create a new "Point Distribute Volume" node which can take on code of it's own specifically designed for sampling volumes. Distribution methods could possibly include grid sampling and in the future SDF (signed distance field) sampling to distribute on the surface of an SDF.
Approach 3: Make a Volume to Points Node
Create a new "Volume to Points" node. This doesn't rule out Approach 2 and would only support grid distribution (users can always jitter and displace points to break up the grid as they need). This would however be the simplest of all of the approaches and make moving to Approach 2 easier in the future. We can make the user interface and workflow similar to the "Volume to Mesh" node. For attribute transfers we would sample the points on all VDB grids and transfer that to point attributes. Given that users are mostly just looking to distribute points in a volume and SDFs or other distribution methods are likely longer down the road this feels like the better approach. (Mockup)
Progress
Approach 2: Work in progress: https://developer.blender.org/D10506
Added subscriber: @KenzieMac130
Geometry Nodes: Distribute Points a Volumeto Geometry Nodes: Distribute Points in VolumeAdded subscriber: @HooglyBoogly
I prefer the second approach, sounds like the proper way to do it.
This design task could actually cover common algorithms for that case. I assume you're interested in implementing this?
Yes, I have already worked on the distribute node before and it seemed like a relatively straightforward task once design is approved. If Approach 2 seems like the way to go I can start working on it.
Added subscriber: @StephenSwaney
Began working on Approach 2 D10506. Will keep this updated with more potential design issues, especially when it comes to the distribution method.
It appears that the implementation of geometry volume sampling in the legacy particle system produces quite broken and unstable results under random and especially jittered volume distributions.
Grid distribution is also an issue in the old system...
Not sure if this is even worthy of a bug report as it is end of life anyways and likely wouldn't be an issue with simple geometry that was typically used as particle emitters. Either way it seems examining the old way of doing it is a dead end.
Looking at the VDB documentation it should be relatively straight forward to just add the distribute functionality with the Point Scatter API with just a wrapper around the Point Cloud class. Then if there is any other VDB grids we sample those in parallel and add them as attributes.
Distribution Modes:
Attribute Sampling Modes
Added subscriber: @Pipeliner
Added subscriber: @dodododorian
First bit of tangible progress: https://www.youtube.com/watch?v=EdOhC0yGfh4
I am having issues though with some rather bizarre offset where it doesn't appear to line up with voxels, I can't tell if that is a blender issue or a vdb issue though... other than that it feels like random distribution is pretty much complete.
Edit: It is a VDB issue... Looks like I am going to either have to re-implement it or undo the offset.
Edit: Fixed the issue, needed to offset each point by half the voxel size.
Upon inspection it seems that VDB's "random" point scatter also doesn't care about temporal stability with changing volumes. This makes sense as it intends for the distribution to be part of a static model or and initial burst that can be later advected and simulated.
Given that this kind of issue is inescapable not only with point distribution but also many other modeling operations there really needs to be more of a focus in geometry nodes on caching geometry and then animating/simulating it.
Added subscriber: @TimBrown
So is this kind of the same distribution as in the old Particle System?
Added subscriber: @lichtwerk
see #85167 (Particle volume distribution calculation is not creating particles inside the volume)
No, this is a different implementation using VDB.
Thank you for mentioning this. Yeah, this is not going to use any of that old code. I think it would be better to let the users control the contents of the volume with VDB rather than rely on the assumed mesh volume. This has the benefits of being far more robust and allowing volumetric attribute transfers.
Initial user interface
WIP build is available for people who want to try it out (it is not going to be the most up-to-date version however) https://blender.community/c/graphicall/nsbbbc/
Added subscriber: @Vyach
Added subscriber: @CharlieJolly
Just from a naming point of view, should it be called
Volume Point Distribute
. My initial test was to use it like the existingPoint Distribute
node but it needs thePoints to Volume
to work.I'll get more feedback on this. The intention was to break point distribute up into "Point Distribute Surface" and "Point Distribute Volume" I originally went with this because it read and was grouped better when adding the nodes in the menu.
I am aware of this, it requires an explicit volume definition in order to function (VDB) as described in the design notes. It isn't working on external volumetrics at the moment.
Added subscriber: @Bodi
Changed status from 'Needs Triage' to: 'Confirmed'
Vote for Approach #2. I think this was chosen.
{meme, src=itsawesome, above=Point Volume Distribute, below=. : . : . : : ` " . .}
Found it: Approach 2 D10506 :-)
Added subscriber: @doppler
Moving back to community tasks as I moved it after a meeting to be wrapped up for 2.93 but due to technical issues and the solution feeling incomplete this was not done to avoid a rushed product. I feel like shifting sands around the codebase and bigger priorities around geometry nodes have pushed this back a bit. I would like to return to this when more decisions around volume modeling are made and it fits in more with ongoing design tasks.
Added subscriber: @LukasTonne
Added subscriber: @info-27
I feel I should resign from this one and put it up for grabs (not sure how) I am not keeping up with things. A lot has moved ahead and I feel as though this task can be better tackled with a more clear design from a core team.
@KenzieMac130 : You can do so by
Add Action
>Assign/Claim
> and then remove your name.Added subscriber: @XLP-3
Added subscriber: @evantryan
Added subscriber: @Darksunrise
Added subscriber: @muhuk
Added subscriber: @6Lithium-2
Added subscriber: @Leonard-Gottert
Added subscriber: @Daedra
Added subscriber: @jak99jak
Added subscriber: @IyadAhmed
Added subscriber: @YegorSmirnov
Added subscriber: @AndreVieira
I have been experimenting with ideas for this and currently the best two ways are (both are based on rejection sampling):
To be fair, rejection sampling isn't the best way to distribute points inside a mesh obviously, but hopefully this is a good starting point
Added subscriber: @mod_moder
Might be useful
https://www.joesfer.com/?p=84
Also this
lightweight_mesh_sampling.pdf
Sampling the Standford bunny
https://github.com/iyadahmed/meshprocessing/blob/main/apps/mcwn.cc
I would like to give this a try, the plan is to first use rejection sampling as a start
then in the near future the node could be updated with more methods
I'm happy to hear ideas and discussion
actually wait
yes there's already progress here
https://developer.blender.org/D12636
it seems that with this patch and the mesh to volume node we can achieve this
https://developer.blender.org/D12636
This comment was removed by @IyadAhmed
Removed subscriber: @doppler
Added subscriber: @saded
Hello everyone,
I asked on a mixer forum how to generate fibers (cylinders) in a cube using the geometric knot technique. Someone suggested me a solution that you can find in this link: How to use random cylinders inside a cube with geometric nodes? How to use random cylinders inside a cube with geometric nodes?
This solution of generation of fibers does not result in a volume percentage greater than 15% fiber in the cube.
I want to use these models in my scientific research, I would like to ask you if you could improve this technique to use in this solution to increase the fiber content up to 20 or 25%. Any Help?
Technic of generation
@saded
btw do you have a working matlab/python code for it?, maybe it could be ported
one idea is to resolve collisions instead of discarding intersecting triangles (move cylinders so that they are not intersected)
you might need a bounding volume hirearchy to make it fast
though maybe the issue with discarding is that the cylinders are too big in the video you show, can you make them smaller and try the same setup again?
also the blender exchange has the file
https://blend-exchange.com/b/pldmd4ep/
This issue was referenced by
b6e26a410c
Changed status from 'Confirmed' to: 'Resolved'