2
$\begingroup$

I am trying to distribute 2 objects in a collection on a grid (or volume) with a gradient using geometry nodes. What I mean by gradient is the density of a material in the center will decrease towards the periphery while density of other will increase. Like in the attached image:

enter image description here

I am pretty new to Blender or any sort of 3D modeling. I looked for the solution but could not find any solution using just geometry nodes. I do not want to realize instances and use shader editor. I would appreciate if anyone can help :)

$\endgroup$

1 Answer 1

4
$\begingroup$

I would do it like this: put the two objects in a collection which you reference in Geometry Nodes through a Collection Info node. Make sure the node is set to Separate Children and Reset Children.

With a Grid you get the points for distributing the objects. Plug this and the collection into an Instance on Points node where you enable Pick Instance. In the Instance Index input you plug a Random Value node set to Boolean. Since you have two objects in the collection, their indices are 0 and 1.

The Probability value in the Random Value node defines the chance of the node giving out "true" i.e. 1, so to have less objects with the index 1 towards the border, the probability must go down towards 0.

To achieve this, you can use the UV Map output of the grid and a Gradient Texture. Move the UV map to the center of the grid by subtracting 0.5 on XYZ with a Vector Math node. To refine the distribution you can use a Vector Math node set to scale to change how far out the object 1 will be appearing, and with for example a Map Range node you can vary the falloff. But a Color Ramp node or a Float Curve could be used as well.

gradual distribution

$\endgroup$
2
  • $\begingroup$ Thank you Gordon for the great advice and quick response, how can apply the same approach to a 3D array created like: Volueme Cube --> Distribute points in Volume (Grid) --> Instance on Points. There is no embedded UV map like in the case of Grid. $\endgroup$ Jun 12, 2023 at 14:03
  • $\begingroup$ Solved it! By using geometry proximity node. Thanks again! Your solution guided me a lot. $\endgroup$ Jun 12, 2023 at 14:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .