Commit Graph

4968 Commits

Author SHA1 Message Date
Campbell Barton
5a561c6aeb Cleanup: spelling in comments 2024-10-16 21:10:49 +11:00
Damien Picard
5715693a97 UI: Use title case for Grease Pencil, Freestyle, Line Art
This was already the case for the vast majority of occurrences, and is
recommended by the human interface guideline's writing style.

Pull Request: https://projects.blender.org/blender/blender/pulls/129000
2024-10-15 13:00:47 +02:00
Omar Emara
440dc61db2 Compositor: Add stub implemenetation for CPU pixel nodes
This patch adds stub implementation for CPU pixel nodes in order to stop
those nodes from crashing when used while also easing future
development.

Pull Request: https://projects.blender.org/blender/blender/pulls/129033
2024-10-15 09:32:13 +02:00
Campbell Barton
eb36125218 Unbreak build from missing include 2024-10-15 16:20:53 +11:00
Omar Emara
fbdb803750 Compositor: Implement Multi-Function Procedure Operation
This patch implements the multi-function procedure operation for the new
CPU compositor, which is a concrete implementation of the PixelOperation
abstraction, much like ShaderOperation, but uses the FN system to more
efficiently evaluate a group of pixel-wise operations.

A few changes were done to FN to support development. The multi-function
builder now allows retrieving the built function. A new builder method
construct_and_set_matching_fn_cb was added to allow using the SI_SO
builders with non static functions. A few other SI_SO were added to. And
a CPP type for float4 was added.

Additionally, the Gamma, Math, Brightness, and Normal nodes were
implemented as an example. The Math node implementation reused the
existing GN math node implementation, so the code was moved to a common
file.

Reference #125968.

Pull Request: https://projects.blender.org/blender/blender/pulls/126988
2024-10-15 06:51:42 +02:00
Omar Emara
f4fc683fc4 Compositor: Add stub CPU implementation for nodes
This patch adds stub implementations for the new CPU mode of the
realtime compositor. Unsupported nodes will return zero results until
they are implemented.
2024-10-14 14:19:14 +03:00
Jacques Lucke
a239bfc4dd Refactor: Nodes: improve drawing of nodes based on node declaration
The main goal is to simplify adding support for nested node panels. The patch
makes use of the updated recursive node declarations introduced in
6ffc585fb8.

The main changes are:
* Rewritten node drawing in a way that makes ui design decisions like panel
  visibility and margins more explicit. Especially the handling of margins is
  much better now imo. Previously, it was very hard to change the margin for
  specific cases without accidentally breaking other situations. Now each
  possible case has an explicit margin. This needs a few more lines of code but
  is much easier to work with.
* Rewritten node drawing in panel (sidebar + material properties) using the new
  ways to iterate over the declaration.
* It's possible to add custom layouts at any point in the node declaration now.
  This also replaces the need for having a `draw_buttons` callback for panels.

Pull Request: https://projects.blender.org/blender/blender/pulls/128822
2024-10-11 12:20:58 +02:00
Jacques Lucke
22eac7655d Fix: wrong return type
This only resulted in an assert in debug builds.
2024-10-10 13:55:16 +02:00
Campbell Barton
806d1fd1fa Cleanup: quiet set but unused warning 2024-10-10 18:36:08 +11:00
Jacques Lucke
cf954b1d8d Cleanup: unused variable 2024-10-09 15:49:55 +02:00
Jacques Lucke
6ffc585fb8 Refactor: Geometry Nodes: recursive node declarations
This refactor contains the following changes:
* Each `PanelDeclaration` contains its direct children. Previously, it only knew
  how many children it had. That added complexity to wherever we iterate over
  the node declaration.
* Adds a new `DeclarationListBuilder` that is a base class of
  `NodeDeclarationBuilder` and `PanelDeclarationBuilder`. It makes sure that the
  same API for adding sockets, panels and separators exist for both.
* Modified declare functions for group, group input and group output nodes to
  use the normal node builder api instead of doing something custom.

No functional changes are expected.

The main reason for this refactor is to simplify working with nested panels in
node declarations which is useful when we want to support nested panels in the
node editor. The node drawing code is not simplified in this patch, but that
should be easier afterwards.

Pull Request: https://projects.blender.org/blender/blender/pulls/128799
2024-10-09 15:45:43 +02:00
Iliya Katueshenock
26bce79b10 Cleanup: unused variable
Pull Request: https://projects.blender.org/blender/blender/pulls/128662
2024-10-07 16:38:13 +02:00
Jacques Lucke
e0e8a87453 Merge branch 'blender-v4.3-release' 2024-10-07 13:32:46 +02:00
Jacques Lucke
5fa8b5b601 Fix #127170: crash when openvdb throws exception in Volume to Mesh node
This catches the exception and shows the error message to the user.
We don't have much control over the error message here currently. Better just
report it for now. In the future we could try to detect what error it is exactly
and produce a more user friendly error.
2024-10-07 13:32:01 +02:00
Jacques Lucke
67c7485bfd Refactor: Geometry Nodes: improve lifetime analysis for anonymous attributes
This refactors the lifetime analysis of anonymous attributes in geometry nodes.
The refactor has a couple of goals:
* Use a better and simpler abstraction that can be used when building the
  lazy-function graph. We currently have a bunch of duplicate code to handle
  "field source" and "caller propagation" attributes. This is now unified so
  that one only has to worry about one kind of "reference sets".
