Blender Git Commit Log

Git Commits -> Revision 866a56f

November 18, 2020, 11:20 (GMT)
Geometry Nodes: initial generic attribute access API

I will have to do a couple more iterations on this api in the upcoming weeks,
but for now it should be good enough.

The API adds an indirection for attribute access. That has the following benefits:
* Most code does not have to care about how an attribute is stored internally.
This is mainly necessary, because we have to deal with "legacy" attributes
such as vertex weights and attributes that are embedded into other structs
such as vertex positions.
* When reading from an attribute, we generally don't care what domain the
attribute is stored on. So we want to abstract away the interpolation that
that adapts attributes from one domain to another domain (this is not
actually implemented yet).

Accessing attributes through this indirection does have a performance penalty.
In later iterations of this API I want to reduce this penalty and extend the API
so that performance critical code does not have to go through the indirection
for every attribute access.

Other possible improvements for later iterations include:
* Actually implement interpolation between domains.
* Don't use inheritance for the different attribute types. A single class for read
access and one for write access might be enough, because we know all the ways
in which attributes are stored internally. We don't want more different internal
structures in the future. On the contrary, ideally we can consolidate the different
storage formats in the future to reduce the need for this indirection.
* Remove the need for heap allocations when creating attribute accessors.

Commit Details:

Full Hash: 866a56f76ef43bd631789659c4bbbf05b89024f8
Parent Commit: 63a286e
Lines Changed: +799, -0

2 Added Paths:

/source/blender/blenkernel/BKE_attribute_access.hh (+260, -0) (View)
/source/blender/blenkernel/intern/attribute_access.cc (+528, -0) (View)

2 Modified Paths:

/source/blender/blenkernel/CMakeLists.txt (+2, -0) (Diff)
/source/blender/nodes/NOD_geometry_exec.hh (+9, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021