diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-15 18:14:54 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-15 18:15:48 +0300 |
commit | 7484f274dcdc9092dd5d85059e8d110572fe3b3c (patch) | |
tree | b35e754bfbe5d62f5be6e890de2cd957a9adcad8 /source/blender/editors/object/object_transform.cc | |
parent | cc6db8921bdc497d75c495c843b913109adb9d4a (diff) |
Curves: Port curve to mesh node to the new data-block
This commit changes the Curve to Mesh node to work with `Curves`
instead of `CurveEval`. The change ends up basically completely
rewriting the node, since the different attribute storage means that
the decisions made previously don't make much sense anymore.
The main loops are now "for each attribute: for each curve combination"
rather than the other way around, with the goal of taking advantage
of the locality of curve attributes. This improvement is quite
noticeable with many small curves; I measured a 4-5x improvement
(around 4-5s to <1s) when converting millions of curves to tens of
millions of faces. I didn't obverse any change in performance compared
to 3.1 with fewer curves though.
The changes also solve an algorithmic flaw where any interpolated
attributes would be evaluated for every curve combination instead
of just once per curve. This can be a large improvement when there
are many profile curves.
The code relies heavily on a function `foreach_curve_combination`
which calculates some basic information about each combination and
calls a templated function. I made assumptions about unnecessary reads
being removed by compiler optimizations. For further performance
improvements in the future that might be an area to investigate.
Another might be using a "for a group of curves: for each attribute:
for each curve" pattern to increase the locality of memory access.
Differential Revision: https://developer.blender.org/D14642
Diffstat (limited to 'source/blender/editors/object/object_transform.cc')
0 files changed, 0 insertions, 0 deletions