Age | Commit message (Collapse) | Author |
|
This node outputs true when geometry nodes is currently evaluated
for the viewport and false for final renders.
Ref T85277.
Differential Revision: https://developer.blender.org/D10302
|
|
Normally sockets only have one input link. This commit adds the back-end
changes needed to use multiple input links per socket.
Multi-input sockets can be defined with a new flag in `bNodeSocketType`.
The changes necessary to make the sockets work in the geometry nodes
evaluator are generalizing input socket values as a vector of values,
and supporting this in the derived node tree structure.
This patch should contain no functional changes. Two upcoming patches
will use this system for the "Join Geometry" node and expose link picking
and updated display in the UI: D10069 and D10181.
Reviewed By: Jacques Lucke, Hans Goudey
Differential Revision: https://developer.blender.org/D10067
|
|
Implements a node to get collection objects.
These objects are then passed along as instances in the node tree.
Follow up tasks:
Multiple nodes does not support instancing yet: T85159
Changing collection offset does not trigger a refresh: T85274
Reviewed By: Jacques, Dalai, Hans
Differential Revision: http://developer.blender.org/D10151
|
|
Required changes to compile `node.cc` with clang tidy:
* Use c++ includes like (e.g. climits instead limits.h).
* Insert type casts when casting from `void *`.
* Replace `NULL` with `nullptr`.
* Replace typedef statements.
This change is in order to use the `blender::Map` data structure
for node error messages.
|
|
|
|
When the displacement space is set to SHD_SPACE_WORLD, the GLSL method
"node_displacement_world" is used instead of the "node_displacement_object" method. The two GLSL methods:
```
void node_displacement_object(
float height, float midlevel, float scale, vec3 N, mat4 obmat, out vec3 result)
{
N = (vec4(N, 0.0) * obmat).xyz;
result = (height - midlevel) * scale * normalize(N);
result = (obmat * vec4(result, 0.0)).xyz;
}
void node_displacement_world(float height, float midlevel, float scale, vec3 N, out vec3 result)
{
result = (height - midlevel) * scale * normalize(N);
}
```
In contrast to the "node_displacement_object" method, the "node_displacement_world"
does not require an "obmat" parameter. Attempting to still pass "GPU_builtin(GPU_OBJECT_MATRIX)"
as additional parameter will result in a memory leak. The "GPUNodeLink" allocated in
the "GPU_builtin" method will never get released.
Fixes T83941 Memory leak when using the Displacement shader node in Eevee with the displacement
space set to "World Space"
|
|
|
|
The issue was that the `offset` in `dst_span[offset]` was out of bounds
when the domain size is 0. The fix is to simply skip copying attributes
in that case.
|
|
Also another copy and paste error in the attribute compare node.
|
|
This adds the ability to use all the math operations in the regular
utility "Math" node. The code is quite similar to the attribute vector
math node, with the simplification that the result is always a float.
Differential Revision: https://developer.blender.org/D10199
|
|
Update to changes in master.
Reviewed By: JacquesLucke
Differential Revision: http://developer.blender.org/D10211
|
|
|
|
Use transform matrices instead of loc, rot, scale variables to store instance transforms.
Reviewed By: JacquesLucke
Differential Revision: http://developer.blender.org/D10211
|
|
This implements a new geometry node based on T84606.
It is the first node that generates a `VolumeComponent`.
Differential Revision: https://developer.blender.org/D10169
|
|
This just implements a todo with a utility function that didn't exist
at the time. For example, if one geometry has a "scale" attribute with
a float type and another has a "scale" attribute with a vector type,
the vector type will be used for the resulting geometry.
Differential Revision: https://developer.blender.org/D10206
|
|
|
|
Hans noticed that these dirty flags are only used for normals currently
and that the edge flag is not used at all. This patch still applies the
"entire" fix with all four flags.
Differential Revision: https://developer.blender.org/D10193
|
|
|
|
Previously float2 was converted to float3 by implicitly converting to a
float pointer first, which was then passed to the float3 constructor.
This leads to uninitialized memory in the z component of the new float3.
Ideally this should be solved in float2/float3 itself, but my first fix for
that resulted in a compile error: rB6ac0a3d83c8e5a39bd5356aa0d68e3166bd91e82
This is an alternative fix that can be used for now. Will have to look
into the conversion in more detail again.
|
|
We will need to expand this node soon to add weight/count for different
elements inside the collection. For that it is better to have the node
to use its own DNA.
|
|
This node allows sampling a texture for every vertex based on some
mapping attribute. Typical attribute names are the name of a uv map
(e.g. "UVMap") and "position". However, every attribute that can be
converted to a vector implicitly is supported.
It should be noted that as of right now, uv map attributes can only be
accessed after a Point Distribute node.
Ref T82584.
Differential Revision: https://developer.blender.org/D10121
|
|
|
|
|
|
For the most part, this just adds boilerplate code for volume support in geometry nodes:
* Add `VolumeComponent` next to `MeshComponent`, etc.
* Support `VolumeComponent` in depsgraph object iterator.
Furthermore, I added initial volume support in a few nodes:
* The Object Info node outputs an object instance when the input is a volume object
(that will be the same for mesh objects soonish, to avoid copies).
* Support transforming a `VolumeComponent` in the Transform node.
* Support the `VolumeComponent` in Join Geometry nodes, but only when just one of the
inputs has a volume component for now.
Right now, there is no way to create a `VolumeComponent`, because the Object Info node
outputs an object instance. The `VolumeComponent` will be necessary for upcoming nodes,
which will generate volumes on the fly.
Viewport selection does not work correctly with `VolumeComponent`s currently. I don't
know why that is. That can be figured out a bit later, once we can actually create
new volumes in geometry nodes.
Ref T84604.
Differential Revision: https://developer.blender.org/D10147
|
|
|
|
The manipulation of rot/scale was simply not implemented.
|
|
|
|
Resolves 'cmake_consistency_check' reports.
|
|
|
|
|
|
By design the modified object transformations should still work and
affect the geometry nodes results. The current behaviour, however, would
make the geometry from the object info to not be affected by the
modified object transformations. This patch changes that by default.
In a similar fashion the Location, Rotation and Scale sockets outputs
should be aware of whether the output should be in the global space or in the
space of the nodetree.
To solve this, the patch introduces a new transformation space "enum"
where users can pick "Original" or "Relative" space.
Original
--------
Output the geometry relative to the input object transform, and the
location, rotation and scale relative to the world origin.
Relative
--------
Bring the input object geometry, location, rotation and scale into the
modified object maintaining the relative position between the two objects in
the scene.
Relative space violates a bit the design of the nodetree. The geometry in this
case is transformed so that moving the modified object doesn't interfere with
the geometry. This is particularly useful for the boolean node for instance.
"Original" is the default space, but old files are set to "Relative" for
backwards compatibility.
Differential Revision: https://developer.blender.org/D10124
|
|
The depsgraph will have to be accessed in an upcoming patch.
|
|
|
|
This implements the node tree update function, which is needed so that the
reroutes get updated to the correct type. It is based on the same code in
the shader and compositor node trees.
Differential Revision: https://developer.blender.org/D10123
|
|
|
|
This commit adds the ability to provide a default value to
`attribute_try_get_for_output` and uses it for the `Point Scale` node,
which is important because the node uses multiplication.
The idea is to keep "name-specific" functionality in nodes rather than in
the attribute API, otherwise the complexity will be hard to keep track of.
So this fix doesn't apply to the Attribute Vector Math node, but hopfully
that is okay since that's now a lower level node for this purpose anyway.
Differential Revision: https://developer.blender.org/D10115
|
|
If the mesh has any corner or point attributes (e.g. vertex weights or
uv maps), those attributes will now be available on the generated points
as well.
Other domains can be supported as well. I just did not implement those yet,
because we don't have a use case for them.
Differential Revision: https://developer.blender.org/D10114
|
|
Some of these conversions are arbitrary to some degree.
However, the user experience is better when at least something
happens when converting between types, instead of just getting
zeros. I left out a few conversions that I wasn't sure about yet.
I also added conversions for float2.
|
|
|
|
This fixes the behavior of some nodes when the same attribute
name is used for input and output. If both attributes have a
different type, they can't exist at the same time. Therefore,
the input attribute has to be removed in order to create the
output attribute.
Previously, the input attribute was remove before it was used
in any computations. Now, the output is written to a temporary
buffer and only later saved in the geometry component. This
allows both attributes to coexist within the node.
The temporary attribute is only create when necessary. The
normal case without name collisions still works the same
as before.
Differential Revision: https://developer.blender.org/D10109
Ref T83793.
|
|
|
|
This shouldn't have any functional changes.
|
|
The other output types did not work currently anyway.
There is not a significant benefit in somehow deducing the output
attribute type from the existing attribute types.
|
|
The translate node moves every point in the geometry, and the scale
node multiplies the "scale" attribute of the input geometry by its input.
While these operations are already possible with the "Attribute" nodes,
these new nodes fit nicely with the nodes specifically for changing the
"rotation" attribute that already exist, and they provide a simpler way
to do the same thing.
Differential Revision: https://developer.blender.org/D10100
|
|
This is consistent with the other node names, giving (almost) all of the
nodes in the "Point" category the same prefix.
|
|
"Geometry A" becomes "Geometry 1", just to be more consistent
with other nodes.
|
|
This greatly simplifies the Point Distribute node. For a poisson disk
distribution, it now uses a simpler dart throwing variant. This results
in a slightly lower quality poisson disk distribution, but it still
fulfills our requirements: have a max density, minimum distance input
and stability while painting the density attribute.
This new implementation has a number of benefits over the old one:
* Much less and more readable code.
* Easier to extend with other distribution algorithms.
* Easier to transfer more attributes to the generated points later on.
* More predictable output when changing the max density and min distance.
* Works in 3d, so no projection on the xy plane is necessary.
This is related to T84640.
Differential Revision: https://developer.blender.org/D10104
|
|
Now that typed attribute wrappers don't need to own the
attribute anymore, many `std::move` calls can be removed.
|
|
This commit adds the "Save as Render" feature to the file output node,
that allows to disable the application of the configured view transform
and other color management settings on the image. If disable it uses
the standard view transform instead. This feature was originally
suggested in T83842 and is part of the color management improvements
task in T68926. With this feature it is possible to toggle the
application of the color management settings for each input socket
of the File Output node individually.
Reviewed By: brecht
Maniphest Tasks: T68926, T83842
Differential Revision: https://developer.blender.org/D9921
|
|
In order to avoid losing information, it sometimes makes sense for the
output attribute type to depend on the types of the input attributes.
Such a function already exists, `attribute_data_type_highest_complexity`,
it just needs to be used in a few more places. The change for the attribute
compare node is just so the code there uses the same code style as in the
attribute mix node.
Addresses part of T83793
Differential Revision: https://developer.blender.org/D10099
|