Commit Graph

101767 Commits

Author SHA1 Message Date
Clément Foucault
5ac026c23a EEVEE-Next: Irradiance Volume validity weighting
This avoid samples inside walls to contribute to
the interpolated lighting. This help preventing
light leaking.

Pull Request: https://projects.blender.org/blender/blender/pulls/110851
2023-08-06 13:43:17 +02:00
Campbell Barton
8b8fe49d34 License headers: add SPDX-FileCopyrightText 2023-08-06 18:59:05 +10:00
Campbell Barton
845a5146e7 Cleanup: avoid term '_len' for buffer size 2023-08-06 16:09:04 +10:00
Campbell Barton
9e3dc02bed Cleanup: naming consistency for find functions
- find_from_name -> find_by_name.
- find_from_index -> find_index.

This matches naming used elsewhere in Blender API's.
2023-08-06 15:57:24 +10:00
Campbell Barton
0701c65d93 Cleanup: use DNA_struct_default_alloc utility function, doxy section 2023-08-06 15:47:50 +10:00
Clément Foucault
d870f9e841 EEVEE-Next: Add back visibility group for irradiance volumes 2023-08-05 20:23:38 +02:00
Clément Foucault
46a17df415 Fix EEVEE-Next: Incorrect Irradiance Volume sorting
`world_to_grid_transposed` contains the resolution of
the grid and is also transposed which isn't what we
need for computing the volume.
2023-08-05 19:47:16 +02:00
Campbell Barton
b879a4f2d8 Cleanup: replace MEM_callocN with MEM_mallocN when overwritten afterward
Also pair allocation with memcpy calls.
2023-08-05 20:06:42 +10:00
Jacques Lucke
9150f6d1a9 BLI: refactor string search to use C++ API
The API becomes much simpler by using C++. Also, it removes the need
for manual memory management.

Pull Request: https://projects.blender.org/blender/blender/pulls/110826
2023-08-05 10:54:23 +02:00
Jacques Lucke
b41c6489bc Cleanup: set node struct ui names at run-time
The goal is to get to closer to removing `NOD_static_types.h` and to define all/most
aspects of a node in the node file itself instead. Data defined in node files is not
available when rna structs are created currently, because that happens in a preprocessing
step. This patch moves part of what was defined in `rna_nodetree.cc` to `node.cc` which
makes it easier to replace when `NOD_static_types.h` is removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/110824
2023-08-05 09:12:27 +02:00
Jacques Lucke
4719caf660 Cleanup: move BLI_string_search.h to C++ 2023-08-05 08:52:29 +02:00
Jacques Lucke
607d203b98 Cleanup: fix compilation errors and warnings 2023-08-05 08:31:31 +02:00
Campbell Barton
a81063e4a1 Cleanup: use const mtex for TexCallData & multitex_* functions 2023-08-05 14:26:29 +10:00
Campbell Barton
bf2b1f7e01 Cleanup: simplify enum typedefs 2023-08-05 14:22:48 +10:00
Campbell Barton
a86ef5d3f6 Cleanup: minor changes to logic that shows render window
- Rename find_area_showing_r_result -> *find_area_showing_render_result.
- Only set the return window argument when the render area is found
  instead of leaving this value set to the last window.
- Use doxygen sections.
2023-08-05 14:05:43 +10:00
Campbell Barton
9ea8477c23 Cleanup: various non-functional C++ changes 2023-08-05 13:57:29 +10:00
Campbell Barton
7f34ad736a Cleanup: spelling in comments 2023-08-05 13:54:25 +10:00
Hans Goudey
07019e7ef5 Cleanup: Remove more struct keywords from C++ headers 2023-08-04 22:47:29 -04:00
Campbell Barton
7e06454663 Fix build error from references to unknown types 2023-08-05 12:23:01 +10:00
Hans Goudey
88de2f25ed Cleanup: Remove unnecessary struct keyword from editors includes 2023-08-04 22:15:25 -04:00
Hans Goudey
ffe4fbe832 Cleanup: Move editors headers to C++
See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/110820
2023-08-05 02:57:52 +02:00
Hans Goudey
c15d391e86 Cleanup: Various cleanups in newly C++ headers
Mostly remove unnecessary struct and typedef keywords.
Move a few more small wm headers to C++ as well.
2023-08-04 17:55:14 -04:00
Hans Goudey
bc8c892c65 Cleanup: Move WM headers to C++
Also move a few more headers that included WM headers.

Pull Request: https://projects.blender.org/blender/blender/pulls/110815
2023-08-04 23:11:22 +02:00
Hans Goudey
aa5b142e98 Cleanup: Move fsmenu.c to C++
See #103343

