Commit Graph

5305 Commits

Author SHA1 Message Date
Omar Emara
7ec9fa680e Compositor: Implement Scale node or new CPU compositor
Reference #125968.
2024-12-02 18:02:38 +02:00
Omar Emara
377d272f72 Fix: Zero division in Tone Map Photoreceptor node 2024-12-02 13:45:35 +02:00
Omar Emara
4eb1b78d82 Fix: Compositor: Compile error with WITH_FFTW3 off 2024-11-29 15:23:49 +02:00
Omar Emara
b71338ba8d Compositor: Implement Glare node for new CPU compositor
Reference #125968.
2024-11-29 15:04:40 +02:00
Omar Emara
a9436b04b8 Fix: Compositor: Crash using Keying node in new CPU compositor
The Keying node crashes in the new CPU compositor because it was writing
to an output that shouldn't be computed and is thus unallocated.
2024-11-28 10:58:14 +02:00
Omar Emara
292ad6b00e Compositor: Implement Keying node for new CPU compositor
Reference #125968.
2024-11-27 19:28:16 +02:00
Omar Emara
0efb0ce48e Compositor: Implement Dilate node for new CPU compositor
Reference #125968.
2024-11-27 19:28:16 +02:00
Omar Emara
8f77e0d7fe Fix: Zero division in Dilate node 2024-11-27 19:28:16 +02:00
Campbell Barton
b9f055459a Cleanup: ensure trailing space around comment blocks 2024-11-27 19:01:00 +11:00
seanterelle
6e9d988018 Geometry Nodes: Add dynamic label to warning node
Implementation of auto-label for the warning node based on the type
(similar to the Math node).

Pull Request: https://projects.blender.org/blender/blender/pulls/131000
2024-11-27 01:41:49 +01:00
Omar Emara
f9420bd58a Compositor: Implement vector Blur for new CPU compositor
Reference #125968.
2024-11-26 16:10:56 +02:00
Omar Emara
43d2538087 Compositor: Implement Inpaint node for new CPU compositor
Reference #125968.
2024-11-26 16:10:56 +02:00
Omar Emara
be19daaa06 Compositor: Implement Directional Blur for new CPU compositor
Reference #125968.
2024-11-26 16:10:56 +02:00
Omar Emara
10e663e001 Compositor: Implement Defocus node for new CPU compositor
Reference #125968.
2024-11-25 16:23:23 +02:00
Omar Emara
da36ba3b8e Compositor: Implement Bokeh Blur for new CPU compositor
Reference #125968.
2024-11-25 16:20:50 +02:00
Campbell Barton
0de8ae8046 Cleanup: spelling in comments 2024-11-25 13:24:46 +11:00
Hans Goudey
ea875f6f32 Geometry Nodes: Port triangulate node from BMesh to Mesh
Add a Mesh implementation of triangulation, which is currently just
implemented for BMesh. The main benefit of this is performance and
decreased memory usage. The benefit is especially large because the
node currently converts to BMesh, triangulates, and then converts back.
But the BMesh implementation is entirely single threaded, so it will
always be much slower.

The new implementation uses the principle of "never just process a
single element at a time" but it also tries to avoid processing _too_
many elements at once, to decrease the size of temporary buffers.
Practically that means the work is organized into chunks of selected
faces, but within each chunk, each task is done in a separate loop.
Arguably I went a bit far with some optimizations, and some of the
complexity isn't necessary, but I hope everything is clear anyway.

Unlike some other Mesh ports like the extrude node or the split edges
code, this generates a new mesh. I still go back and forth on that
aspect, but reusing the same mesh would have required reallocating
face attributes from scratch anyway. Implicit sharing is used to
avoid copying vertex attributes though.

The result mesh is reorganized a bit. Unselected face data comes first,
then selected triangles, then triangulated NGons, then triangulated
quads. This makes attribute interpolation and internal calculations
more efficient.

The "Minimum Vertices" socket is replaced with versioning. In the new
implementation it would have an impact on code complexity, and for a
builtin "atomic" node it makes more sense as part of the selection.