* Make the abstraction compatible with handling bundles and closures in case we
  want to support them in the future. Both types can contain geometries and
  fields so they need to be taken into account when determining lifetimes.
* Make more parts independent of the concept of "anonymous attributes". In
  theory, there could be more kinds of referenced data whose lifetimes need to
  be managed. I don't have any concrete plans for adding any though.

At its core, deterministic anonymous attributes still work the same they have
been since they became deterministic [0]. Even the generated lazy-function graph
is still pretty much or even exactly the same as before.

The patch renames `AnonymousAttributeSet` to the more general
`GeometryNodesReferenceSet` which is more. This also makes more places
independent of the concept of anonymous attributes. Functionally, this still the
same though. It's only used in the internals of geometry nodes nowadays. Most
code just gets an `AttributeFilter` that is based on it.

[0]: https://archive.blender.org/developer/D16858

Pull Request: https://projects.blender.org/blender/blender/pulls/128667
2024-10-07 12:59:39 +02:00
Jacques Lucke
9e604f0e00 Merge branch 'blender-v4.3-release' 2024-10-07 12:45:10 +02:00
Jacques Lucke
218af9b2cc Fix: missing anonymous attribute relations for foreach zone 2024-10-07 12:44:21 +02:00
Jacques Lucke
3103daab20 Cleanup: avoid unnecessary use of unique_ptr 2024-10-05 12:04:00 +02:00
Jacques Lucke
64a0895409 Cleanup: Geometry Nodes: extract zone eval code into separate files 2024-10-04 15:35:18 +02:00
Jeroen Bakker
607093b506 Merge branch 'blender-v4.3-release' 2024-10-04 14:27:16 +02:00
Omar Emara
ccab8005f6 Fix #126604: Legacy Cryptomatte doesn't work in GPU
The Legacy Cryptomatte node doesn't work in GPU execution mode if
Precision is set to Auto. That's because the colors picked from the Pick
layer might be in half precision and thus will not match the colors in
the Cryptomatte layers. This is due to the compositor using the
context's precision for Viewer outputs as opposed to the precision of
the image that actually needs to be viewed in the Viewer node.

To fix this, we set the Viewer node precision to be the precision of its
input, that way, the Cryptomatte pick layer will be output in full
precision as intended.

Pull Request: https://projects.blender.org/blender/blender/pulls/128495
2024-10-04 14:25:16 +02:00
Jacques Lucke
391955092a Cleanup: Geometry Nodes: reduce boilerplate of drawing active item properties 2024-10-04 13:36:25 +02:00
Jacques Lucke
3f8f5fd998 Cleanup: sort NOD_static_types.hh entries 2024-10-03 23:45:56 +02:00
Jacques Lucke
b0c4054b9c Cleanup: add missing newlines 2024-10-03 23:41:51 +02:00
Jacques Lucke
f18b37f811 Cleanup: Geometry Nodes: reduce boilerplate for blend read/write for socket items 2024-10-03 23:39:00 +02:00
Jacques Lucke
bfc1fb8f83 Cleanup: Geometry Nodes: reduce boilerplate for ui-lists for socket items 2024-10-03 22:53:09 +02:00
Jacques Lucke
e847a7d090 Cleanup: Geometry Nodes: reduce boilerplate of defining socket item operators 2024-10-03 21:59:36 +02:00
Omar Emara
3a070122ea Fix #126998: Fog Glow is corrupt for large images
The Fog Glow Glare node produces corrupt images for large inputs in GPU
mode. That's due to a typo where the number of channels was declared as
a float as opposed to an integer, causing rounding errors in indexing
statements.
2024-10-03 13:20:53 +03:00
Campbell Barton
a9b977d256 Cleanup: sort CMake file lists 2024-10-03 14:46:26 +10:00
Alexandre Cardaillac
0315eae536 Cycles: Add more scattering phase functions
Previously, Cycles only supported the Henyey-Greenstein phase function for volume scattering.
While HG is flexible and works for a wide range of effects, sometimes a more physically accurate
phase function may be needed for realism.

Therefore, this adds three new phase functions to the code:
Rayleigh: For particles with a size below the wavelength of light, mostly athmospheric scattering.
Fournier-Forand: For realistic underwater scattering.
Draine: Fairly specific on its own (mostly for interstellar dust), but useful for the next entry.
Mie: Approximates Mie scattering in water droplets using a mix of Draine and HG phase functions.

These phase functions can be combined using Mix nodes as usual.

Co-authored-by: Lukas Stockner <lukas@lukasstockner.de>
Pull Request: https://projects.blender.org/blender/blender/pulls/123532
2024-10-02 11:12:53 +02:00
Omar Emara
db490e90fe Fix #127392: File Output doesn't write empty inputs
The File Output node doesn't write invalid and single value layers,
which can cause differences in EXR structures when rendering animations.

