Houdini 20.5 Nodes Geometry nodes

Scatter 2.0 geometry node

Scatters new points randomly across a surface or through a volume.

On this page
Since 14.0

Overview

This node distributes new points across the surface in a roughly uniform pattern and optionally attempts to limit clumping and holes.

For volume primitives, this node scatters points through the volume with a density proportional to the field value (with negative values giving zero probability).

You can use the generated points for a variety of purposes. They may be used to specify birthing locations for particles, template points for copying, cell points for fracturing geometry, or as queues for irradiance computations.

You can specify the density, the number of points per unit of area, (length for curves, volume for volumes and tetrahedra), optionally weighted by an attribute to control the distribution over the surface of the geometry. You can also scatter points with the density based on a texture map by scattering in texture space.

Using Scatter

  1. Click the Display points icon in the display toolbar on the right side of the scene view.

  2. Select the object you want the points to scatter randomly across.

  3. Click the Scatter tool on the Model tab.

    Scatter replaces the surface of an object with random points.

You can change the number of points or density of points in the parameter editor.

Making scattered points stick on changing geometry

If the input to the Scatter node changes on each frame, the output point positions and point numbers may change randomly from frame to frame. There are a few ways to avoid this for different scenarios.

To...Do this

Stick scattered points to deforming geometry

See the Spiky Deforming Torus example. If the geometry doesn’t change in topology, the points can be scattered once on static “rest” geometry, and deformed on each frame using the Attribute Interpolate node.

  1. Connect the static “rest” geometry to the input of the Scatter node,

  2. Turn on the Prim Num Attribute and Prim UVW Attribute output options,

  3. Connect the output of Scatter to the first input of Attribute Interpolate, and

  4. Connect the deforming geometry to the second input of Attribute Interpolate.

The Scatter node will only cook once, and the Attribute Interpolate node will cook on every frame to move the points to the corresponding positions on the deformed geometry.

Keep consistent points when geometry is cut, subdivided, or replaced with higher resolution model

See the Door With Polka Dots example. If the geometry can be texture-mapped in a consistent way, in the Generate parameter the Scatter node has an option to scatter points In Texture Space.

This option scatters points into the unit square of 2D texture space, and then the 3D surface geometry picks up points from the regions of texture space mapped to them. This means that as long surface positions that correspond between the original and new models have the same texture coordinates, the models will have corresponding points scattered onto them. It may not have as desirable behavior near seams, because the seam may have moved in the texture projection if the projection is done after the modeling changes. Relaxation of points along some texture seams may also be noticeably worse.

Note

The Density Scale will be the expected total number of points in the texture space unit square, not the number of points per square unit of surface that is meant when By Density is selected for Generate. This means that it may need to be much larger or much smaller than if scattering By Density, depending on the model.

Stick scattered points when scattering onto a varying number of separate pieces

See the Spotted Soccer Balls example. The solution of scattering points In Texture Space will often solve this problem, but if that isn’t ideal, e.g. if texturing is very difficult or if texture seams cause problems, the option to override the seed for each primitive, (the default is its primitive number), allows for setting seeds on each primitive that won’t change when earlier-numbered primitives are removed.

Parameters

Group

Group of primitives on which to generate points.

Generate

The overall approach to use when generating points.

By Density

Points will be distributed independently based on having a density over each primitive. Density is the expected number of points per length unit for curves, per area unit for surfaces, and per volume unit for volumes and tetrahedra.

Count per Primitive

Exactly the number of points specified in the Count per Prim Attribute parameter will be generated on each primitive. Any relaxation will be done per primitive, to ensure that they don’t leave to another primitive.

In Texture Space

Points will first be scattered into the unit square of texture space, and then, based on the uv attribute, surface geometry will pick up any points that occupy the same region as them in texture space. If Relax Iterations is enabled, points will be relaxed in texture space, so they may appear less relaxed along seams. Max Relax Radius will be in texture space units, so should probably be set quite small.

Scatter on Voxels Independently

When enabled, each voxel in any volume primitives will be scattered on independently, so that changing density in one region of a volume will not affect points generated in another region of the volume, except that point numbers will change and Relax Iterations will still relax nearby points away from each other. This cannot guarantee a specific number of points, so Force Total Count is not supported when this is on.

Force Total Count

When enabled, exactly this many points will be generated. Unlike when this is disabled, the generated points may flicker as primitive areas or densities change. This is only an option when Generate is By Density.

Density Scale

Value or multiplier indicating the density of points to generate.

When scattering By Density without a Density Attribute, this is the expected number of points per length unit for curves, per area unit for surfaces, and per volume unit for volumes and tetrahedra. When scattering In Texture Space without a Density Texture, this is the expected number of points in the full unit square. When using a Density Attribute or Density Texture, this is multiplied by those to determine the actual density in physical or texture space, respectively.