The performance difference depends on the number of CPU threads, the
number of attributes, and the selection size. As all of those numbers
go up, the benefit will grow. The "modes" also affect the performance,
obviously.

With a Ryzen 7950x, I tested performance in a few situations (in ms):
|                            | Selection | Before | After | Change |
| -------------------------- | --------- | ------ | ----- | ------ |
| 1.4 m quads (fixed)        | 50%       | 1533   | 15.9  | 96x    |
| 10 m quads (shortest)      | 100%      | 9700   | 165.0 | 59x    |
| 1 m 10-side Ngons (beauty) | 90%       | 3785   | 115.9 | 33x    |
| 1 m quads many attributes  | 100%      | 54600  | 332.3 | 164x   |

In follow-up commits, I'll move other areas to use mesh triangulation
instead of BMesh. This is the last geometry node using BMesh besides
the Ico Sphere primitive.

Pull Request: https://projects.blender.org/blender/blender/pulls/112264
2024-11-23 00:25:52 +01:00
Omar Emara
fa9bde230b Compositor: Implement Anisotropic Kuwahara for new CPU compositor
Reference #125968.
2024-11-22 16:35:15 +02:00
Omar Emara
01af6ffd22 Compositor: Implement Blur node for new CPU compositor
Reference #125968.
2024-11-22 15:22:32 +02:00
Omar Emara
80a054c15d Compositor: Implement Symmetric Blur Weights for new CPU compositor
Reference #125968.
2024-11-21 16:40:03 +02:00
Omar Emara
0d83aafd4b Compositor: Implement Bilateral Blur for new CPU compositor
Reference #125968.
2024-11-21 16:24:21 +02:00
Omar Emara
8b720eb6ea Compositor: Implement Filter node for new CPU compositor
Reference #125968.
2024-11-21 16:22:43 +02:00
Omar Emara
15cdeae620 Fix: Compile error in Despeckle node for Metal
We can't use the `threshold` uniform name in Metal because it is used as
a local variable in one of the library files, because uniforms are
defines in Metal, so it causes an error. Change the name to
`color_threshold` as a fix.
2024-11-21 09:37:44 +02:00
Omar Emara
e49498a795 Compositor: Implement Classic Kuwahara for new CPU compositor
Reference #125968.
2024-11-20 16:15:49 +02:00
Omar Emara
f4767bea72 Compositor: Implement Pixelate for new CPU compositor
Reference #125968.
2024-11-20 15:56:21 +02:00
Omar Emara
11a5e362d4 Compositor: Implement Denoise for new CPU compositor
Reference #125968.
2024-11-20 15:55:33 +02:00
Omar Emara
5e806db594 Compositor: Implement Despeckle for new CPU compositor
Reference #125968.
2024-11-20 15:53:28 +02:00
Omar Emara
5036c5338b Compositor: Implement Sun Beams for new CPU compositor
Reference #125968.
2024-11-20 15:51:30 +02:00
Jacques Lucke
e62aa986b2 Format: use fmt::format correctly with runtime format strings
The `fmt::format` can process the format string at compile time. Currently, we
don't seem to be using that as we don't use `FMT_STRING`. Starting with C++20,
that will be the default though, and one has to explicitly opt out in places
where the string is not known at compile time using `fmt::runtime(...)`.
Currently, our code does not compile as C++20 because of that. Unfortunately, we
have many places with runtime format strings, because of i18n.

Pull Request: https://projects.blender.org/blender/blender/pulls/130392
2024-11-20 10:41:29 +01:00
Hans Goudey
c57ebc99eb Cleanup: Use StringRef instead of std::string in a few cases
Pull Request: https://projects.blender.org/blender/blender/pulls/130534
2024-11-19 19:47:27 +01:00
Jacques Lucke
1125d6ee15 Cleanup: Attributes: rename AttributeKind to AttributeDomainAndType
There is not really a good definition for what an "attribute kind". There are
many possibilities, it could include domain, type, geometry type, default value,
usage, ...

So it's better not to use this generic name. With the current name, one always
has to look at the definition again to be sure what it contains and what it does
not.

The name `AttributeDomainAndType` is way more explicit and does not have the
same problems. It's a bit longer, but that does not seem to be a problem in the
places where we use it.

