Commit Graph

134350 Commits

Author SHA1 Message Date
YimingWu 3689dfca4f GPv3: Build Modifer migration
Reimplemented build modifier using the new `CurvesGeometry` logic.

Pull Request: https://projects.blender.org/blender/blender/pulls/118739
2024-03-20 13:28:28 +01:00
Pratik Borhade c250b4bd51 Merge branch 'blender-v4.1-release' 2024-03-20 17:27:43 +05:30
Jacques Lucke 1fadf2251f Nodes: align functions to check if socket type supports fields or grids 2024-03-20 12:55:49 +01:00
Pratik Borhade f99939e2ff Cleanup: Remove redo panel drawing code of graph select handle
Since there is no special case for drawing redo panel, this callback is
not required. Panel will be generated automatically because `undo` and `register`
flags are added to operator.
This improves alignment in redo panel.

Pull Request: https://projects.blender.org/blender/blender/pulls/119494
2024-03-20 12:55:13 +01:00
Jacques Lucke 25a10c211f Nodes: support accessing socket type directly from declaration
Previously, we haven't added this because there were plans to use these
declarations at a higher abstraction level where one declaration potentially
contains more than one socket. This hasn't happened yet, and we are also using
other ways to achieve dynamic socket amounts (using dynamic declarations).
Therefore, it is reasonable to simplify the code by storing the integer socket
type in the declaration directly.

Pull Request: https://projects.blender.org/blender/blender/pulls/119691
2024-03-20 12:37:37 +01:00
Jacques Lucke 7447666c85 Merge branch 'blender-v4.1-release' 2024-03-20 11:48:42 +01:00
Jacques Lucke 067daec270 Nodes: don't use combined input/output sockets in node tree interface
Those shouldn't really exist at all currently, since we forbid them in 354915cf3c.
Unfortunately, not all cases were removed, and many node trees with such sockets
have been created during the development of 4.1 due to the auto-smooth changes.

I'm not entirely sure if it's still possible to properly remove them now. The commit
above mentions that we might lose links due to changed identifiers. Maybe we're
better off just supporting these inlined sockets while also allowing the "align with
previous socket" functionality.

Either way, not creating more of such node trees for now is reasonable, since we
explicitly disabled that functionality for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/119654
2024-03-20 11:26:07 +01:00
Thomas Dinges 31eaa2f5ba Merge branch 'blender-v4.1-release' 2024-03-20 08:38:41 +01:00
Jason Fielder 3c25b079ce Fix #109739: Resolve greyed out UI on MacOS
UI would sometimes disappear with the Metal backend.
This occured in situations where there was only a single
GPUContext within a single GHOST window, meaning
the activation routine for the context was never run.

Context activation is required to ensure the backbuffer
was up to date upon resize. Otherwise, re-sizing the
window would cause the screen to turn grey as the
new drawables would not be rendered to.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/119299
2024-03-20 08:33:29 +01:00
Campbell Barton 0b13d1f31a Extensions: suppress noisy "bl_info" prints unless --debug-python is set
Ref !119521
2024-03-20 15:43:40 +11:00
Campbell Barton 3135e766ec Cleanup: replace UI_MAX_NAME_STR with BKE_ST_MAXNAME
Since [0] some comments referencing UI_MAX_NAME_STR were incorrect.
Also correct buffer size for preview_id in uiTemplatePreview so newly
created names are guarantee to be the correct size.

[0]: a180314ac5
2024-03-20 15:14:08 +11:00
Campbell Barton ee64778cac Cleanup: code-comments for struct ID's and use backtick quotes
- Prefix comments before members is used practically everywhere,
  remove C99 syntax from inside comments.
- Replace double quotes with backticks for code styling.
2024-03-20 14:43:35 +11:00
Campbell Barton 729949669e Fix #114667: UI List search broken when class names >32 chars
The list identifier includes the class name and an list_id,
see: WM_uilisttype_to_full_list_id

This requires using UI_MAX_NAME_STR (as noted in doc-string).
2024-03-20 14:41:56 +11:00
Sean Kim 130ce5f53d Cleanup: Remove redundant function prefixes in sculpt_trim.cc
This PR strips the `sculpt_gesture_trim` prefix and other similar
prefixes from the `sculpt_trim.cc` code, as it is already contained
within the `blender::ed::sculpt_paint::trim` namespace.

Pull Request: https://projects.blender.org/blender/blender/pulls/119680
2024-03-20 03:41:21 +01:00
Campbell Barton 9edb2784da Fix #117320: UV Sync-select selects faces instead of just edges 2024-03-20 13:39:43 +11:00
Campbell Barton 9b4683fe0a Tests: update scripts to include SPDX headers 2024-03-20 12:28:33 +11:00
Campbell Barton 4ed06c648d Fix #119664: Persistent state not set when disabling add-ons
The wrong persistent attribute was set when disabling an add-on,
also correct the message when disabling an already disabled add-on.
2024-03-20 11:56:25 +11:00
Aaron Carlisle 49cd05020c Docs: Python API: Update the version switch to match the user manual
Not quite a 1:1 match, some customizations have to be made for the API URL differences and the face that there are no translations.

This also enables the version switch publicly now that this change fixes a few bugs.
2024-03-19 20:51:49 -04:00
Sean Kim e53d4e423e Cleanup: Convert sculpt_trim.cc to enum class
This PR converts the three `enum` definitions to `enum class` in sculpt_trim.cc

Pull Request: https://projects.blender.org/blender/blender/pulls/119679
2024-03-19 22:38:25 +01:00
Hik 2d49cc597f Fix #119275: Update Sidebar Values with Voxel Size Changes
Add notifier when changing sculpt voxel size so that the new value is
shown in the sidebar.

Pull Request: https://projects.blender.org/blender/blender/pulls/119646
2024-03-19 20:57:28 +01:00
Hans Goudey 76c5587531 Cleanup: Rename mesh render SortedFaceData fields
Try to add a bit more clarity and use more consistent wording.
2024-03-19 15:14:35 -04:00
Hans Goudey 9fe2e34833 Cleanup: Rename MeshRenderData variables
Use more standard _num suffix and standard mesh variable names.
2024-03-19 15:00:58 -04:00
Jacques Lucke 82f434f444 Nodes: cleanup node declaration finalization
* Extract function for building anonymous attribute references.
* Use is-function-node state directly during building instead of during finalization.

Pull Request: https://projects.blender.org/blender/blender/pulls/119677
2024-03-19 19:54:27 +01:00
Hans Goudey 3641b4b884 Fix #119586: Vertex paint mode crash after converting color attribute
Converting a color attribute to a non-color domain or type causes vertex
paint mode to try to change the attribute even though it's unsupported.
That leads to a crash here and unpredictable behavior elsewhere.

This PR modifies some poll functions to check for the proper domain and
data type before continuing. Even if converting an attribute properly
updates the active color attribute, we can still run into situations where
the active name references an attribute with incorrect metadata.

Pull Request: https://projects.blender.org/blender/blender/pulls/119657
2024-03-19 19:49:00 +01:00
Clément Foucault 787818d21d EEVEE-Next: Fix shader compilation error caused by resource macro 2024-03-19 19:23:17 +01:00
Clément Foucault 23dce15f67 EEVEE-Next: Horizon Scan: Use Spherical harmonics
This uses Spherical Harmonics to store the indirect lighting and
distant lighting visibility.

We can then reuse this information for each closure which divide
the cost of it by 2 or 3 in many cases, doing the scanning once.

The storage cost is higher than previous method, so we split the
resolution scaling to be independant of raytracing.

The spatial filtering has been split to its own pass for performance
reason. Upsampling now only uses 4 bilinearly interpolated samples
(instead of 9) using bilateral weights to avoid bleeding.

This also add a missing dot product (which soften the lighting
around corners) and fixes the blocky artifacts seen at lower
resolution.

Pull Request: https://projects.blender.org/blender/blender/pulls/118924
2024-03-19 19:16:21 +01:00
Clément Foucault 893430a2c7 EEVEE-Next: Add correct support for volume anisotropy from probe volumes
This adds the approximation of phase function convolution
of the distant lighting captured inside probe volumes.

This is based on a publication at siggraph from Bartlomiej Wronsky
"Volumetric Fog: Unified compute shader based solution to
atmospheric scattering"

Implementation is quite straightforward. However this isn't as
good as one can expect as there isn't self shadowing from the
volume themself, so the lighting is still quite flat.

To fix this, we have to add support for volumetrics inside
probe volumes baking. But this approach would still be static
so a more general solution is still to be found for dynamic
volumes like smoke simulations.

Pull Request: https://projects.blender.org/blender/blender/pulls/119479
2024-03-19 19:01:05 +01:00
Weizhen Huang a2bb547b9a Fix: Cycles spot light spread sampling not considering non-uniform scaling
For spherical spot light, when the shading point is close to the light
source, we switch to sampling the light spread instead of the visible
cone from the shading point. This has the benefit of less noise when the
spread is small.
However, the light spread sampling was not considering non-uniform
object scaling, where the actual spread might be different.
This patch switches sampling method only when the smallest enclosing
spread cone is smaller than the visible cone from the shading point.

