Proximity Scattering - Scattering Without Intersections With Geometry Nodes

In today's tutorial, we’ll introduce an alternative to the standard scattering method, which results in instance intersections.


Proximity Scattering calculates distance between instances, spawning them while being mindful of overlap. Keep in mind this method isn't perfect, and when the distance between instances is too small, some intersections may still occur due to irregular object shapes.

Despite that, this method works great for scattering trunks, rocks, trees, logs, plants, and more!

Let’s Get Started!

1. Adding The Ground

Add a 1m x 1m plane to serve as the ground:

  1. Press Shift + A Mesh Plane.
  2. Adjust the dimensions to 1m x 1m.
  3. Apply a material for a nice dirt apparence. We will use Soil 19

Scattering The Instances

Scatter Objects

Add objects of your choice to scatter. Keep in mind, the rounder the objects, the fewer intersections will occur. For this example, we’ll use the XSmall Pebble Scatter Pack

3. Adding Geometry Nodes

Add geometry nodes to the plane by navigating to the Geometry Nodes Editor tab and clicking New.

4. Adding Points

Press Shift + A, type in the Search area, and add these nodes:

  •  Distribute Points on Faces and change the method from Random to Poisson Disk
  •  Instances on Points 


Add Join Geometry at the end, and connect the Group Input Geometry to it so both the instances and plane are visible in the viewport.

5. Adding Instances

Add a Collection Info node and select the collection containing the objects you want to scatter. Check the Separate Children and Reset Children checkboxes. Connect it to the Instance socket and enable the Pick Instance checkbox. Now you should see the instances scattered across the surface!

Adjusting The Base Iteration

6. Randomizing The Instances

Adjust the Distance Min and Density values on the Distribute Points on Faces node to your preference. Note that we are now creating the biggest rocks as the first iteration so leave some space for the next, smaller iterations. 

To randomize the distribution of the objects, add a Noise Texture node and connect its Fac output to the Density Factor of the Distribute Points on Faces node. Set the scale of the noise as desired and add a Map Range node in between. Adjust the From Min and From Max values to your liking.

To randomize the rotation of the objects, add a Random Value node and change its type to Vector. Leave the Min values at 0 and set the Max values as follows:

  • X: 0 - 1
  • Y: 0 - 1
  • Z: 6.283 or you can type tau

This will create a slight rotation of the objects on the sides (or none if set to 0) and a full random rotation on the Z-axis.

Grouping The Nodes

Select all the nodes except for the Group Input and Group Output, then press Ctrl + G to group the selected nodes.

This will help keep your workspace clean and make it easy to create the next iterations.

Adding Group Inputs And Outputs

Navigate to the Group tab on the right side and add new sockets to create 3 input sockets and 3 output sockets. Change the type of all of these to Geometry and name them as shown in the reference image.

Connect the Base Mesh to the Mesh socket of the Distribute Points on Faces node and also to the Base Mesh output of the group.

Additionally, connect the Instances group input and the Instances output of the Instances on Points node to the Join Geometry node. Finally, connect the Join Geometry node to the Instances socket of the group output.

Exit the group view by pressing Tab and rename your group.

Duplicate the group and place it next to the first one. Connect the output sockets of the first group to the input sockets of the second group, following the naming conventions. Add a Join Geometry node after the second group to combine the Base Mesh with the Instances. While nothing will change on the plane yet, this setup allows us to begin forming the proximity feature.

Enter the group by pressing Tab and connect the Distance Min of the Distribute Points on Faces node to a new input socket of the group. Change the socket's subtype to Distance. This allows you to adjust this value outside the group, making it unique for any duplicated group.

Next, add a Realize Instances node and connect the output of the Instances on Points node to it. Connect the output of the Realize Instances node to the Realized Instances group output.

Also, connect the Scale from the Instances on Points node to the Group Input and change its type to Float. Set the default value to 1, ensuring it remains 1 when adding new groups.

Exit the node group, then adjust the Distance Min and Scale parameters of the second node group. Set these values so that the second iteration of instances appears smaller and more numerous.


We can now see that the second iteration of instances is intersecting with the first iteration. We will solve this issue in the next step.

Proximity Distance

Activating The Proximity

To remove intersecting objects based on proximity, we will use the Realized Instances group input to control the spawn proximity for the next set of instances.

  1. Add a Mesh to Points node and connect the Realized Instances group input to its Mesh input.
  2. Add a Geometry Proximity node, connecting the Points output to the Geometry input. Change the node type to Points.
  3. Add a Math node, change it to the Greater Than function, and connect the Distance output to the Value input.
  4. Connect the new group input to the Threshold value, rename it to control the proximity outside the group. This value will controll the distance between previous iteration and the next one.
  5. Add a Switch node to avoid proximity deletion on the first iteration. Connect the Greater Than output to the True input, change the switch type to Float, and set the False value to 1.
  6. Connect the empty group input to the Switch Value, rename it appropriately.
  7. Finally, connect the Switch Output to the Selection of the Instance on Points node.

This setup will control how close the new instances can spawn relative to the previous iteration.

Go outside the node group and toggle the Proximity on for the second iteration of instances and adjust the proximity distance to observe the effects. 

Proximity Visualization

To better visualize the iterations and proximity deletion, create a few new materials in the scene and assign different viewport colors to them.

Then, go into the node group and add a Set Material node between the Instance on Points and Join Geometry nodes. This will let you temporarily assign the new materials to each group. Connect the new group input to the Material input.

Now, outside of the group, change the material for each iteration to better visualize the layers of instances.


These materials are just for viewport visualization and won’t be the final materials used for the objects.

More Iterations

Now you can duplicate the node group as many times as needed, connecting the inputs with outputs following the previous pattern.

Adjust the scale, distances, and materials to your liking.

Correcting The Proximity

We can see that the new iterations are intersecting with the previous ones. To fix this, enter the node group, add a Join Geometry node after the Realize Instances node, and also connect the Realized Instances group input to the Join Geometry node.

Exposing More Parameters

For even more control, you can expose parameters like Noise Scale, Distribute Points on Faces Seed, and Rotation Seed to the group inputs.

This will allow you to easily tweak these settings outside the group.

Organization

For a cleaner and more organized node setup, you can tidy up your node links. Hold Shift + Right Click and drag over a link to create a reroute point, making your layout easier to manage.

Final Effects

And here you go! Experiment with the exposed parameters to create a variety of appearances.

Other Uses

This method is versatile and can be applied to various scattered objects. Add this node group to your Asset Browser and use it on objects like plants, trunks, or rocks!

Here are some render examples: