Commit Graph

104476 Commits

Author SHA1 Message Date
Hans Goudey
ece4b6e84d Cleanup: Remove unused functions
See 7b89a0a580, ae1b4a6a28
2023-11-08 10:18:37 +01:00
Werner, Stefan
b414187efb Build: Update OpenImageDenoise to 2.1.0
Major new feature in v2 is GPU support. This is not enabled yet,
this commit only changes the library version without enabling new
functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/112143
2023-11-08 10:12:05 +01:00
Sergey Sharybin
7b89a0a580 Cleanup: Mark unused arguments as such
Pull Request: https://projects.blender.org/blender/blender/pulls/114619
2023-11-08 09:44:58 +01:00
Jeroen Bakker
f76ceddc98 Vulkan: Workaround for Unsupported R8G8B8 Vertex Buffer Formats
On some platforms `VK_FORMAT_R8G8B8_*` are not supported as vertex buffers. The
obvious workaround for this is to use `VK_FORMAT_R8G8B8A8_*`. Using unsupported
vertex formats would crash Blender as it is not able to compile the graphics
pipelines that use them.

Known platforms are:
- NVIDIA Mobile GPUs (Quadro M1000M)
- AMD Polaris (open source drivers)

This PR adds the initial workings for other unsupported vertex buffer formats we
need to fix in the future.

`VKDevice.workarounds.vertex_formats` contain booleans if the workaround for
a specific format should be turned on (`r8g8b8 = true`). `VertexFormatConverter` can be
used to identify if conversions are needed and perform the conversion.

Pull Request: https://projects.blender.org/blender/blender/pulls/114572
2023-11-08 09:44:22 +01:00
Omar Emara
474b6fa070 Realtime Compositor: Support full precision compositing
This patch adds support for full precision compositing for the Realtime
Compositor. A new precision option was added to the compositor to change
between half and full precision compositing, where the Auto option uses
half for the viewport compositor and the interactive render compositor,
while full is used for final renders.

The compositor context now need to implement the get_precision() method
to indicate its preferred precision. Intermediate results will be stored
using the context's precision, with a number of exceptions that can use
a different precision regardless of the context's precision. For
instance, summed area tables are always stored in full float results
even if the context specified half float. Conversely, jump flooding
tables are always stored in half integer results even if the context
specified full. The former requires full float while the latter has no
use for it.

Since shaders are created for a specific precision, we need two variants
of each compositor shader to account for the context's possible
precision. However, to avoid doubling the shader info count and reduce
boilerplate code and development time, an automated mechanism was
employed. A single shader info of whatever precision needs to be added,
then, at runtime, the shader info can be adjusted to change the
precision of the outputs. That shader variant is then cached in the
static cache manager for future processing-free shader retrieval.
Therefore, the shader manager was removed in favor of a cached shader
container in the static cache manager.

A number of utilities were added to make the creation of results as well as
the retrieval of shader with the target precision easier. Further, a
number of precision-specific shaders were removed in favor of more
generic ones that utilizes the aforementioned shader retrieval
mechanism.

Pull Request: https://projects.blender.org/blender/blender/pulls/113476
2023-11-08 08:32:00 +01:00
Jesse Yurkovich
c6b5bb3d89 Merge branch 'blender-v4.0-release' 2023-11-07 18:31:59 -08:00
Jesse Yurkovich
8178b12af4 Windows: Remove wait for key-press in --debug mode
This was initially added a long time ago[1] to help with certain exit
behavior while running under a debugger. However, this shouldn't be
necessary any longer.

More importantly, tests have started to use the `--debug` option[2].
Somehow the bots are fine, but anyone running the tests locally on
Windows will experience what looks like a hang; unless they press a key
to allow the tests to continue.

[1] 1cc19c6993
[2] The `blendfile_versioning` test

