Page MenuHome

Geometry Nodes: Run nodes once on unique instance data
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Sep 28 2021, 1:00 AM.

Details

Summary

As described in T91672, often it can be much more efficient to run each
node only on the unique geometry of the instances, rather than realizing
all instances and potentially processing redundant data. Sometimes the
performance difference can be completely smooth vs. completely unusable.

Geometry nodes used to hide that choice from users by always realizing
instances, but recently we have decided to expose it. So this commit
makes nodes run once per unique reference in the entire tree of nested
instances in their input geometries, continuing the work started in
rB0559971ab377 and rBf94164d89629f0d2.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Sep 28 2021, 1:00 AM
Hans Goudey (HooglyBoogly) created this revision.

Works for me. Does this change update all nodes that need this change or are there some missing?

source/blender/blenloader/intern/versioning_300.c
478

Add realize_node->parent = node->parent;.
Otherwise the Realize Instances node might end up in a very different place when node is in a frame (e.g. in the Still Life demo file).

Jacques Lucke (JacquesLucke) requested changes to this revision.Sep 28 2021, 10:49 AM
This revision now requires changes to proceed.Sep 28 2021, 10:49 AM

This patch should also include the Separate Components node. Then we don't have to deprecate it and can just add the instances output (T91684).

  • Merge branch 'master' into geometry-nodes-instances-no-realize
  • Don't realize instances in attribute capture node
  • Don't realize instances in the attribute remove node
  • Don't realize instances in curve length node
  • Don't realize instances in separate components node
  • Fix nodes in frames

The convex hull node is missing.

  • Merge branch 'master' into geometry-nodes-instances-no-realize
  • Don't realize instances in convex hull node
  • Add missing versioning for convex hull node
Jacques Lucke (JacquesLucke) added inline comments.
source/blender/blenloader/intern/versioning_300.c
494

Could also just add the Capture node for completeness here, doesn't matter too much.

This revision is now accepted and ready to land.Sep 28 2021, 6:28 PM