Page MenuHome

Geometry Nodes: Initial support for volumes.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Jan 19 2021, 3:27 PM.

Details

Summary

For the most part, this just adds boilerplate code for volume support in geometry nodes:

  • Add VolumeComponent next to MeshComponent, etc.
  • Support VolumeComponent in depsgraph object iterator.

Furthermore, I added initial volume support in a few nodes:

  • The Object Info nodes outputs an Object Instance when the input is a volume object (that will be the same for mesh objects soonish, to avoid copies).
  • Support transforming a VolumeComponent in the Transform node.
  • Support the VolumeComponent in Join Geometry nodes, but only when just one of the inputs has a volume component for now.

Right now there is no way to create a VolumeComponent, because the Object Info node outputs a Volume Object Instance. The VolumeComponent will be necessary for nodes like T84606: Points to Volume modifier for the moss use case. I tested the VolumeComponent code by outputting a copy of the volume from the Object Info node, but didn't want to commit that to master.

Viewport selection does not work correctly with VolumeComponents currently. I don't know why that is. That can be figured out a bit later, once we can actually create new volumes in geometry nodes.

Ref T84604.

Diff Detail

Repository
rB Blender
Branch
temp-geometry-nodes-volume (branched from master)
Build Status
Buildable 12272
Build 12272: arc lint + arc unit

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Jan 19 2021, 3:27 PM
Jacques Lucke (JacquesLucke) created this revision.
  • support building without openvdb
  • Add todo
  • Merge branch 'master' into temp-geometry-nodes-volume

o - output instance in object info node

Jacques Lucke (JacquesLucke) retitled this revision from Geometry Nodes: Initial support for volume components in geometry set. to Geometry Nodes: Initial support for volumes..Jan 20 2021, 1:54 PM
Jacques Lucke (JacquesLucke) edited the summary of this revision. (Show Details)
Brecht Van Lommel (brecht) requested changes to this revision.Jan 20 2021, 5:16 PM
Brecht Van Lommel (brecht) added inline comments.
source/blender/nodes/CMakeLists.txt
369–371

This is not needed, the volume object does not use our C API for OpenVDB.

376

Same, this can also be left out.

source/blender/nodes/geometry/nodes/node_geo_transform.cc
122

I was not aware of this limitation, where exactly does this go wrong?

147

Add missing params and put under an #else.

This revision now requires changes to proceed.Jan 20 2021, 5:16 PM
  • remove unnecessary cmake code
  • fix unused var
  • Merge branch 'master' into temp-geometry-nodes-volume
  • fix scale check

Only scaling an axis to zero is not supported actually.
Negative scales are currently not drawn in the viewport, I assume this is a bug in drawing code.
I updated the check to only disallow zero.

This revision is now accepted and ready to land.Jan 20 2021, 8:03 PM