Pull Request: https://projects.blender.org/blender/blender/pulls/114605
2023-11-08 03:30:42 +01:00
Germano Cavalcante
9410644795 Merge branch 'blender-v4.0-release' into main 2023-11-07 18:31:47 -03:00
Germano Cavalcante
7f89063161 Fix #114596: Face Nearest with steps sometimes breaks
When multiple steps are tested, we cannot depend on the distance
calculated for `nearest.dist_sq`, as it reduces with each step.
2023-11-07 18:30:53 -03:00
Gilberto Rodrigues
3fddfb48be Fix #114571: Retopology Overlay Face Color Regression
Fix #114571: Retopology Overlay Face Color Regression

Missed in dfd1b63cc7

Pull Request: https://projects.blender.org/blender/blender/pulls/114589
2023-11-07 21:43:01 +01:00
Brecht Van Lommel
fd60a0be38 Merge branch 'blender-v4.0-release' into main 2023-11-07 21:15:42 +01:00
Brecht Van Lommel
13b1d8d5e1 Fix build failure when WITH_USD=OFF and WITH_MATERIALX=ON 2023-11-07 20:57:35 +01:00
Brecht Van Lommel
7618d4a0ac Merge branch 'blender-v4.0-release' into main 2023-11-07 20:32:33 +01:00
Aras Pranckevicius
a70b42d1cd Cleanup: remove unused spherical harmonics functions
Looks like these were only used for CPU-based viewport shading
in pre-2.80 Blender. Which no longer exists.
2023-11-07 21:16:47 +02:00
Brecht Van Lommel
fb2f77d088 Fix macOS Python SSL still not using bundled certificate
The code from 5ac392ca4 did not work on macOS since WITH_INSTALL_PORTABLE
is not set there. This issue was hidden before, but now happens due to
the changes in #114569 to avoid using /etc/ssl.
2023-11-07 20:13:20 +01:00
Aras Pranckevicius
bdddb3b14e Cleanup: remove unused form_factor_ functions
Looks like these were only used for CPU-based ambient occlusion effect
in pre-2.80 Blender. Which no longer exists.
2023-11-07 21:11:25 +02:00
Aras Pranckevicius
13dbeac13c cleanup: remove "sa" acos/asin/sqrt functions and use "safe_" variants
Cleanup talked about in the previous semi-related PR, #114501

- saacos, saasin, sasqrt have been 100% identical to saacosf,
  saasinf, sasqrtf since 2012.
- For all the above, there exist more intuitively named safe_acosf,
  safe_asinf, safe_sqrtf that do the same thing, so switch all code to those.

Pull Request: https://projects.blender.org/blender/blender/pulls/114593
2023-11-07 19:49:01 +01:00
Miguel Pozo
7c68e9a94c Fix #114524: EEVEE-Next: Wrong normal map node result
The new draw manager stores the object scale as a regular flag.
Update `node_normal_map` to read it correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/114587
2023-11-07 18:58:31 +01:00
Omar Emara
ae739a6173 Fix #114530: Cryptomatte node not link drag searchable
The Cryptomatte node is not searchable in the link drag search operator.
That's because it still uses socket templates, which are no longer
supported for search since f5e6d4e4b0.

This patch fixes that by using the declare method instead of socket
templates.

Pull Request: https://projects.blender.org/blender/blender/pulls/114537
2023-11-07 18:44:56 +01:00
Aras Pranckevicius
b1c7b573c0 mesh: use faster acos() variant in normals calculation
Function                         Module   Inclusive Time  Exclusive Time
--------------------------------------------------------------------------
  mesh_render_data_update_normals  blender  297.51          0.00

  315 -> 297

acos() usage in all places related to normal calculations shows up in the
profiler. Given that "angle between faces" is only additional heuristic
weight in there (the effect of it at all is very subtle), approximate but
faster version of acos() might be just fine. Especially since some other
parts of Blender (e.g. mikktspace) use approximate acos in a conceptually
the same part.

- Adds safe_acos_approx() to BLI_math_base.hh. Implementation the same
  as already exists in Cycles; max error 0.00258 degrees. Between 2x and 4x
  faster in my tests.
- Changes all normals related calculations to use the function above instead
  of saacos.

