I am creating a scene in blender and want my grass to grow shorter near the path and the lake by taking data from weight paint, it was simple to achieve using the particle system, but I have no idea how to do it in geometry nodes.
2 Answers
Solution for Version 2.93 :
You can use an Attribute Math (or Attribute Vector Math if you want non homogeneous scale) node to control the point scale with your vertex group weights.
Input weights :
The node tree :
Basically : Distribute points, scale relative to the VG weights, instance your objects, join geometry, output geometry.
Result :
If you want to control the scaling factor, use an Attribute Mix to mix between a base scale and your VG weights:
Note that a float $value$ is automatically converted to a $(value, value, value)$ vector when plugged into a Vector input.
Result :
You can also change the interpolation by using an Attribute Map Range node.
-
$\begingroup$ Note: This solution seem to be out of date and can't be reproduced in Blender 3 anymore. $\endgroup$ Commented Dec 2, 2021 at 6:39
-
$\begingroup$ @ChristophWerner You're right ! Seems more straightforward now. :) $\endgroup$– GorgiousCommented Dec 2, 2021 at 7:58
Here's the basic solution how to use it in Blender 3. You can use vector math nodes and/or the distribution node to get more control and expand this method for your needs.
-
$\begingroup$ In Blender 3.2 there is now finally the node
Named Attribute
, so this answer could use an update ;-) $\endgroup$– quellenform ♦Commented Aug 10, 2022 at 16:54