Age | Commit message (Collapse) | Author |
|
This patch adds initial curve support to geometry nodes. Currently
there is only one node available, the "Curve to Mesh" node, T87428.
However, the aim of the changes here is larger than just supporting
curve data in nodes-- it also uses the opportunity to add better spline
data structures, intended to replace the existing curve evaluation code.
The curve code in Blender is quite old, and it's generally regarded as
some of the messiest, hardest-to-understand code as well. The classes
in `BKE_spline.hh` aim to be faster, more extensible, and much more
easily understandable. Further explanation can be found in comments in
that file.
Initial builtin spline attributes are supported-- reading and writing
from the `cyclic` and `resolution` attributes works with any of the
attribute nodes. Also, only Z-up normal calculation is implemented
at the moment, and tilts do not apply yet.
**Limitations**
- For now, you must bring curves into the node tree with an "Object
Info" node. Changes to the curve modifier stack will come later.
- Converting to a mesh is necessary to visualize the curve data.
Further progress can be tracked in: T87245
Higher level design document: https://wiki.blender.org/wiki/Modules/Physics_Nodes/Projects/EverythingNodes/CurveNodes
Differential Revision: https://developer.blender.org/D11091
|
|
|
|
|
|
There was a quadratic algorithm extracting triangles from a coplanar
cluster. This is now linear.
Also found and fixed a bug in the same area related to the triangulator
added recently: it didn't get the right correspondence between new
edges and original edges.
|
|
While it was technically safe to call Map.remove while iterating over
a map, it wasn't really designed to work. Also it wasn't very efficient,
because to remove the element, the map would have to search it
again. Now it is possible to remove an element given an iterator
into the map. It is safe to remove the element while iterating over
the map. Obviously, the removed element must not be accessed
anymore after it has been removed.
|
|
This is useful for an upcoming commit that allows removing
an element based on an iterator.
|
|
This adds two new methods:
* `clear` just removes all keys from the vector set.
* `index_of_or_add` returns the index of a key and adds it if has not
been added before.
|
|
|
|
Sometimes functions expect a span instead of a virtual array.
If the virtual array is a span internally already, great. But if it is
not (e.g. the position attribute on a mesh), the elements have
to be copied over to a span.
This patch makes the copying process more efficient by giving
the compiler more opportunity for optimization.
|
|
In some cases functions were defined with arguments of different array
lengths in headers vs. implementations. This commit fixes some of the
cases I ran into, but probably not all of them.
|
|
The old version was correct as well but did a move even when not necessary.
|
|
|
|
This is convenient because having a uniform interface is nice, and
because of the similarity to "last".
Differential Revision: https://developer.blender.org/D11076
|
|
The triangulator I made (using CDT) doesn't work if the face
self-intersects. Fall back to the polyfill triangulator when
that happens.
|
|
The triangulator I made (using CDT) doesn't work if the face
self-intersects. Fall back to the polyfill triangulator when
that happens.
|
|
Use multiprocessing with simple deform modifiers.
Master 2.92 fps this patch 3.13 fps on Ryzen 1700X With Vega 64 GPU.
3970X: 2.85 fps -> 2.95 fps
3990X: 3.15 fps -> 3.41 fps
3995WX: 3.21 fps -> 3.38 fps
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D10609
|
|
|
|
Useful to simplify versioning code when identifiers need updating
in multiple places.
|
|
|
|
|
|
The fast triangulator from Blenlib could leave a non-manifold mesh
after removing degenerate triangles. Switched to an exact triangulator.
|
|
|
|
|
|
This method is similar to `std::vector::emblace_back` in that it constructs
the new object inplace in the vector, removing the need for a move.
The `_as` suffix is consistent with similar behavior in Map and Set data structures.
|
|
This allows us to build more complex values in-place in the map.
Before those values had to be build separately and then moved into the map.
Existing calls to the Map API remain unchanged.
|
|
A virtual array is a data structure that is similar to a normal array
in that its elements can be accessed by an index. However, a virtual
array does not have to be a contiguous array internally. Instead, its
elements can be layed out arbitrarily while element access happens
through a virtual function call. However, the virtual array data
structures are designed so that the virtual function call can be avoided
in cases where it could become a bottleneck.
Most commonly, a virtual array is backed by an actual array/span or
is a single value internally, that is the same for every index.
Besides those, there are many more specialized virtual arrays like the
ones that provides vertex positions based on the `MVert` struct or
vertex group weights.
Not all attributes used by geometry nodes are stored in simple contiguous
arrays. To provide uniform access to all kinds of attributes, the attribute
API has to provide virtual array functionality that hides the implementation
details of attributes.
Before this refactor, the attribute API provided its own virtual array
implementation as part of the `ReadAttribute` and `WriteAttribute` types.
That resulted in unnecessary code duplication with the virtual array system.
Even worse, it bound many algorithms used by geometry nodes to the specifics
of the attribute API, even though they could also use different data sources
(such as data from sockets, default values, later results of expressions, ...).
This refactor removes the `ReadAttribute` and `WriteAttribute` types and
replaces them with `GVArray` and `GVMutableArray` respectively. The `GV`
stands for "generic virtual". The "generic" means that the data type contained
in those virtual arrays is only known at run-time. There are the corresponding
statically typed types `VArray<T>` and `VMutableArray<T>` as well.
No regressions are expected from this refactor. It does come with one
improvement for users. The attribute API can convert the data type
on write now. This is especially useful when writing to builtin attributes
like `material_index` with e.g. the Attribute Math node (which usually
just writes to float attributes, while `material_index` is an integer attribute).
Differential Revision: https://developer.blender.org/D10994
|
|
This adds support for mutable virtual arrays and provides many utilities
for creating virtual arrays for various kinds of data. This commit is
preparation for D10994.
|
|
This introduces a context path to the spreadsheet editor, which contains
information about what data is shown in the spreadsheet. The context
path (breadcrumbs) can reference a specific node in a node group
hierarchy. During object evaluation, the geometry nodes modifier checks
what data is currently requested by visible spreadsheets and stores
the corresponding geometry sets separately for later access.
The context path can be updated by the user explicitely, by clicking
on the new icon in the header of nodes. Under some circumstances,
the context path is updated automatically based on Blender's context.
This patch also consolidates the "Node" and "Final" object evaluation
mode to just "Evaluated". Based on the current context path, either
the final geometry set of an object will be displayed, or the data at
a specific node.
The new preview icon in geometry nodes now behaves more like
a toggle. It can be clicked again to clear the context path in an
open spreadsheet editor.
Previously, only an object could be pinned in the spreadsheet editor.
Now it is possible to pin the entire context path. That allows two
different spreadsheets to display geometry data from two different
nodes.
The breadcrumbs in the spreadsheet header can be collapsed by
clicking on the arrow icons. It's not ideal but works well for now.
This might be changed again, if we get a data set region on the left.
Differential Revision: https://developer.blender.org/D10931
|
|
Share macro for setting BLI_Iterator defaults to ensure
this doesn't happen again in cases the ITER_* macros aren't used.
Oversight in 14d74fb34174a91190d35d7fe595f8dd64cb79d1.
|
|
|
|
This removes a lot of unnecessary code that is generated by
the compiler automatically.
In very few cases, a defaulted destructor in a .cc file is
still necessary, because of forward declarations in the header.
I removed some defaulted virtual destructors, because they are not
necessary, when the parent class has a virtual destructor already.
Defaulted constructors are only necessary when there is another
constructor, but the class should still be default constructible.
Differential Revision: https://developer.blender.org/D10911
|
|
Without this, the caller often has to get the pointer to the
resource before adding it to the resource scope.
|
|
x and y were inverted.
|
|
Differential Revision: https://developer.blender.org/D10857
|
|
This fixes T86440
As the CU_2D flag is set for nurbs, a Curve can have 2D nurbs mixed with 3D.
But the UI does not allow this mixing. It updates all nurbs to 2D or 3D when set.
So remove this specific flag for nurbs.
This may break old files, since 2D curves with mixed 3D are now set as 3D.
Differential Revision: https://developer.blender.org/D10738
|
|
|
|
This is useful to avoid nullity checks in some places.
|
|
|
|
Expose a this function to initialize any zeroed axes
to an orthogonal vector based on other non-zeroed axes.
This functionality already existed for `invert_m#_m#_safe_ortho`,
expose as a public function as it's useful to be able to fill in zeroed
axes of transformation matrices since they may be used in matrix
multiplication which would create degenerate matrices.
|
|
This enables ASAN support when used with VS 16.9
enable as usual in cmake with the WITH_COMPILER_ASAN
option, or when using make.bat just tag on `asan'
to the invocation, ie: `make lite 2019 asan`
MSVC: Asan support for 16.9
This enables ASAN support when used with VS 16.9
enable as usual in cmake with the WITH_COMPILER_ASAN
option, or when using make.bat just tag on `asan'
to the invocation, ie: `make lite 2019 asan`
Differential Revision: https://developer.blender.org/D7794
Reviewed By: brecht, sergey
|
|
This is an implementation of Enhanced Subpixel Morphological Antialiasing (SMAA)
The algorithm was proposed by:
Jorge Jimenez, Jose I. Echevarria, Tiago Sousa, Diego Gutierrez
This node provides only SMAA 1x mode, so the operation will be done with no spatial
multisampling nor temporal supersampling. See Patch for comparisons.
The existing AA operation seems to be used only for binary images by some other nodes.
Using SMAA for binary images needs no important parameter such as "threshold", so we
perhaps can switch the operation to SMAA, though that changes existing behavior.
Notes:
1. The program code assumes the screen coordinates are DirectX style that the
vertical direction is upside-down, so "top" and "bottom" actually represent bottom
and top, respectively.
Thanks for Habib Gahbiche (zazizizou) to polish and finalize this patch.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D2411
|
|
|
|
|
|
|
|
Differential Revision: https://developer.blender.org/D10802
|
|
This was included for `FILE *` which isn't used in the header.
Ref D10799
|
|
|
|
This adds a `BLI_assert_unreachable()` macro, that should be used instead
of `BLI_assert(false)` in many places.
* `BLI_assert_unreachable` provides more information than `BLI_assert(false)`
to people reading the code.
* `BLI_assert_unreachable` will print an error to `stderr` in a release build.
This makes it more likely that we will get bug reports when the assumptions
of a developer were wrong.
Differential Revision: https://developer.blender.org/D10780
|
|
Cycles, Eevee, OSL, Geo, Attribute
Based on outdated refract patch D6619 by @cubic_sloth
`refract` and `faceforward` are standard functions in GLSL, OSL and Godot shader languages.
Adding these functions provides Blender shader artists access to these standard functions.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D10622
|
|
|