4
$\begingroup$

I want to add vegetation to my rocky semi-desert scene of Himalayan mountains, using geometry nodes. In that scenery, vegetation only grows in valleys, where water would sometimes flow. Note that by 'valleys' I mean:

  1. Slopes between hills.
  2. Flat surfaces in various heights, surrounded by mountains.

The OPPOSITE of the tree distribution in this picture: enter image description here

How do I do that procedurally, meaning without weight painting the valleys by hand? I tried to find some vector math trick, but failed to do so. Please help!

A few more simplified examples:

Example 1 enter image description here
In the image above, the bottom area will be chosen, since it's flat and has a higher surrounding.

Example 2 Example 2a
In the image above, the crevice at the center will be chosen, but not the flat slopes that wrap it.

Example 3 Example 3a
In the image above, the normals are shown. The left side will be chosen, and the right side will not. This is because the normals meet each other only on the left side. How do I achieve that?

$\endgroup$
2
  • 1
    $\begingroup$ I think you can detect the normals "meeting" each other using the dot product (or by computing the angle formed between them explicitly, if you prefer, using its geometric defn: en.wikipedia.org/wiki/Dot_product#Geometric_definition) If you combine that with some kind of threshold that only checks for "overlapping" normals that are sufficiently close to one another (in Euclidean distance), that would I think approximate what you want to do. I suspect the best way to generate a weight map like this will be to write a Python script to generate it $\endgroup$ Sep 28, 2021 at 23:11
  • 1
    $\begingroup$ As an alternative to the use of normals like this, you could also consider, if you have to write a script anyway, just computing the gradient directly, and looking for places where the gradient changes signs in at least one dimension. I think this would correspond to 'valleys' $\endgroup$ Sep 28, 2021 at 23:12

1 Answer 1

6
$\begingroup$

The valleys and flat areas where things grow can be identified by a combination of the normal and the curvature of the mesh. Geometry Nodes can distribute plants to follow this pattern.

enter image description here

For example, given this geometry:

enter image description here

The terrain normal in the Z direction is:

enter image description here

The curvature for the terrain is:

enter image description here

Details for Blender 2.93.4

  • Enable the Tissue add-on.
  • Select the terrain model. Enter 'Weight Paint' mode. Active the Tissue panel. Click on the curvature button. This will calculate the curvature of the mesh and create a new vertex group called 'Curvature_value'.

enter image description here

  • Click on the 'Weight Equation' button. It will bring up the panel below. Enter 'nz' to create a map of the normals in the z direction. This indicates how flat the mesh is. Click ok. Then a new vertex group called 'Formula nz' will be created. enter image description here

  • Once this is done, if you open the vertex panel, and open the 'Vertex Groups' panel, the two vertex groups will be visible. enter image description here

  • Select the terrain model. Open geometry nodes and reproduce the node network shown below. This node setup uses the curvature and normal weight maps to identify where vegetation should be placed. The 'Attribute Math' nodes do the math to combine the maps. The 'Point Distribute' node places the vegetation. The 'Align Rotation ...' node keeps the vegetation oriented upward. The 'Point Scale' node scales the vegetation. The 'Point Instance' node assigns geometry to use for the vegatation.

enter image description here


A model in Blender 2.93.4 used for this is located here -

$\endgroup$
1
  • 1
    $\begingroup$ Thank you so much! $\endgroup$
    – naftali10
    Oct 5, 2021 at 5:14

You must log in to answer this question.

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