How do you randomize instances of a custom node group with geometry nodes

I used geometry nodes to create a tree. I was able to randomly distribute the trees on a surface. Now, I would like the randomize the inputs of the Cylinder Tree node so each instance of a tree is different. How do I do that with geometry nodes?

Some of the trees are also overlapping and I want to avoid that. Is it possible to distribute so that the bounding boxes don’t overlap?

Here is my node tree for reference:

So, for your first question, there are some things to be aware of. Instances are supposed to all be the same, this is how you can have thousands of instances without major performance issues. If you want to randomize all of them, that removes any performance boost you get out of instancing.

Fortunately, humans are easy to trick, so you don’t really need thousands of unique trees to have a convincing forest, you just need a handful. You can take your custom node group, duplicate it a few times with different input values and use the geometry to instances node to bundle those unique tree instances into one selection of instances:


Make sure you check ‘pick instances’ to select one instance per point

for your second question- try the poisson disk option on the scatter points on faces node:


the density max setting will work similar to the standard random placement mode, but the real special sauce is in the ‘distance min’ value. adjusting this will remove points that are too close together, so you can make sure that your trees aren’t planted too close together

Hope that helps, let me know if you have any other questions.

4 Likes

That worked perfectly! Thanks your answer!

I have a follow up question: Is there a way I can set the distribution weight of each variant of tree? E.g 40% of the instances are type 1, 20% are type 2 and so on. I’m not super specific about the percentages, I just would like to at least make sure some variants have more or less instances than the others.

1 Like

So, a quick way to add some basic weighing is to add the same object multiple times into the geometry to instances node. Now, you can’t do this directly, but if you add in a reroute node in between, you can have multiple connections going to the same place:

In this situation, I have a distribution of 75% cones, and 25% cubes

A little more complicated and much more fiddly way to tweak distribution percentages is here:


Changing the float curve changes the distribution for all the instances, but it’s real awkward to use, so I’m not sure I’d advise that course of action.

2 Likes