Co-authored-by: Ray Molenkamp <github@lazydodo.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/110797
2023-08-04 22:15:03 +02:00
Jacques Lucke
f18c45eb69 Cleanup: avoid using NOD_static_types.h for creating the node.type enum
The overall goal is to get rid of `NOD_static_types.h`. This patch removes
one usage of it to generate the `node.type` rna enum. Not all of the data
was available on `bNodeType` already, so I had to add the missing data there.

Pull Request: https://projects.blender.org/blender/blender/pulls/110810
2023-08-04 21:43:54 +02:00
Hans Goudey
9909bf60c9 Fix: Missing updates for geometry node group tool properties
Mistake in fd9d22ba57
2023-08-04 15:30:04 -04:00
Hans Goudey
e3e6fb8ecf Geometry Nodes: Initial tool-specific nodes
Add three new nodes for operations and inputs specific to
node group operators.
- **Selection** Whether elements are selected in the viewport
- **Set Selection** Sets the edit/sculpt selection, on the point,
  face, or curve domains
- **3D Cursor** Gives the location and rotation of the 3D cursor,
  in the local space of the modified object.
- **Face Set** The face set value from mesh sculpt mode,
  and whether the attribute exists.
- **Set Face Set** Set sculpt face set values.

In the add menu and search, the nodes are only visible in the
"Tool" context of the geometry node editor. They also give
errors when executed by a modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/109517
2023-08-04 20:59:04 +02:00
Alexander Gavrilov
9921c3532c Custom Data: make get_layer_index_n always safely handle n overrun.
This function is used to retrieve the index of the n'th layer of
the specified type, if it exists. Currently the way it handles
an n value that is too big is inconsistent: if there are more
layers of different types following the ones of the correct type,
and n isn't too big, it will safely detect that the corresponding
layer is of a different type and return -1. However, if the value
results in a buffer overrun, it causes an assertion or crash.

This means that safe code should currently ensure n is always
correct, making the type check in this function pointless.
Moreover, checking the range in the caller may incur more
overhead than making this code safe.

