Age | Commit message (Collapse) | Author |
|
We often had to use two `FieldEvaluator` instances to first evaluate
the selection and then the remaining fields. Now both can be done
with a single `FieldEvaluator`. This results in less boilerplate code in
many cases.
Performance is not affected by this change. In a separate patch we
could improve performance by reusing evaluated sub-fields that are
used by the selection and the other fields.
Differential Revision: https://developer.blender.org/D13571
|
|
Also add groups in some files.
|
|
Point cloud is two separate words, this just changes comments in
a few places where we were inconsistent. A small wording change
to another comment is also included.
|
|
This ends up including the removed headers in many unnecessary places.
Also, remove unnecessary extern from function definitions.
|
|
Also remove unnecessary function to set a node type's
label function that duplicated its definition, and make
another function static.
|
|
Calling `foreach_field_input` on a highly nested field (we do that
often) has an exponential running time in the number of nodes.
That is because the same node may be visited many times.
This made Blender freeze on some setups that should work just fine.
Now every field keeps track of its inputs all the time. That replaces
the exponential algorithm with constant time access.
|
|
The const argument makes sense because these are the "source"
sockets, even though a const cast is necessary at one point.
The name "interface_socket" is an improvement over "stemp"
because the latter sounds like "temporary", or it confuses
the old socket template system with a node group's interface.
|
|
This patch replaces `round_fl_to_int` with `floor` and adjusts the
maximum value accordingly. The call to `round_fl_to_int` is problematic
here because it messes with the probability distribution at the edges
of the value range, meaning the first and last values were only half
as common as all other values. Since `round_fl_to_int` does
`floor(val + 0.5)`, it will not introduce misbehavior in edge cases.
Differential Revision: https://developer.blender.org/D13474
|
|
Ref T92709
|
|
- Indent text after dot-points.
- Use an unparsed code-block to display the text verbatim in doxygen.
|
|
This node outputs the current scene time in seconds or in frames.
Use of this node eliminates the need to use drivers to control values
in the node tree that are driven by the scene time.
Frame is a float value to provide for subframe rendering for motion
blur.
Differential Revision: https://developer.blender.org/D13455
|
|
A crash happened when `instance_id_attribute` further down in the
function was null. This issue was probably introduced when the
id attribute starting using generic attribute handling.
|
|
Ref T92709
|
|
This node is a field input that outputs a separate index for each mesh island.
The indices are based on the order of the lowest-numbered vertex in each island.
Authoring help from @hooglyboogly
Differential Revision: https://developer.blender.org/D13504
|
|
|
|
|
|
This commit adds the shader socket type to the new socket builder api.
Re commits part of rB0bd3cad04edf4bf9b9d3b1353f955534aa5e6740
|
|
Recommits part of rBf60b95b5320f8d6abe6a629fe8fc4f1b94d0d91c
|
|
Re commits rBf72cc47d8edf849af98e196f721022bacf86a5e7 but without the unity build
|
|
Re commits part of rB0578921063fbb081239439062215f2538a31af4b
|
|
Creates a new Edge Neighbors node which outputs a field
containing the number of faces connected to each edge.
Differential Revision: https://developer.blender.org/D13493
|
|
This adds a new Geometry to Instance node that turns every
connected input geometry into an instance. Those instances
can for example be used in the Instance on Points node.
Differential Revision: https://developer.blender.org/D13500
|
|
The type conversions do not depend on other files in the nodes
module. Furthermore we want to use the conversions in the
geometry module without creating a dependency to the
nodes module there.
|
|
The `node_storage` functions to retrieve const and mutable structs
from a node are generated by a short macro that can be placed at the
top of each relevant file. I use this in D8286 to make code snippets
in the socket declarations much shorter, but I thought it would be
good to use it consistently everywhere else too.
The functions are also useful to avoid copy and paste errors,
like the one corrected in the cylinder node in this commit.
Differential Revision: https://developer.blender.org/D13491
|
|
This reverts to following commits:
* rB5cad004d716da02f511bd34983ac7da820308676
* rB97e3a2d935ba9b21b127eda7ca104d4bcf4e48bd
* rBf60b95b5320f8d6abe6a629fe8fc4f1b94d0d91c
* rB0bd3cad04edf4bf9b9d3b1353f955534aa5e6740
* rBf72cc47d8edf849af98e196f721022bacf86a5e7
* rB3f7014ecc9d523997062eadd62888af5fc70a2b6
* rB0578921063fbb081239439062215f2538a31af4b
* rBc20098e6ec6adee874a12e510aa4a56d89f92838
* rBd5efda72f501ad95679d7ac554086a1fb18c1ac0
The original move to c++ that the other commits depended upon had some issues
that should be fixed before committing it again. The issues were reported in
T93797, T93809 and T93798.
We should also find a better rule for not using c-style casts going forward,
although that wouldn't have been reason enough to revert the commits.
Introducing something like a `MEM_new<T>` and `MEM_delete<T>`
function might help with the the most common case of casting the return
type of `MEM_malloc`.
Going forward, I recommend first committing the changes that don't
require converting files to c++. Then convert the shading node files
in smaller chunks. Especially don't mix fairly low risk changes like
moving some simple nodes, with higher risk changes.
|
|
Error in d5efda72f501. Was changing an iteration that would free items
to an iterator that is not safe for use in such cases.
There still seem to be significant issues with the rendering, but that's
a separate issue to be fixed.
|
|
- Added space below non doc-string comments to make it clear
these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
- Minor improvements to doc-strings.
Ref T92709
|
|
|
|
No functional changes, tests passed and I double checked the nodes by hand.
|
|
|
|
|
|
|
|
Instead of essentially hashing a bool, just use a ternary operator.
Differential Revision: https://developer.blender.org/D13494
|
|
Remove unneeded recent static_cast attempt.
Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D13492
|
|
This improves both code finding, for example "color ramp" now has its own file.
And now each node has its own namespace so function names can be simplified
similar to rBfab39440e94
This commit also makes all file names use snake case instead of camel case.
Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D13482
|
|
The `Map::items()` iterator does not return references.
|
|
|
|
This flag is currently only used for vector sockets
so the function is limited to the vector builder.
The flag is only used by two shader nodes at the moment
and this is needed to port them over to the new socket declaration API.
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D13490
|
|
Most of our field inputs are currently specific to geometry. This patch introduces
a new `GeometryFieldInput` that reduces the overhead of adding new geometry
field input.
Differential Revision: https://developer.blender.org/D13489
|
|
Creates 4 new nodes which provide topology information
for the mesh. Values are interpolated from the primary
domain in each case using basic attribute interpolation.
Vertex Neighbors
- Vertex Count
- Face Count
Face Neighbors
- Vertex Count
- Neighboring Face Count
Edge Vertices
- Vertex Index 1
- Vertex Index 2
- Position 1
- Position 2
Face Area
- Face Area
Differential Revision: https://developer.blender.org/D13343
|
|
The resample node didn't handle the case of when a spline didn't have
any evaluated points. For poly and Bezier splines we should never hit
this case, but it is expected when the number of NURBS control points
is smaller than its order, so we have to handle the case here.
It's not that obvious what to do in this case, there are a few options:
- Remove the bad splines from the result
- Generate empty splines for those inputs
- Skip resampling the bad splines, copy them to the result
- Arbitrarily generate single point splines
I chose option three, just skipping the "bad" splines. Since the node
already has a selection input, this can be described by just extending
that. "Splines with no evaluated points are implicitly deselected."
The first option would probably be valid too though.
Differential Revision: https://developer.blender.org/D13434
|
|
This commit adds the shader socket type to the new socket builder api.
As a test, this commit also converts the Add Shader node to the new API
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D13485
|
|
- Create a new `bf_nodes_shader` library
- Enable unity builds for `bf_nodes_shader`, gives abount a 2.7x speed up for compile times
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D13484
|
|
This technique isn't really necessary anymore, because unity builds
avoid instantiating the same template too many times already.
|
|
Follow up on rB1df8abff257030ba79bc23dc321f35494f4d91c5
This puts all static functions in geometry node files into a new
namespace. This allows using unity build which can improve
compile times significantly
- The namespace name is derived from the file name.
That makes it possible to write some tooling that checks the names later on.
The filename extension (cc) is added to the namespace name as well.
This also possibly simplifies tooling but also makes it more obvious that this namespace is specific to a file.
- In the register function of every node, I added a namespace alias namespace `file_ns = blender::nodes::node_shader_*_cc`;.
This avoids some duplication of the file name and may also simplify tooling, because this line is easy to detect.
The name `file_ns` stands for "file namespace" and also indicates that this namespace corresponds to the current file.
In the future some nodes will be split up to separate files and given their own namespace
This will allow function names to be simplified similar to rBfab39440e94
Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D13480
|
|
This change follows up on recent c --> c++ conversions
|
|
Fixes compilation errors after rBd5efda72f501
Re sorted some includes.
|
|
This will be useful in the future to use the new socket builder API
Aditional changes:
- Declare variables where initialized
- Do not use relative includes
Differential Revision: https://developer.blender.org/D13465
|
|
The problem is that `current_mask` can become `selection.size()`.
The loop could also be refactored to break out of it when the end
of the selection is reached. This can be done separately.
|
|
This patch leaves a out a few nodes:
- Group Nodes
- Image input node
- File output node
- Switch View
- Cryptomatte
These nodes above are a bit more complicated and should be worked on individually.
Differential Revision: https://developer.blender.org/D13266
|