Adds a domain size and "factor of index on size" to Index input node.
Details
Diff Detail
- Repository
- rB Blender
- Branch
- indexfields (branched from master)
- Build Status
Buildable 18951 Build 18951: arc lint + arc unit
Event Timeline
| source/blender/nodes/geometry/nodes/node_geo_input_index.cc | ||
|---|---|---|
| 46 | Call it factors (plural). | |
| 48 | It should be enough to iterate over mask. | |
| 49 | It's important to divide by size - 1 here so that you actually get a value between 0 and 1 as factor. Make sure to handle the division by zero case as well. | |
| 76 | Mask is unused. | |
| source/blender/nodes/geometry/nodes/node_geo_input_index.cc | ||
|---|---|---|
| 49 | And actually, I've gotten a noticeable speedup by doing the 1 / size division outside of the loop and multiplying by that value inside the loop, so this is likely a place to do that too. | |
I was reviewing this but ended up changing the implementation enough that it doesn't share much resemblance to the original patch, so I'll take this one over.
Use a FieldOperation to build the factor output. This is like using more nodes
internally to build this output, and it means that theoretically this can be optimized
in the future without really thinking about the optimization here.
Or maybe it won't have much of an effect, since it's also similar to using VArray<float>::ForFunc(...).
Anyway, it's good to move towards building things like this.