This changes the assert into a check to ensure consistent behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/110812
2023-08-04 20:40:05 +02:00
Hans Goudey
85bac9d292 Fix: Node group operators reset mesh select mode 2023-08-04 14:30:26 -04:00
Hans Goudey
e0efc234c8 Cleanup: Small improvements to Hydra mesh and curves export
- Use threadsafe normal computation (will be improved more in #93551)
- Copy data directly instead of loops when format is the same
- Use bke::CurvesGeometry wrapper and attribute API
- Avoid `push_back` when size is known ahead of time
2023-08-04 13:59:22 -04:00
Hans Goudey
66dd1657b8 Cleanup: Use const for Blender data in Hydra exporter
As a render engine, this code generally shouldn't modify Blender data.
const helps to use the type system to enforce that.
2023-08-04 13:42:51 -04:00
Hans Goudey
39c3a86d8e Cleanup: Make object material count function take a const pointer 2023-08-04 13:42:51 -04:00
Hans Goudey
f97a51350d Cleanup: Make mesh normal calculation function const
Since this outputs to a separate array and not a custom data layer,
it actually doesn't change the mesh (after 580833165c anyway).
2023-08-04 13:42:51 -04:00
Jacques Lucke
81096abe2a Fix: simulation outputs empty geometry when going to frame zero
Previously, simulation nodes would output default values when there is no
current simulation state and nothing should be computed. Now, the data is
just passed through which is usually less confusing.

Pull Request: https://projects.blender.org/blender/blender/pulls/110800
2023-08-04 19:34:35 +02:00
Jacques Lucke
9c72199258 Cleanup: simplify usage of NOD_static_types.h in rna
There were a bunch of duplicated usages of `NOD_static_types.h` in
`rna_nodetree.cc`. This patch reduces the duplication, making it easier
to reason about what is going on.

Pull Request: https://projects.blender.org/blender/blender/pulls/110805
2023-08-04 18:48:16 +02:00
Jacques Lucke
ab39386aec Cleanup: remove dead node tree rna code
This code seems to be dead since forever (wasn't used
in 4638e5f99a either.
2023-08-04 18:35:40 +02:00
Hans Goudey
fd9d22ba57 Geometry Nodes: Operators: Support more object types and modes
Add support in the UI for the edit mode of curves, mesh, and point
cloud objects. It's possible to control for which mode sand object
types the asset is available with a dropdown in the node header.
To make this per-mode filtering possible, the static asset tree
cache is now unique per context mode.

See #101778

Pull Request: https://projects.blender.org/blender/blender/pulls/109526
2023-08-04 18:22:45 +02:00
Jacques Lucke
d5eb51e911 Cleanup: make versioning_260.cc independent of NOD_static_types.h
The eventual goal is to get rid of `NOD_static_types.h` because that data should
be decentralized so that nodes can be more self-contained.

The switch cases are based on the state of `NOD_static_types.h` when the
versioning code was introduced in 4638e5f99a.

Pull Request: https://projects.blender.org/blender/blender/pulls/110804
2023-08-04 18:18:22 +02:00
Miguel Pozo
2f6af7a4b9 EEVEE Next: Fix: Normal RenderPass viewport display flicker
The active display should always be rendered,
even if the current sample doesn't write to it.
2023-08-04 18:15:38 +02:00
Hans Goudey
4395e0da93 Fix: Geometry nodes self object crash in node operator 2023-08-04 11:03:21 -04:00
Brecht Van Lommel
83fa353efc Hydra: add option to export through USD file instead of Hydra API
This is currently meant mainly for testing, when "Developer Extras" is
enabled. The goal is to make interactive Hydra export and USD file export
identical. We are not there yet, and having the ability to compare both
in the viewport and automated tests should help us get and stay there.

Ref #110765
2023-08-04 17:01:09 +02:00
Bogdan Nagirniak
04bb5f9995 Render: support USD Hydra render delegates
Hydra is a rendering architecture part of USD, designed to abstract the
host application from the renderer. A renderer implementing a Hydra
render delegate can run in any host application supporting Hydra, which
now includes Blender.

For external renderers this means less code to be written, and improved
performance due to a using a C++ API instead of a Python API.

Add-ons need to subclass bpy.types.HydraRenderEngine. See the example in
the Python API docs for details.

An add-on for Hydra Storm will be included as well. This is USD's
rasterizing renderer, used in other applications like usdview. For users
it can provide a preview of USD file export, and for developers it
serves a reference.

There are still limitations and missing features, especially around
materials. The remaining to do items are tracked in #110765.

This feature was contributed by AMD.

Ref #110765

Co-authored-by: Georgiy Markelov <georgiy.m.markelov@gmail.com>
Co-authored-by: Vasyl-Pidhirskyi <vpidhirskyi@gmail.com>
Co-authored-by: Brian Savery <brian.savery@gmail.com>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/104712
2023-08-04 17:01:09 +02:00
Bogdan Nagirniak
61f407d427 Build: install USD Storm and MaterialX libraries by default
* Bundle hdStorm and associated plugins
* Enable WITH_MATERIALX by default to bundle MaterialX libraries
* Set PXR_MTLX_STDLIB_SEARCH_PATHS so Storm can find MaterialX files

Co-authored-by: Georgiy Markelov <georgiy.m.markelov@gmail.com>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Ref #110765, #104712
2023-08-04 17:01:09 +02:00
Brecht Van Lommel
efe10cee5c Cleanup: compiler warning with clang 2023-08-04 17:01:09 +02:00
Jacques Lucke
ba1e88bffc Fix: simulation with no-cache resets when changing property
The simulation used to reset when the previously computed frame is the
same as the current one. However, in this case the output should just be
the same as in the previous computation.

Pull Request: https://projects.blender.org/blender/blender/pulls/110799
2023-08-04 16:59:56 +02:00
Miguel Pozo
a5e62537a5 Fix: Compilation error after 41c83d6cfc 2023-08-04 16:50:53 +02:00
Miguel Pozo
ff470f3f2e EEVEE Next: Volumes
Port of EEVEE unified volume rendering to EEVEE Next, using compute
shaders.

Improvements:
- Skip empty volume outside object bounds. (Large performance
  increase)

Currently missing:
- Shadows and irradiance integration.
- Grid-space TAA.

Main Task: #105672

Pull Request: https://projects.blender.org/blender/blender/pulls/107176
2023-08-04 16:47:16 +02:00
Miguel Pozo
41c83d6cfc EEVEE Next: Sculpt support
Add sculpt support to EEVEE Next.

It creates a new resource handle for sculpt object, since
BKE_object_boundbox_get returns a wrong (zeroed) bounding box.

This also adds a new `resource_handle` function to the `draw::Manager`
that works like the default one, but lets the caller optionally override the
object matrix and/or bounds.

Pull Request: https://projects.blender.org/blender/blender/pulls/110703
2023-08-04 16:38:04 +02:00
Jacques Lucke
ada738ac7c Fix: temperature attribute in eevee is divided by three
This fixes the eevee part of #110716.
Cycles still outputs zero which is the same issue as in #87494.

Pull Request: https://projects.blender.org/blender/blender/pulls/110768
2023-08-04 16:37:21 +02:00
Weizhen Huang
c36eccfae9 Nodes: Copy socket values with the same identifier instead of name
`identifier` should be a better measure than `name` to check if a socket
has the same meaning among different nodes. Sometimes two sockets can
have the same name in the UI but have different (physical) meanings,
they can specify different identifiers to avoid the values being copied
when the nodes are replaced.

Pull Request: https://projects.blender.org/blender/blender/pulls/110792
2023-08-04 16:32:33 +02:00