0
$\begingroup$

I’m working on particle interactions in Geometry Nodes (e.g., boids-like behavior) and trying to optimize performance. Previously, I used a Repeat Zone to calculate separation, alignment, and cohesion for each particle index, but it was too slow with large numbers of particles.

repeat zone method

I’ve started experimenting with the For Each node, hoping it would improve performance. However, I can’t get the same results as with the Repeat Zone. It seems like the node iterates in an irregular way, maybe due to how it processes each index (each index is calculated individually at the same time, instead of one after the other, as with the Repeat Zone).

for each zone method

If anyone has tips for using the For Each node or alternative methods for efficient particle interactions, I’d love to hear them!

Thanks!

$\endgroup$
4
  • 1
    $\begingroup$ Sorry, voting to close, because this is a "Help me make my setup better" question. The only way the question would be helpful to future visitors would be a general question for optimizing, but such question is just too broad. $\endgroup$ Commented Dec 11 at 19:40
  • $\begingroup$ @MarkusvonBroady I understand your feedback, but I believe there may be some misunderstanding. This is not a "help me make my setup better" request. The example is a simplified boids setup created to illustrate this post. Boids are a complex system, but I simplified it to focus on optimization techniques for particle interactions, which apply to systems like particle life or DLA. I’m seeking for workflows solution to help with similar particle setups. I showed the limits of loops and the inadequacy of for each, spending over an hour simplifying the example to make it clear and general. $\endgroup$
    – VxQtW-1
    Commented Dec 11 at 20:18
  • $\begingroup$ @MarkusvonBroady couldn’t find a solution online. Most systems I’ve seen rely on for loops, which are not optimal. I also explored for each, but I couldn’t set up a proper system. So facing both adequacy and performance issues. $\endgroup$
    – VxQtW-1
    Commented Dec 11 at 20:34
  • $\begingroup$ Repeat and for each zones are terribly slow, unfortunately. Here's an example for an all-to-all interaction where I avoid using them, at the cost of raising the number of elements to the power of 2: blender.stackexchange.com/a/313716/60486 $\endgroup$ Commented Dec 11 at 20:41

0

You must log in to answer this question.