To fix this, we write a dummy image that has the same dimensions as the
other layers in the file, filled with the value of the single value
input.

Pull Request: https://projects.blender.org/blender/blender/pulls/128454
2024-10-02 10:28:55 +02:00
Campbell Barton
c6fd26a3f5 Cleanup: spelling in comments 2024-10-01 09:59:33 +10:00
quackarooni
44fbd69317 Function Node: Value to String Integer subtype
This patch adds an `Integer` type to the Value to String node.
This allows for converting integer inputs into string outputs without
any loss of precision. Something which the original implementation is
not able to do.

This issue becomes evident at values greater than `2 ^ 24` or
`16,777,216`, where the precision loss is high enough that the float
implementation starts skipping certain integers.

Pull Request: https://projects.blender.org/blender/blender/pulls/128362
2024-09-30 23:10:41 +02:00
Colin Basnett
22d78c5a8e Geometry Nodes: add Matrix Determinant node
Pull Request: https://projects.blender.org/blender/blender/pulls/128212
2024-09-30 21:30:10 +02:00
Jacques Lucke
8f30c25207 Geometry Nodes: add panel for generated geometry on foreach zone
The panel makes the separation of the main geometry and generated geometry
outputs more obvious.

Pull Request: https://projects.blender.org/blender/blender/pulls/128382
2024-09-30 21:28:20 +02:00
Jacques Lucke
f97fb87212 Cleanup: make utilities for node warnings more reusable 2024-09-30 21:18:08 +02:00
Jacques Lucke
ee348d2bff Fix: missing grease pencil data after duplicate elements or realizing instancecs 2024-09-30 18:31:36 +02:00
Jacques Lucke
f839266b78 Geometry Nodes: support dynamic sockets and separators in panels 2024-09-30 16:07:36 +02:00
Jacques Lucke
7b79191594 Geometry Nodes: prefer float math node even for integer sockets in link-drag-search
The problem with the Integer Math node is that it is less flexible in common
cases because the other input has to be an integer too. There is no simple way
to switch the node to be a Float Math node (yet), so better insert that
directly. Using the Integer Math node is a more explicit choice now.

Searching for e.g. `iadd` prioritizes the Integer Math node thanks to prefix
search.

Pull Request: https://projects.blender.org/blender/blender/pulls/128370
2024-09-30 15:44:26 +02:00
Jacques Lucke
675606cbce Fix: wrong enum type in integer math node 2024-09-30 15:40:27 +02:00
Jacques Lucke
fc2b9e3a6b Cleanup: deduplicate switch over socket types to create declarations 2024-09-30 15:39:11 +02:00
Jacques Lucke
267c40db66 Fix #128373: conditional socket visibility in Mesh Line node not working
This was broken by 8027720e51 because
we forget to update the label in the declaration.

This is now reverted for the Mesh Line node, because there is no way to
change the label in the declaration yet. A new patch can be created that properly
updates the Mesh Line node to use the declaration.
2024-09-30 14:54:22 +02:00
Jacques Lucke
d8319f6f50 Fix: Geometry Nodes: propagate gizmo values through muted nodes 2024-09-30 14:34:51 +02:00
Jacques Lucke
5163af816d Fix: Geometry Nodes: propagate edit data through foreach zone
Without this, gizmos don't work in some cases.
2024-09-30 14:14:22 +02:00
Jacques Lucke
1b31a44935 Geometry Nodes: support inverse evaluation for Integer Math node for gizmos 2024-09-30 14:00:32 +02:00
Omar Emara
412e07173f Fix #127243: Crash when viewing invalid images
Blender crashes when viewing invalid images in the compositor. That's
because cached images will not be null, but will be unallocated, so to
fix this, we check allocation status as well as nullptr in the image
node.
2024-09-30 14:42:47 +03:00
Iliya Katueshenock
117d4a51c3 Fix #128193: conditional socket visibility broken on Distribute Points on Faces node
Missed disabling of the sockets.

Pull Request: https://projects.blender.org/blender/blender/pulls/128214
2024-09-27 22:22:26 +02:00
Jacques Lucke
578fd9b10e Geometry Nodes: support grease pencil in Duplicate Elements node
This adds support for using the Duplicate Elements node on grease pencil on the
point, curve and layer domain.

Pull Request: https://projects.blender.org/blender/blender/pulls/128210
2024-09-27 21:54:19 +02:00
Jesse Yurkovich
04c5044e61 Fix: Hydra "Object" texture coordinates incorrectly set to "World"
Found by inspection but looks like a simple oversight.

Example images in PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/128223
2024-09-27 19:20:25 +02:00
Hans Goudey
98f0926825 Geometry Nodes: Node tools soft selection and sculpt mask support
Implements the design from #120318. The existing selection nodes now have
the ability to deal with float/soft selection. For meshes the soft selection
corresponds to the inverse of the sculpt mask attribute. In the future this
will likely be unified with edit mode selection a bit more which is why
this design was chosen compared to separating masking and selection.
Curves and point clouds already use a single selection attribute with
either data type.

Pull Request: https://projects.blender.org/blender/blender/pulls/126316
2024-09-27 14:39:01 +02:00