Pull Request: https://projects.blender.org/blender/blender/pulls/130505
2024-11-19 14:31:19 +01:00
Omar Emara
54fa1f9bb7 Compositor: Implement Cryptomatte for new CPU compositor
Reference #125968.
2024-11-19 12:47:23 +02:00
Omar Emara
24d1733059 Compositor: Implement Double Edge Mask for new CPU compositor
Reference #125968.
2024-11-18 17:35:22 +02:00
Omar Emara
a8591c9efb Compositor: Implement Box Mask for new CPU compositor
Reference #125968.
2024-11-18 17:35:22 +02:00
Omar Emara
c9e974249e Compositor: Implement Ellipse Mask for new CPU compositor
Reference #125968.
2024-11-18 17:35:22 +02:00
Omar Emara
8034e1ee51 Compositor: Implement ID Mask node for new CPU compositor
Reference #125968.
2024-11-18 17:35:22 +02:00
Jacques Lucke
b4fc5754fd Cleanup: avoid constructing std::string from nullptr
This probably never in practice in these cases.
Constructing a `std::string` from nullptr is invalid.
Starting with C++23, the `nullptr_t` is even explicitly deleted.
2024-11-16 23:48:49 +01:00
Jacques Lucke
af3ddb5551 Fix #130369: wrong attributes removed in Extrude Mesh node
The issue was that pointers to `CustomDataLayer.name` are not stable when
attributes are removed. So the change is to create a temporary copy of the
names that need to be removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/130373
2024-11-16 21:58:29 +01:00
Bastien Montagne
bb3eb9aa23 Cleanup: Add missing BLI headers.
Not sure why I got an error about this today in one of my usual
builds... very mysterious, but the `BLI_array_utils.hh` include does
seem to be missing anyway.
2024-11-16 19:06:23 +01:00
Omar Emara
6e814e7597 Compositor: Implement Mao UV node for new CPU compositor
Reference #125968.
2024-11-15 19:20:28 +02:00
Omar Emara
7f7ababec2 Compositor: Implement Displace node for new CPU compositor
Reference #125968.
2024-11-15 19:18:31 +02:00
Hans Goudey
0684639e1b Cleanup: Grease Pencil: Remove indirect includes from headers
To avoid unnecessary header parsing during compilation.

Pull Request: https://projects.blender.org/blender/blender/pulls/130285
2024-11-14 22:07:19 +01:00
Hans Goudey
7074daed04 Geometry Nodes: Add "Limit Surface" option in subdivision surface node
Currently the node behaves differently from the modifier by default
because it lacks the option to use the limit surface. This is mainly
an oversight, since the option gives better results and better
performance.

This adds a new "Limit Surface" option. Because it's on by default,
there is also versioning to turn it off for existing files.

Resolves #112912.

Pull Request: https://projects.blender.org/blender/blender/pulls/130243
2024-11-14 18:21:00 +01:00
Omar Emara
250196e60a Compositor: Implement Lens Distort for new CPU compositor
Reference #125968.
2024-11-14 14:22:50 +02:00
Omar Emara
4457f8a70d Compositor: Implement Movie Distortion for new CPU compositor
Reference #125968.
2024-11-14 14:21:57 +02:00
Bastien Montagne
1a32a2c66f Merge branch 'blender-v4.3-release' 2024-11-13 15:34:26 +01:00
Omar Emara
e080668202 Compositor: Implement Crop node for new CPU compositor
Reference #125968.
2024-11-13 15:59:29 +02:00
Omar Emara
5fd9bbb70c Compositor: Implement Flip node for new CPU compositor
Reference #125968.
2024-11-13 15:58:38 +02:00
Damien Picard
5f52c5ce46 Fix: I18n: Integer Math node title used wrong translation context
The integer math node items used the proper translation context, but
not the translation for the node label.

Reported by ziweidao.

Pull Request: https://projects.blender.org/blender/blender/pulls/130225
2024-11-13 13:53:57 +01:00
Bastien Montagne
b325142d17 Merge branch 'blender-v4.3-release' 2024-11-12 16:55:40 +01:00