Computing normals on a Stanford Lucy (14m verts) mesh:
- Mac (arm64, M1 Max): 247ms -> 229ms
- Win (x64, Ryzen 5950X): 276ms -> 250ms

All places that are about "normal calculation" were changed, including e.g.
Corrective Smooth modifier. Applying that one to the same 14m vertices mesh,
Mac M1 Max: 9.96s -> 9.76s

Tiny changes in several test output expectations w.r.t. normals are
observed, these were reviewed and updated expectations checked in svn.

Pull Request: https://projects.blender.org/blender/blender/pulls/114501
2023-11-07 18:22:17 +01:00
Damien Picard
7231ac0a52 I18n: extract and disambiguate a few messages
Extract:
- "Attribute", when creating a new attribute with
  `GEOMETRY_OT_attribute_add()`: make the default name in the operator
  a null string, and set it to "Attribute" translated inside an invoke
  method instead.
- Also for new attributes, from `BKE_id_attribute_calc_unique_name()`,
  for instance to create a default vertex color layer when going into
  Vertex Paint mode: use `DATA_()` instead of `IFACE_()`, since it
  represents user data.

Disambiguate:
- "Weight" can be the thickness of font glyphs.
- "Mark as Asset" and "Clear Asset" are operator names already
  extracted using the Operator context. They were recently added to a
  manual translation in the UI, but the existing one can be reused.
- "Second" as a time unit in the context of frame snapping.

Some messages reported by Satoshi Yamasaki in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/114159
2023-11-07 18:08:58 +01:00
Damien Picard
f48f901b3b I18n: translate socket properties in the Modifier Properties editor
Each node group asset exposes various properties through sockets.
Although they can generally be considered user-created data, for
built-in assets they are also part of the UI and should be
translated--especially since more modifiers should be migrated to
Geometry Nodes in the future.

This commit enables the translation of those properties in the
Modifier Properties editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/114256
2023-11-07 18:08:35 +01:00
Christoph Lendenfeld
1b95e74b8a Cleanup: comment style in animrig
No functional changes.

Functions moved to animrig recently did not adhere to
the comment style guidelines

Pull Request: https://projects.blender.org/blender/blender/pulls/114586
2023-11-07 17:24:36 +01:00
Christoph Lendenfeld
c8ccd3d58a Refactor: Rename functions in ANIM_animdata.hh
No functional changes.

Renaming the following functions
`ANIM_remove_empty_action_from_animdata` and
`ANIM_fcurve_delete_from_animdata`
to
`animdata_remove_empty_action` and
`animdata_fcurve_delete`

The `ANIM` prefix was no longer needed since the code is now in
a namespace. In order to make the function name consistent with
the functions in `fcurve.cc` the thing it modifies is now at the
start of the function name

Pull Request: https://projects.blender.org/blender/blender/pulls/114584
2023-11-07 17:03:29 +01:00
Christoph Lendenfeld
fc74f341a5 Refactor: Move code related to animdata to animrig
No functional changes.

Move the following functions
`ANIM_fcurve_delete_from_animdata` and
`ANIM_remove_empty_action_from_animdata`
to
`ANIM_animdata.hh` / `animdata.cc`
in animrig

This removes some includes to `ED_anim_api.hh`
from animrig

Pull Request: https://projects.blender.org/blender/blender/pulls/114581
2023-11-07 16:46:38 +01:00
Miguel Pozo
d64e9759ef Fix #114377: Workbench: Support None and Channel Packed alpha modes 2023-11-07 15:51:45 +01:00
Jason Fielder
05c56603a9 Fix #114192: Resolve animation player greying out on resize in Metal
Standalone animation player has inconsistent GPU context activation
paradigm compared with standard rendering paths. The Metal backend
utilises the context activation step to refresh target window swapchains
from within the GHOST module.

This PR adds activation and deactivation calls, and also aims to clean up
GPU_render_begin/end setup to ensure all paths are covered.