This is disabled if Force Total Count is enabled or if Generate is Count per Primitive.

Density Attribute

An attribute specifying the density of points to generate, when Generate is By Density. The attribute can be a point, vertex, primitive, or detail attribute, and in the case of point and vertex attributes, the density will be linearly interpolated over the area of the primitive. This is ideal for use with the Paint node. When Force Total Count is enabled, this specifies relative distribution of point density, not actual density.

Override Prim Area

Don’t use this if the intention is to scatter points on deforming geometry. That is now much easier, faster, and more flexible to accomplish using Scatter with Attribute Interpolate. See the Spiky Deforming Torus example.

When Generate is By Density, this indicates to use the specified value or primitive attribute, instead of the primitive area, when determining the number of points to be generated on each primitive. For example, specify a value of 1 to indicate to use Density Scale and optionally a Density Attribute to indicate the expected number of points to generate on each primitive. The exact number of points will be dependent on the global and primitive seeds, unlike when using the Count per Primitive option, which generates exactly the specified number of points.

Use Area for 2D Volumes

When enabled, the density will be treated as an area density instead of a volume density, for volumes for which at least one dimension is just a single voxel.

Density Texture

When Generate is In Texture Space and this is enabled, this will be multiplied by Density Scale to determine the density of points in each area of the unit square of texture space. Max Relax Radius will be in texture space units, so should probably be set quite small, since any points pushed into a black region of the texture map will have the maximum radius.

If specifying a COP path using op: syntax, you can specify a frame number, by appending text like [123], a plane name or two, like {colour} or {colour,alpha}, or an overridden resolution, like (640,480).

Note

Texture map scale distortion will impact the resulting relative densities of points in physical space. This is because points are first scattered into the unit square of texture space, and then, based on the uv attribute, surface geometry picks up any points that occupy the same region as them in texture space. This likely isn’t a problem if points are only being scattered in a local area.

UV Attribute

The texture attribute to use when scattering with the Density Texture option.

Count per Prim Attribute

When Generate is Count per Primitive, this is either an integer or the name of an integer primitive attribute indicating the exact number of points to scatter on each primitive.

Max Point Limit

This is an optional strict limit on the number of points to generate, to avoid fatal accidents. If the number of points that would have been generated exceeds this, a warning will be generated indicating the number of points that would have been generated, and a number of points less than or equal to this limit will be generated, in a roughly similar distribution.

When Generate is In Texture Space, this is a limit on the number of points scattered in the texture space unit square. Barring any repeats in the texture mapping, the number of generated points should be less than or equal to this limit.

Global Seed

When Generate is By Density, this random seed is used for determining the number of points to be generated on each primitive and for generating the points on each primitive, as well as randomizing the order. When Generate is In Texture Space, this is used for determining the number of points scattered in the texture space unit square, generating the points in texture space, and randomizing the order.

Primitive Seed Attribute

When Generate is By Density, this primitive attribute is used for additional random seeds used for determining the number of points to be generated on each primitive and for generating the points on each primitive. When this is disabled, the primitive numbers are used as the primitive seeds. This can be useful for ensuring consistent scattering when primitives with lower primitive numbers than other primitives are added to or removed from the detail.

Randomize Point Order

When enabled, the points will be in random order in the output detail. The disadvantage is that if more points are generated in one area, it will change the order of points in other areas, even though the positions and attributes may stay consistent.

Relax Iterations

When enabled, points will be relaxed, pushed away from each other, to avoid clumping. This is done gradually, to avoid chaotic behavior and to allow control over how much relaxation takes place. More relaxation iterations results in points that are more separated from each other. A distribution of points in which they are well separated is often called “blue noise”.

In order to approximately maintain variations in density, points are assigned radii inversely proportional to density (for curves), the square root of density (for surfaces), or the cube root of density (for volumes). This may cause problems for areas whose densities are near zero, especially in volumes, when painting density on a surface, or when using a density texture with a black background, since the radius approaches infinity, so the Max Relax Radius must be set appropriately to prevent these unlikely points from pushing nearby points too far.

If Generate is In Texture Space, the points will be relaxed in texture space, so they may appear less relaxed along seams. If Generate is Count per Primitive, each primitive’s points will be relaxed independent of any other primitive, to ensure that the count per primitive remains exact. Points scattered on a volume primitive will not influence points scattered on other volume primitives during relaxation. Points scattered on curves tend to take a few thousand iterations to be evenly spread out completely. Points on one curve will not influence points on another curve during relaxation. Points scattered on either surfaces, tetrahedra, volumes, or curves will not influence points on any of the other three.

Note

Relaxation along surfaces is done by alternating between relaxing in the 2D space perpendicular to the surface normals and then projecting back to the surface. If the input geometry has point or vertex N, these normals will be used, so they will affect the results of relaxation.