An alternative method would be to compute the actual solid angle of the
scaled cone, and sample from the scaled cone. However, that involves
ray transformation and modifying the sampling pdf and angle. Since
non-uniform scaling is rather a niche case, it's probably not worth the
computation effort.

Pull Request: https://projects.blender.org/blender/blender/pulls/119661
2024-03-19 18:55:35 +01:00
Weizhen Huang a6fba7b59d Cleanup: Cycles: remove unnecessary storage of the spot light axes 2024-03-19 18:55:34 +01:00
Amine Bensalem 1e478cf169 Fix #118137: Symmetry buttons on-click state change
Buttons for mesh symmetry on the toolbar, and other buttons of the same
functionality located in other areas of the window, weren't updated when
clicking on them.

Pull Request: https://projects.blender.org/blender/blender/pulls/118508
2024-03-19 18:49:40 +01:00
Jacques Lucke b99c1abc3a BLI: speedup memory bandwidth bound tasks by reducing threading
This improves performance by **reducing** the amounts of threads used for tasks
which require a high memory bandwidth.

This works because the underlying hardware has a certain maximum memory
bandwidth. If that is used up by a few threads already, any additional threads
wanting to use a lot of memory will just cause more contention which actually
slows things down. By reducing the number of threads that can perform certain
tasks, the remaining threads are also not locked up doing work that they can't
do efficiently. It's best if there is enough scheduled work so that these tasks
can do more compute intensive tasks instead.

To use this new functionality, one has to put the parallel code in question into
a `threading::memory_bandwidth_bound_task(...)` block. Additionally, one also
has to provide a (very) rough approximation for how many bytes are accessed. If
the number is low, the number of threads shouldn't be reduced because it's
likely that all touched memory can be in L3 cache which generally has a much
higher bandwidth than main memory.

The exact number of threads that are allowed to do bandwidth bound tasks at the
same time is generally highly context and hardware dependent. It's also not
really possible to measure reliably because it depends on so many static and
dynamic factors. The thread count is now hardcoded to 8. It seems that this many
threads are easily capable of maxing out the bandwidth capacity.

With this technique I can measure surprisingly good performance improvements:
* Generating a 3000x3000 grid: 133ms -> 103ms.
* Generating a mesh line with 100'000'000 vertices: 212ms -> 189ms.
* Realize mesh instances resulting in ~27'000'000 vertices: 460ms -> 305ms.

In all of these cases, only 8 instead of 24 threads are used. The remaining
threads are idle in these cases, but they could do other work if available.

Pull Request: https://projects.blender.org/blender/blender/pulls/118939
2024-03-19 18:23:56 +01:00
Brecht Van Lommel c12ac94520 Cleanup: make format 2024-03-19 18:20:23 +01:00
Bartosz Kosiorek 18340fa057 UI: Extend description of Grid, Cube, UV Sphere and Ico Sphere
Pull Request: https://projects.blender.org/blender/blender/pulls/119331
2024-03-19 18:19:19 +01:00
Brecht Van Lommel d03f701ae5 Merge branch 'blender-v4.1-release' 2024-03-19 18:16:12 +01:00
Brecht Van Lommel ab9f9930b5 Cycles: Allow enabling OIDN for HIP with environment variable
Using the existing OIDN_DEVICE_HIP, don't overwrite it if it was
already set.

Ref #115045

Pull Request: https://projects.blender.org/blender/blender/pulls/119672
2024-03-19 18:14:28 +01:00
Clément Foucault f646f4c2b4 EEVEE-Next: Refactor world spherical harmonic extraction
This uses parallel reduction when doing the octahedral map re-mapping.

The goal is not the speedup but the accuracy of the computation (temporal
stability) and to pave the way for sunlight extraction.

This weight each individual samples using texel solid angle for correct
energy.

After optimization, the cost is not so expensive (1024px² octahedral map):
- new: 263µs remap + 12µs sum
- old: 75µs remap + 180µs irradiance update

We could optimize it more, but that feels unecessary given that the first
two filter pass are 7ms and a more pressing optimization.

The old irradiance update was fast because it was using the mip2 which
was already pre-filtered and using way less pixels (which already yield a
temporally stable output).

This new implementation does consider all pixel in the LOD0 which will
allow for more precise sunlight extraction.

This also comes with a cleanup of the update tagging.

Pull Request: https://projects.blender.org/blender/blender/pulls/119537
2024-03-19 18:10:24 +01:00
Brecht Van Lommel f20d9fe5a5 Merge branch 'blender-v4.1-release' 2024-03-19 18:05:33 +01:00
Brecht Van Lommel f771a8563b Fix #110751: Crash baking grease pencil line art
Ensure depsgraph tag happens when strokes are cleared, otherwise the
next depsgraph evaluation tries to use freed stroke data.

Pull Request: https://projects.blender.org/blender/blender/pulls/119662
2024-03-19 17:59:19 +01:00
Sean Kim 9b5b1f525f Cleanup: Limit sculpt gesture RNA operator properties
This PR limits adding the RNA property `use_limit_to_segment`
to `ShapeType::Line` based sculpt gesture operators, as the
property is inapplicable for the other two types.

Pull Request: https://projects.blender.org/blender/blender/pulls/119670
2024-03-19 17:32:59 +01:00
Falk David 0177c55880 Fix: Curves: Missing check in `get_mutable_attribute`
Same as fd92647f34.
Without this check, the function would try to create a new
attribute even if `num` was 0.
2024-03-19 17:09:41 +01:00
Thomas Dinges 4b0ad27d88 Extern libs: Remove info to update THIRD-PARTY-LICENSES
This file is generated by the attribution builder for every release
and it's up to the release team to check the log for extern and others to make sure this is up to date.
2024-03-19 17:06:31 +01:00
Hans Goudey 803c783e52 Merge branch 'blender-v4.1-release' 2024-03-19 11:59:26 -04:00
Hans Goudey 62b484544a Fix: Operator depends on cursor ignores macro operators
The change in 23ebc45f70 was slightly incorrect.
2024-03-19 11:58:46 -04:00
Hans Goudey cc0e015a35 Fix #119177: False positive dyntopo attribute detection warning
".sculpt_mask" is handled as a special case for dynamic topology
but wasn't detected that way in the warning.

Pull Request: https://projects.blender.org/blender/blender/pulls/119665
2024-03-19 16:55:21 +01:00
Thomas Dinges 2090ba8b07 Merge branch 'blender-v4.1-release' 2024-03-19 16:47:14 +01:00
Aras Pranckevicius a05adbef28 BLF: optimizations and fixes to font shader
Simplifies/optimizes the "font" shader. It runs faster now too, but primarily
this is so that it loads/initializes faster.

* Instead of doing blur via individual bilinear samples (where each sample is 4
  texel fetches), do raw texel fetches of the kernel footprint and compute final
  result by shifting the kernel weights according to bilinear fraction weight.
  For 5x5 blur, this reduces number of texel fetches from 64 down to 36.
* Instead of checking "is the texel inside the glyph box? if so, then fetch it",
  first fetch it, and then set result to zero if it was outside. Simplifies the
  branching code flow in the compiled GPU shader.
* Avoid costly integer modulo/division for "unwrapping" the font texture. The
  texture width is always power of two size, so division/modulo can be replaced
  by masking and a shift. Setup uniforms to contain the needed data.

### Fixes

* The 3x3 blur was not doing a 3x3 blur, due to a copy-pasta typo (one of the
  sample offsets was repeated twice, and thus another sample offset was
  missing).
* Blur towards left/top edges of the glyphs had artifacts, because float->int
  casting in GLSL rounds towards zero, but the code actually wanted to round
  towards floor.

Image of how the blur has changed in the PR.

### First time initialization

* Windows 10, NVIDIA RTX 3080Ti, OpenGL: 274.4ms -> 51.3ms
* macOS, Apple M1 Max, Metal: 456ms -> 289ms (this is including PSO creation
  time).

### Shader performance/complexity

Performance I only measured on macOS (M1 Max), by making a BLF text that is
scaled up to cover most of screen via Python. Using Xcode Metal profiler,
drawing that text with 5x5 shadow blur: 1.5ms -> 0.3ms.

More performance analysis details in PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/119653
2024-03-19 16:29:21 +01:00
Sybren A. Stüvel cd476226d8 Fix #119402: Bone collections layers fail with pinned object or armature #119434
Don't assume armature of active object is what is displayed in the properties editor, both in C++ and Python code.

Object pointer was left out from some notifiers, as this means only that object was changed. But an armature datablock can be shared by multiple objects.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/119663
2024-03-19 16:27:06 +01:00
Thomas Dinges 981afe2a65 Release: Update THIRD-PARTY-LICENSES for 4.1 2024-03-19 16:21:29 +01:00
Weizhen Huang 8536575263 Fix: Cycles area light ignores some valid samples in volume segment 2024-03-19 14:48:43 +01:00
Weizhen Huang f5f10201ca Cleanup: remove unused function 2024-03-19 14:48:14 +01:00