Also resolves a bug upon shutdown wherein GPU resources which may
be tied to a GPU context are released during IMB_exit(), which is called
after GPU context destruction.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/114573
2023-11-07 15:35:42 +01:00
Miguel Pozo
b4316445a8 EEVEE-Next: Add Max Displacement option
Add a Max Displacement option to Material settings, so frustum culling
can work correctly with vertex displacement.

Pull Request: https://projects.blender.org/blender/blender/pulls/114200
2023-11-07 15:28:07 +01:00
Christoph Lendenfeld
b2bdfe946e Fix: broken regression test fcurve_test.cc 2023-11-07 15:08:20 +01:00
Jeroen Bakker
73b15f341e Fix: Enable Vulkan Workarounds
Vulkan workarounds could not be enabled by using the
`--debug-gpu-force-workarounds` command line argument. This PR fixes
this.

Pull Request: https://projects.blender.org/blender/blender/pulls/114579
2023-11-07 14:59:28 +01:00
Jeroen Bakker
adb2164191 Draw: Add Region Info Debug Group
Adding a deug group for draw manager region info so it is easier
to find inside tools like renderdoc.

Pull Request: https://projects.blender.org/blender/blender/pulls/114578
2023-11-07 14:53:48 +01:00
Christoph Lendenfeld
69a3c5c7fc Refactor: move code related to fcurve keyframe insertion
No functional changes.

Move the functions
`insert_vert_fcurve` and
`insert_bezt_fcurve`
from `ED_keyframing.hh` / `keyframing.cc`
to `ANIM_fcurve.hh` / `fcurve.cc`
in animrig

Pull Request: https://projects.blender.org/blender/blender/pulls/114570
2023-11-07 14:33:52 +01:00
Campbell Barton
160111c318 Merge branch 'blender-v4.0-release' 2023-11-07 23:59:24 +11:00
Alexander Wilms
93278b55d4 Linux: Improve metainfo file
- Add OARS info, <url/> tags and screenshot captions
- Change metainfo file extension from the deprecated ".appdata.xml" to.
- Update bugtracker and help URL tags in metainfo file.
- The metainfo file is now installed.
- The file now passes flatpak validation.

Ref !114115
2023-11-07 23:56:55 +11:00
Christoph Lendenfeld
d08582c4d6 Cleanup: Remove unused declaration and include
No functional changes.
2023-11-07 13:20:46 +01:00
Christoph Lendenfeld
02b41a5d23 Refactor: Move code for actions into its own file
No functional changes.

Moving the following functions
`action_fcurve_ensure` and
`action_fcurve_find`
from
`ANIM_fcurve.hh`/`fcurve.cc`
to
`ANIM_action.hh`/`action.cc`

This is an effort to ensure that the fcurve files don't need to know
about the container they are stored in so we can swap out
the container more easily.

Pull Request: https://projects.blender.org/blender/blender/pulls/114575
2023-11-07 13:17:43 +01:00
Bastien Montagne
869372ffc3 Fix (studio-reported) VSE crash when deleting strips.
Caused by 3fccfe0bc6 again, no idea why these two VertorSet were defined
as static variables in the functions generating them... But this was for
sure calling for _lots_ of problem. There are almost never good cases
for a function to return a static variable, and if it's done, it has to
be done extremely carefully.
2023-11-07 12:49:09 +01:00
Bastien Montagne
67dda08dea VSE: Cleanup: Simplify code in iterator by de-duplicating logic.
No reason to do the same exact thing in two different functions.
2023-11-07 12:22:11 +01:00
Bastien Montagne
9ecd106307 Fix (unreported) VSE crash when duplicating 4 or more strips.
Regression caused by typo in 3fccfe0bc637...
2023-11-07 11:35:44 +01:00
Hans Goudey
17b875fccf Fix: Windows build error from missing template argument deduction 2023-11-07 11:19:43 +01:00
Bastien Montagne
2f8499415b Fix (studio-reported) VSE crash when Text strips use missing fonts.
BLF code is not threadsafe, yet font loading gets called over and over
by text strips when the font file is missing, including e.g. from
depsgraph evaluation code when duplicating the strip for evaluation.

WARNING: This is a quick fix for deblocking the Blender studio, proper
fix (and report) still needs to be worked on.
2023-11-07 11:06:13 +01:00
Julian Eisel
ecbb77c558 UI: Support dragging over node panel headers to batch (un)collapse
Makes it possible to swipe over panel header to batch open/collapse all
panels the mouse draged over. Normal panels and sub-panels support this
too.

Two changes were needed:
- Support "drag toggle" feature for `UI_BTYPE_BUT_TOGGLE` - all toggle
  buttons should/can support this.
- Allow querying the pushed state from the button used for the
  collapsing. Multiple ways to do this, in this case simply using the
  pushed state query callback seemed simplest.

Pull Request: https://projects.blender.org/blender/blender/pulls/114560
2023-11-07 10:59:33 +01:00
Christoph Lendenfeld
a338ecb9cb Refactor: fcurve.cc
No functional changes.

Improve the readability of the code by

* returning early where possible
* moving variables closer to where they are used
* renaming variables

Pull Request: https://projects.blender.org/blender/blender/pulls/114568
2023-11-07 10:53:43 +01:00
Philipp Oeser
1699163feb Merge branch 'blender-v4.0-release' 2023-11-07 10:12:07 +01:00
Philipp Oeser
0eb279de54 Fix #66286: DblClick to rename UIList items within a popover not working
Looks like most of `ui_apply_but_XXX` or `ui_do_but_XXX` functions rely
on `uiHandleButtonData` (and not necessarily context).

Now the problem from a popover in `ui_but_list_row_text_activate` was
that the label button to be set in BUTTON_ACTIVATE_TEXT_EDITING for
renaming could not be found because it was using the "wrong" region from
context (`CTX_wm_region` - which still seem to point to the region the
popover was spawned from). The correct region is available in
`uiHandleButtonData` though, so now use this instead.

Not totally sure if `CTX_wm_region` should actually be correct in all
cases - which would hint at an underlying problem of not setting it
right - but since other functions rely on `uiHandleButtonData` as well,
this fix seems to make sense.

Fix should go into LTS I think.

Pull Request: https://projects.blender.org/blender/blender/pulls/114363
2023-11-07 10:11:30 +01:00
Hans Goudey
ae1b4a6a28 Cleanup: Consolidate draw attribute extraction
Use the same attribute conversion class for PBVH and regular
mesh attribute extraction. This makes the GPU formats we use
for each attribute type more explicit and centralizes the conversions
from the attribute types to the GPU types. It's also a bit more aligned
to how we could use implicit sharing for GPU vertex buffer data.

Unfortunately it isn't possible to use this same code for curves
and point clouds because they use textures for their evaluated data,
and 3-wide vectors (e.g. `float3`) aren't supported on GPUs with our
current texture abstraction. For generic attributes, the long term
approach will probably be to use an SSBO instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/114340
2023-11-07 10:05:13 +01:00
Hans Goudey
15f1fe5ddb Cleanup: Add missing includes to node anonymous attribute header 2023-11-07 09:50:51 +01:00
Jeroen Bakker
b56382b38a Cleanup: Make format 2023-11-07 08:04:17 +01:00
Jason Fielder
bbb71f0859 Metal: Ensure pending MTLSafeFreeList is released on shutdown
Ensure that on closing of the application, all pending
SafeFreeLists are released. A new change to ensure
release of SafeFreeLists was always deferred until
full completion of GPU buffers meant that a pending
MTLSafeFreeList container may not be released on
shutdown.

This change ensures that the container is fully
destructed on final shutdown.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/114532
2023-11-07 07:53:20 +01:00
Alaska
d6cafda3bb Fix #114491: Incorrect HDR tooltip
Mention that AgX also doesn't produce HDR information for the
HDR display feature on macOS.

Pull Request: https://projects.blender.org/blender/blender/pulls/114502
2023-11-07 07:45:36 +01:00