Age | Commit message (Collapse) | Author |
|
The function name was not very specific, this makes it clearer that it
works on instances rather than only real geometry. Also use `r_`
prefix for the return argument.
|
|
During review of D10730 it was discovered that the "uv" name causes
issues for cycles, which uses it as a default internal data name. While
that could be fixed in the future, there was no particular reason to use
"uv" instead of "uv_map", so we use the latter instead here, which
is consistent with the lowercase naming scheme chosen for attributes.
|
|
Some of the BMesh primitive operators have a lot of overhead due to the
fact that they use other operators like extrusion, removing doubles,
and rotation, to build each shape rather than filling arrays directly.
Implementing the primitives directly with the Mesh data structure is
much more efficient, since it's simple to fill the result data based
on the known inputs. It also allows also skip the conversion from BMesh
to Mesh after the calculations.
Speed matters more for procedural operations than for the existing
operators accessible from the add menu, since they will be executed
every evaluation rather than once before a destructive workflow.
| Shape | Before (ms) | After (ms) | Speedup (x times faster) |
| -------- | -------------| ------------| -------------------------|
| Cylinder | 1.1676 | 0.31327 | 3.72 |
| Cone | 4.5890 | 0.17762 | 25.8 |
| Sphere | 64213.3 | 13.595 | 4720 |
The downside of this change is that there will be two implementations
for these three primitives, in these nodes and in `bmo_primitive.c`.
One option would be re-implementing the BMesh primitives in terms of
this code, but that would require `BMesh` to depend on `Mesh`, which
is currently avoided. On the other hand, it will be easier to add new
features to these nodes like different fill types for the top and the
bottom of a cylinder, rings for a cylinder, and tagging the output with
boolean attributes. Another factor to consider is that the add mesh
object operator could be implemented with these nodes, just providing
more benefit for a faster implementation.
As a future cleanup, there is room to share code that generates the
"rings" topology between different nodes that generate meshes.
Differential Revision: https://developer.blender.org/D10730
|
|
|
|
The default insert link callback for nodes was trying to move the
existing link away, since it didn't properly handle multi-input sockets
(though the problem wasn't exposed for the join node). We can basically
skip all of this "moving existing links" for multi-input sockets, unless
we are at the link limit.
|
|
Use LISTBASE_FOREACH macro, rename variables, comment formatting,
simplification of logic, etc.
|
|
This commit adds a simple node to output the min and max of an
axis-aligned bounding box for the input geometry, as well a rectangular
prism mesh created from these values for convenience.
The initial use case for this node is a "bounding box boolean", where
doing the boolean with just a bounding box could be signigicantly
faster, for cases like cutting a hole in a wall for a window. But it's
easy to imagine other cases where it could be useful.
This node supports mesh and point cloud data right now, volume support
will come as a separate patch. Also note that there is plenty of room
to improve the performance of this node through parallelization.
Differential Revision: https://developer.blender.org/D10420
|
|
This adds the property subtybe `PROP_DISTANCE` where appropriate.
Differential Revision: https://developer.blender.org/D10900
|
|
Since you can already specify a separate size for X and Y with the
grid node, it makes sense to be able to specify the size separately
for each axis also.
This also avoids some awkward math with a Transform node afterwards
when you want a specific size for each direction.
Versioning (except for animation and drivers) is handled in this commit.
Differential Revision: https://developer.blender.org/D10834
|
|
This allows easily changing the scale attribute with a uniform scale
within a single simple node.
|
|
Since these nodes are usually used for more basic operations and the
attribute nodes are used when more complexity is necessary, it makes
sense to give these nodes more accessible defaults-- hopefully this can
make learning about the core concepts of geometry nodes a bit easier.
|
|
The following primitives needed ME_EDGEDRAW, ME_EDGERENDER edge flags:
* Grid
* Circle
Set flags on the inside edges for grid and circle triangle fan (mesh primitive nodes)
so they are visible and selectable.
Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D10878
|
|
The main goal here is to remove the need for a C API to the code in
`mesh_boolean_convert.cc`. This is achieved by moving `MOD_boolean.c`
to C++ and making the necessary changes for it to compile. On top of
that there are some other slight simplifications possible to the
direct mesh boolean code: it doesn't need to copy the material
remaps, and the modifier code can use some other C++ types directly.
|
|
This commit improves the performance of the node by up to 40% in some
cases when there are only two input meshes, mainly by skipping the
conversion to and from BMesh.
When there are more than two input meshes (note the distinction from
"Geometries", a geometry set can have many mesh instances), the
performance is actually worse, since boolean currently always does
self intersection in that case. Theoretically this could be improved
in the boolean code, or another option is automatically realizing
instances for each input geometry set.
Another improvement is using multi-input sockets for the inputs, which
removes the need to have a separate boolean node for every operation,
which can hopefully simplify some node trees.
The changes necessary for transforms in `mesh_boolean_convert.cc` are
somewhat subtle; they come from the fact that the collecting the
geometry set instances already gives transforms in the local space
of the modifier object. There is also a very small amount of cleanup
to those lines, using `float4x4::identity()`.
This commit also fixes T87078, where overlapping difference meshes
makes the operation not work, though I haven't investigated why.
Differential Revision: https://developer.blender.org/D10599
|
|
Differential Revision: https://developer.blender.org/D10857
|
|
|
|
There was a note about reusing this for "texture nodes", but that will
probably not be implemented in this way anyway.
|
|
Doing this, because it might make it easier to replace the implementation
of `bNodeInstanceHash`.
|
|
|
|
The node tree evaluator now calls a callback for every used socket with
its corresponding value(s). Right now the callback does nothing.
However, we can use it to collect attribute name hints, socket values
for debugging or data that will be displayed in the spreadsheet.
The main difficulty here was to also call the callback for sockets in
nodes that are not directly executed (such as group nodes, muted
nodes and reroutes).
No functional changes are expected.
|
|
Caused by an incorrect transformation order in cleanup commit
rBd037fef3bd1dc2e. The fix is to simply reverse the order.
|
|
For other "Attribute Name" fields we usually give a more specific name
that relates to what the attribute is actually used for, like "Mask" in
the point separate node. This is a similar situation, and would also
be consistent with the naming planned in D10506.
|
|
This is a relatively arbitrary value, but a good starting point-- it's
simple while also showing the possibility of the subdivisions.
Ref T86819
|
|
Caused by a cleanup, rBd037fef3bd1dc.
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
Although "Grid" may not be techincally correct since a grid could be 3D,
it was decided to rename the "Plane" primtive to "Grid". The primitive
node allows subdivisions, so the name is more consistent with the
operator in the 3D view.
Ref T86819
This commit includes a file subversion bump for the versioning.
|
|
Change `float to boolean` and `int32 to boolean` to return false for zero and negative values.
This aligns with how artists would expect these values to work. This is in contrast to what a coder would expect. It was determined on blender.chat that this was a better default. This means that a negative float value would give a boolean false.
Change `Color4f to boolean` to return false for zero and negative grayscale values.
Likewise, for color to boolean, to account for negative value colors, the grayscale value would be used for determining if a colour was false or not.
See {T86454}
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D10685
|
|
This patch adds support for the remaining operations of the Vector Math
node within Geometry Nodes. While the operations are already available
in the UI, they hadn't been implemented, yet. With this patch the node
uses the implementation that was added for the Attribute Vector Math
node - similar to how it's handled with the Math node and Attribute
Math node.
Differential Revision: https://developer.blender.org/D10650
|
|
This adds a Clamp node for Geometry Nodes Attributes.
Supports both Min-Max and Range clamp modes.
Float, Vector, Color and Int data types supported.
Reviewed By: HooglyBoogly, simonthommes
Differential Revision: https://developer.blender.org/D10526
|
|
This commit adds a node with a "Map Range" operation for attributes
just like the non-attribute version of the node. However, unlike the
regular version of the node, it also supports operations on vectors.
Differential Revision: https://developer.blender.org/D10344
|
|
|
|
|
|
The recent commit that changed the size (rB83df3545246aada) left out
a few changed. This patch also adjusts the positioning and UV scale of
the generated plane accordingly.
Differential Revision: https://developer.blender.org/D10822
|
|
This will allow retrieving the instance groups from multiple geometry
sets and avoiding needing vectors of vectors to store the results.
This is useful when retrieving instances from a multi-input socket
of geometries.
|
|
|
|
This patch renames two domains:
* `Polygon` -> `Face`
* `Corner` -> `Face Corner`
For the change from `polygon` to `face` I did a "deep rename" where I updated
all (most?) cases where we refere to the attribute domain in code as well.
The change from `corner` to `face corner` is only a ui change. I did not see
a real need to update all code the code for that. It does not seem to improve
the code, more on the contrary.
Ref T86818.
Differential Revision: https://developer.blender.org/D10803
|
|
Without `calc_object_remap` turned off in the conversion to and from
BMesh for the primitive nodes, the `CD_ORIGINDEX` custom data layer
has incorrect values. By using a different function to do the conversions,
we can avoid this problem.
Thanks to Jacques for finding the fix here.
Differential Revision: https://developer.blender.org/D10805
|
|
|
|
This means the "Size" input is treated as a "diameter" instead of
a "radius", just like the 3D view primitives.
|
|
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
|
|
Made it just a bit smaller (same size as renderlayers node).
|
|
Set the min/max and default node size of the cryptomatte node.
|
|
Differential Revision: https://developer.blender.org/D10789
|
|
Following some discussion among the geometry nodes team, it was decided
that keeping the primitive nodes simpler and requiring a separate
transform node to move the generated geometry from the origin would
be better.
- It's more consistent with the current general idea of "building
block nodes"
- It makes more sense for the future when it will be possible to
use instancing to control the transforms.
- It reduces UI clutter when the controls are not necessary.
|
|
Those nodes are leftovers from my work on particle nodes and are not needed currently.
They can be added back easily if they become necessary.
|