Geometry Nodes: Point Distribute Node - Density Max value #85585
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#85585
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?
In Random mode, the Density Max socket suggests that this limits the maximum density.
However, multiplying the Density Attribute means that the Density Max can be overridden. It seems there is an assumption that the Density Attribute is likely to be a scalar value from a weight map in which case this would work.
Either this is a bug or it is by design.
If it is a bug then here is a suggested fix in the
sample_mesh_surface
function insource/blender/nodes/geometry/nodes/node_geo_point_distribute.cc
:const float v0_density_factor = std::max(0.0f, (*density_factors)[v0_index]);
change to
const float v0_density_factor = std::max(0.0f, std::min(base_density, (*density_factors)[v0_index]));
etc...Otherwise the socket should just be renamed to Density to avoid confusion.
Added subscriber: @CharlieJolly
Added subscriber: @victorlouis
I've asked something similar before in the chat, and I believe this is the intended behavior.
The
Density Attribute
is intended to function as an kind of mask that says: "here I want more stuff and here I want less stuff". TheDensity Max
was added to have a convenient slider in the node to tweak the density (by multiplying every density with this value).I think the name
Density Max
originated when it was assumed that theDensity Attribute
would be between 0 and 1. In that case, it would indeed be the maximum density. But because the density attribute can be > 1, it's somewhat of a misnomer. MaybeDensity Max
should be renamed toDensity Multiplier
?Added subscriber: @HooglyBoogly
Right, "Density Factor" might work too. "Max" is definitely misleading.
gn_weight_max.blend
File for testing, ignore messy nodes!
Please note how Density Max and Density Attribute affect the number of points in Random and Poisson Disk modes.
When the Density Attribute is in the range of 0-1, the Density Max setting works for both methods in a predictable way. Once the Density Attribute range is increased, there is a multiplication in the Random method and not the Poisson Disk method.
From a user perspective, the relationship should be the same for both methods.
Yellow Torus = Random; Green Cones = Poisson;
Density Max = 4; Density Attribute = 4; Total = 16;
Density Max = 16; Density Attribute = 1; Total = 16;
Density Max = 32; Density Attribute = 1; Total = 32;
Density Max = 8; Density Attribute = 4; Total = 32;
I've looked at the code to see why this happens. The reason is quite subtle, and I agree the behavior is inconsistent.
The random method calls
sample_mesh_surface
and passes thedensity_factors
. These two lines then determine the density:and
Note here that
looptri_density_factor
can be greater than 1, depending on the otherdensity_factors
. For the Poisson distribute method, this is different, thesample_mesh_surface
is also called, but without thedensity_factors
, and thus:The Poisson method uses the density_factors later in
update_elimination_mask_based_on_density_factors
, and there they are interpreted as probabilities, so they're effectively capped at 1:The easiest change to make both methods consistent, would be to calculate the
looptri_density_factor
like this:This way, the
Density Attribute
is always interpreted as a mask with value between 0 and 1, but I'm not sure this is the behavior we want.Alternatively,
density_factors
could be passed tosample_mesh_surface
when using thepoisson
option and remove theupdate_elimination_mask_based_on_density_factors
function. In my tests this seems to work quite well but there maybe a good reason to use differentdensity_factors
for each distribution type.Change Poisson from:
To:
Added subscriber: @JacquesLucke
I asked @JacquesLucke about that before. That order is to provide stability in
id
attribute that this node generates.To test, add an attribute randomize node on the point's
radius
, try painting the density, transforming the mesh, or extruding some of the mesh's faces. Odds are changing the order makes one of those operations unstable.Added subscriber: @KenzieMac130
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Shall we confirm this for now?
Added subscriber: @SimonThommes
I think the behavior of being able to control the density with both inputs to a similar capacity without capping it is fine. But I do agree that the Naming should change. I think just using
Density
is totally fine even though it is more vague.Density Factor
is a bit misleading when no attribute is used.Changed status from 'Confirmed' to: 'Resolved'
The node is deprecated and the Distribute Points on Faces node does not have the same problem.