Use Geometric Normals

When enabled, the point or vertex N attributes in the input geometry will not be used in the relaxation along surfaces, instead the relaxation will be based on the geometric normals of the input geometry. Geometric normals represent the actual shape of the geometry so they tend to produce better results from normals set for aesthetic or hair-grooming purposes.

Scale Radii By

Point radii will be scaled by this before any relaxing of the points. Specifying a scale less than 1 will increase “clumpiness” of the resulting points, with a value of zero resulting in no relaxation. Specifying a scale greater than 1 may speed up convergence of the relaxation, especially when scattering on curves.

After any scaling, Max Relax Radius will be enforced before any relaxation. Output Radius Attribute will reflect the final radii, if enabled.

Max Relax Radius

This must be set appropriately to prevent outlier points in low-density areas causing problems when relaxing points.

In order to approximately maintain variations in density, points are assigned radii inversely proportional to density (for curves), the square root of density (for surfaces), or the cube root of density (for volumes). This may cause problems for areas whose densities are near zero, especially in volumes, when painting density on a surface, or when using a density texture with a black background, since the radius approaches infinity. This parameter specifies the maximum radius within which points will influence other points.

When Generate is In Texture Space, this will be a radius in texture space, so it should probably be quite small.

When this is disabled, there will still be a maximum radius, which is currently chosen as half the diagonal length of the bounding box of the input geometry when Generate is not In Texture Space, and 1 when Generate is In Texture Space.

Prim Num Attribute

When enabled, an attribute will be output indicating the number of the source primitive on which each point was generated. To correctly handle points that may be pushed from one primitive to another during relaxation, this is determined after any relaxation. Enable this and Prim UVW Attribute for use with Attribute Interpolate.

Prim UVW Attribute

When enabled, an attribute will be output indicating the coordinates of each point in the parameter space of the primitive on which it was generated. To correctly handle points that may be moved during relaxation, this is determined after any relaxation. Enable this and Prim Num Attribute for use with Attribute Interpolate.

Output Density Attribute

When enabled, an attribute will be output indicating the point density at the location of each generated point. To correctly handle points that may be moved during relaxation, this is determined after any relaxation. If Output Radius and Density in Texture Space is enabled, the density will be the density in texture space, i.e. the Density Scale times any Density Texture, else it will be the density in physical space.

Output Radius Attribute

When enabled, an attribute will be output indicating a radius corresponding with the point density at the location of each generated point. To correctly handle points that may be moved during relaxation, into areas of different density, this is determined after any relaxation.

These are the radii used during relaxation, except in the case when Generate is In Texture Space and Output Radius and Density in Texture Space is disabled, in which case the radii are scaled after relaxation to represent a physical space scale.

If the radius of a point is larger than Max Relax Radius, it will be limited to that maximum. Unless that limit is hit, for a point on a curve, the radius is exactly 0.5/density. For a point on a surface, the radius is approximately 0.537/sqrt(density). For a point in a volume or tetrahedron, the radius is approximately 0.561/cbrt(density).

Output ID Attribute

When enabled, an attribute will be output assigning a unique integer id to each point. The id attribute tracks original point numbers generated by the scatter even after some points are deleted later.

Output Radius and Density in Texture Space

When enabled, the output radius and density attributes will contain texture space radii and densities. When disabled, they will be physical space radii and densities.

Point Attributes

These point attributes or groups will be interpolated from the input geometry and transferred to the generated points.

Vertex Attributes

These vertex attributes or groups will be interpolated from the input geometry and transferred to the generated points in the form of point attributes.

Primitive Attributes

These primitive attributes or groups will be copied from the input geometry and transferred to the generated points in the form of point attributes.

Detail Attributes

These detail attributes will be copied from the input geometry and transferred to the generated points in the form of point attributes.

Detail as Detail

These detail attributes will be copied from the input geometry and transferred to the generated points in the form of detail attributes.

Examples

DoorWithPolkaDots Example for Scatter geometry node

This example demonstrates how you can use the Scatter SOP to scatter points that stay consistent through topology changes like remodelling the input geometry or breaking it. It does this by using the option to scatter in texture space.

GrassGrow Example for Scatter geometry node

This simple example demonstrates how you can use the Scatter SOP to randomly scatter grass across a basic terrain.

SpikyDeformingTorus Example for Scatter geometry node

This example demonstrates how you can use the Scatter SOP with the Attribute Interpolate SOP to easily adjust scattered points to stay consistent on deforming geometry.

SpottedSoccerBalls Example for Scatter geometry node

This example demonstrates how you can use the Scatter SOP to scatter points that stay consistent when separate pieces are added or removed. It does this by using the option to use custom random seeds for each primitive.

See also

Geometry nodes