Page MenuHome

Geometry Nodes: Port sample curves node to new data-block
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Apr 11 2022, 9:00 PM.

Details

Summary

Use the newer more generic sampling and interpolation functions
developed recently (ab444a80a280) instead of the CurveEval type.
Functions are split up a bit more internally, to allow a separate mode
for supplying the curve index directly in the future (T92474).

In one basic test, the performance seems mostly unchanged from 3.1.


Test file:

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested changes to this revision.Apr 12 2022, 5:13 PM
Jacques Lucke (JacquesLucke) added inline comments.
source/blender/blenkernel/intern/curves_geometry.cc
714 ↗(On Diff #50344)

Is this the same as the existing function? Should probably be deduplicated.

source/blender/blenlib/BLI_length_parameterize.hh
148

Can linear_interpolate_sorted be implemented in terms of this function?

155

dst_mask?

source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc
266

why as_const?

269

How does sorting here not break the function? It seems like there might be a mismatch between the input and outputs due to the sorting.

This revision now requires changes to proceed.Apr 12 2022, 5:13 PM
Hans Goudey (HooglyBoogly) retitled this revision from Geometry Nodes: Port sample curves node to new data-block to Geometry Nodes: Port sample curves node to new data-block (WIP).
Hans Goudey (HooglyBoogly) edited the summary of this revision. (Show Details)

Merge master

A bit more progress, still doesn't work

Hans Goudey (HooglyBoogly) edited the summary of this revision. (Show Details)
Hans Goudey (HooglyBoogly) planned changes to this revision.Jul 20 2022, 1:52 AM
Hans Goudey (HooglyBoogly) retitled this revision from Geometry Nodes: Port sample curves node to new data-block (WIP) to Geometry Nodes: Port sample curves node to new data-block.
Hans Goudey (HooglyBoogly) edited the summary of this revision. (Show Details)

Cleanup, updates, working implementation

Jacques Lucke (JacquesLucke) added inline comments.
source/blender/functions/FN_field.hh
173

unrelated change

source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc
205–209

const

This revision is now accepted and ready to land.Jul 22 2022, 4:21 PM
source/blender/nodes/geometry/nodes/node_geo_curve_sample.cc
205–209

I couldn't make them const because they're declared and assigned to on separate lines, to avoid retrieving the data when it isn't needed. I suppose I could have for the positions, but making them look the same seemed nicer