Commit Graph

150077 Commits

Author SHA1 Message Date
Clément Foucault
ad4a306049 Fix #124013: EEVEE: Artifact when using larger pixel size
Rely on Overlay engine to output correct fullres depth
instead of trying to upsample EEVEE's one.

Pull Request: https://projects.blender.org/blender/blender/pulls/130228
2024-12-04 11:49:41 +01:00
Clément Foucault
a0078b79ff Cleanup: GPU: Remove include of removed directory 2024-12-04 10:06:15 +01:00
Omar Emara
462b81efca Fix: Border bicubic interpolation is wrong around edges
The BLI bicubic interpolation function with border boundary is wrong
around edges. It returns zero, where interpolated values should exist.
This is due to a wrong early exit condition, where only a 2x2 window is
assumed instead of the 4x4 window considered by bicubic interpolation.
To fix this, assume a 2 pixel region in the early exit condition for
both directions.

Pull Request: https://projects.blender.org/blender/blender/pulls/131320
2024-12-04 08:39:58 +01:00
Alaska
615ab676a7 Tests: Add Cycles test for a volume with a zero angle distant light
During Blender 4.2's development, a bug was introduced that lead to
volumes rendering incorrectly if:
- There was a distant light with a zero angle spread
- The light tree was enabled

This was reported to blender/blender#129420 and fixed in 4.3.

This commit adds a render test for this situation.

Ref: blender/blender#123012
Ref: blender/blender-test-data!26

Pull Request: https://projects.blender.org/blender/blender/pulls/131079
2024-12-04 02:09:35 +01:00
Alaska
42f8ffbb4c Tests: Add render test for Principled BSDF with a colored zero weight coat
Ref: blender/blender-test-data!20
Ref: blender/blender!124856
Ref: blender/blender#123012

Pull Request: https://projects.blender.org/blender/blender/pulls/130608
2024-12-04 02:00:21 +01:00
Hans Goudey
024d7d12e2 Mesh: Move BVH storage to shared cache system
Avoid rebuilding BVH trees when meshes are copied.
Similar to the other uses of the shared cache system,
this can arbitrarily improve performance when meshes
are copied but not deformed and BVH building is the
main bottleneck. In a simple test file I got a 6x speedup.

The amount of code is also reduced and the system is
much simpler overall-- built out of common threading
patterns like `SharedCache` with its double-checked lock.
RAII is used in a few places to simplify memory management
too.

The downside is storing more `SharedCache` items in the
mesh runtime struct. That has a slight cost when copying
a small mesh many times, but we have ideas to improve that
in the future anyway (#104327).

Pull Request: https://projects.blender.org/blender/blender/pulls/130865
2024-12-04 00:17:17 +01:00
Jacques Lucke
ee9ddbeea3 Fix: interpolating matrix attributes does not always work
The issue is that the conversion to quaternions seems to need normalized matrices
and even then is not always safe. It's simplest to use the existing `*_safe` method here for now.

Related to reports #129445 and #129485.
Related to PR #131296.

Pull Request: https://projects.blender.org/blender/blender/pulls/131297
2024-12-03 23:08:08 +01:00
Hans Goudey
e1e47b6d05 Cleanup: Adjust comment for attribute creation update tag
Avoid confusing initialization with default initialization.
2024-12-03 17:01:47 -05:00
Sean Kim
d8bec5faee Fix #131139: Small brush radius and alpha texture degrades performance
The call to `sculpt_apply_texture` is not thread safe and as such is a
major bottleneck in brush stroke processing. In previous versions, we
avoided calculating this if the vertex position was outside of the brush
radius.

To fix this, we add a check for the factor already being 0 and prevent
further texture calculations.

Pull Request: https://projects.blender.org/blender/blender/pulls/131256
2024-12-03 21:52:50 +01:00
Sean Kim
c4d5145070 Fix: StringRefNull constructor not constexpr
`strlen` is not labeled as `constexpr` and cannot be used, this commit
switches it for `std::char_traits<char>::length` which is labeled as
such since C++17

See: https://en.cppreference.com/w/cpp/string/char_traits/length

Pull Request: https://projects.blender.org/blender/blender/pulls/131266
2024-12-03 21:37:13 +01:00
Michael Jones
8fe2e37dd0 Fix #130641: MetalRT: Motion Blur (render errors)
This PR fixes #130641. The bug was caused by a missing self-object constraint when performing SSS on motion blur scenes. scene_intersect_local tests were erroneously hitting other objects, and out of range primitive IDs were causing spurious downstream behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/131156
2024-12-03 20:24:36 +01:00
Clément Foucault
805d581f08 Cleanup: Grease Pencil: Remove depth pass rendering
This is now unused with overlay next.
2024-12-03 20:04:13 +01:00
Clément Foucault
f8e44fff7d Overlay: Armature: Remove culling tests
Culling is not needed anymore as selection is as fast
as drawing. Also it is against design to use the view during
sync.
2024-12-03 19:57:11 +01:00
Clément Foucault
5a455a9988 Cleanup: DRW: Replace DRW_view_get_active by DRW_view_default_get 2024-12-03 19:50:26 +01:00
Clément Foucault
4a08cda62d Cleanup: DRW: Remove DRWShadingGroup and commands API 2024-12-03 19:32:03 +01:00
Clément Foucault
391bd5e823 Refactor: DRW: Use new API for curve refinement
Instead of allocating the pass globally, get it from the
currently bound viewport data.

Pull Request: https://projects.blender.org/blender/blender/pulls/131330
2024-12-03 19:20:09 +01:00
Jacques Lucke
0a1526eeff Blenloader: extract functions to gather and write local IDs
Splitting the write-loop into stages makes it easier to understand, debug and time.

All the complex filtering in `gather_local_ids_to_write` is the same as before.

With this and some previous refactors, it's also much easier to have a clean `write_id`
function that should also work for embedded IDs later on.

Pull Request: https://projects.blender.org/blender/blender/pulls/130983
2024-12-03 18:34:04 +01:00
Julian Eisel
7d4190a8f3 Fix startup crash when running in background mode after 172e9c5b83
Previously area & region types were not set when in background mode,
with 172e9c5b83 that changed. Apparently this causes a bunch of logic to
run that shouldn't run in background mode. So make sure we don't set the
types in background mode. Also don't run region polling in background
mode, since that would cause another crash if region types are not set
(as done in background mode).
2024-12-03 18:16:07 +01:00
Bastien Montagne
75c7621a41 install_linux_packages: Add pipewire dependency. 2024-12-03 18:00:55 +01:00
Dalai Felinto
7ed7e584cb make license: mention Blender Foundation copyright for the bundle 2024-12-03 17:55:21 +01:00
Dalai Felinto
f8ca9ee46b make license: Tweak on generated comments
After coming back to this file after a few months I myself did not remember where to edit it.
Adding the "Introduction and formatting" bullet item and update others for brevity.
2024-12-03 17:55:21 +01:00
Falk David
c86ead28a3 Cleanup: Grease Pencil: unique_node_name function
Some non-functional changes:
* Use the C++ variant of `BLI_uniquename_cb`.
* Use `StringRef` when passing strings as parameters.
* Don't pass default name as parameter. Expect name in
  `unique_node_name` to not be empty.
2024-12-03 17:01:56 +01:00
Julian Eisel
172e9c5b83 Fix #130583: Crash opening a file when asset shelf is set for non-paint modes
The region type isn't set yet when polling regions just after file read. As a
result, the polling state cannot be evaluated correctly, and `init()` may end
up being called without the previous required call to `on_poll_success()`.

Ensure the region type is set earlier, right at the beginning of screen
initialization after file read. This way all further area/region
referesh/re-init (confusingly called "init") logic can assume it's set.

Pull Request: https://projects.blender.org/blender/blender/pulls/131050
2024-12-03 16:57:38 +01:00
Clément Foucault
9380e2d5d8 Cleanup: Overlay: Remove unused structs 2024-12-03 16:49:23 +01:00
Clément Foucault
6a112a435d Cleanup: Overlay: Armature: Remove legacy code 2024-12-03 16:49:23 +01:00
Falk David
083a10148c Cleanup: Grease Pencil: Use StringRef for function parameters
Generally, `StringRef` should be used for parameters and `StringRefNull`
for the return type. This cleans up the code to use this pattern.

Part of #130518.

Pull Request: https://projects.blender.org/blender/blender/pulls/131246
2024-12-03 16:33:15 +01:00
Sebastian Parborg
2ec719447e Cmake: Add Pipewire support
Pull Request: https://projects.blender.org/blender/blender/pulls/126091
2024-12-03 16:26:01 +01:00
Sebastian Parborg
bc39ee692d Audaspace: merge changes from upstream.
Add the Pipewire backend and Pulseaudio fixes.
There are also some other minor changes.
2024-12-03 16:25:59 +01:00
Sebastian Parborg
33af6d9c5b Fix: Make sure that sound scrubbing doesn't interfere with regular playback
When "sound scrubbing" was turned on, it would stop audio playback if
you managed to start the timeline before the "sound scrubbing" audio
preview had finished.
2024-12-03 16:25:59 +01:00
Sebastian Parborg
d7140a599d Fix: Make sure Blender doesn't seek an extra time after starting to playback 2024-12-03 16:25:59 +01:00
Sebastian Parborg
6d1bc2feb1 Fix: remove uneeded A/V sync frame interpolation
This was trying to smooth out the playback but could instead lead to
worse frame pacing. It was also masking some bugs in the PulseAudio
backend that has been fixed.
2024-12-03 16:25:59 +01:00
Sebastian Parborg
32a26b8e19 Fix: Properly reset the audio devices when changing settings
Previously changing audio devices or settings while Blender was playing
back could lead to crashes or the playback state between Blender and
Audaspace de-syncing.
2024-12-03 16:25:59 +01:00
Miguel Pozo
5ffa4c4ffb Fix #131134: EEVEE: Playback performance degrades over time
Ensure `object_steps_usage` is properly reset to prevent `object_steps`
from growing every frame.

Pull Request: https://projects.blender.org/blender/blender/pulls/131165
2024-12-03 16:24:04 +01:00
Falk David
a265b591be Python: Add API function to reorder curves
The order of curves in a Grease Pencil drawing defines the
order in wich they are rendered, so it's important to be
able to change the order. Currently, there is not easy way
to do this from python.

This adds a new `reorder_curves` and `reorder_strokes`
function to reorder the curves in the curves geometry.

The function takes in an array of indices that are the
new indices for the curves (e.g. an index map).

`reorder_curves(new_indices=[...])`

Pull Request: https://projects.blender.org/blender/blender/pulls/130331
2024-12-03 16:23:31 +01:00
Hans Goudey
66e090dcb4 Cleanup: Remove unused function declarations 2024-12-03 10:21:45 -05:00
Hans Goudey
e5a1a61524 Cleanup: Remove unused sculpt drawing code
Unused after 62897317bd.
2024-12-03 10:21:45 -05:00
Sybren A. Stüvel
be921b8ddb Anim: start slot handles at a high number
The `Action::last_slot_handle` field is set to a high-ish value, to
disambiguate slot handles from array indices.

Slot handles are opaque integers, and are just used to find a slot
with that particular handle. Its exact value is irrelevant; Blender
only ensures that slot handles are never reused within the same
Action.

This particular value was obtained by taking the 31 most significant
bits of the TentHash value (Nathan's hash function) for the string
"Quercus&Laksa" (Sybren's cats).

Pull Request: https://projects.blender.org/blender/blender/pulls/131310
2024-12-03 16:15:25 +01:00
Clément Foucault
62897317bd DRW: Remove Basic engine
All remaining shaders were moved to overlay.

The basic engine is not used anymore since
all selection and depth picking happens inside
overlay engine.
2024-12-03 16:11:31 +01:00
Hans Goudey
0675353625 Cleanup: Remove unused functions from BLI math C-API
Pull Request: https://projects.blender.org/blender/blender/pulls/131313
2024-12-03 15:44:36 +01:00
Clément Foucault
3174716347 DRW: Remove use of legacy API in external draw engine
The prepass is now handled by the overlay engine.

Pull Request: https://projects.blender.org/blender/blender/pulls/131311
2024-12-03 15:37:03 +01:00
Jeroen Bakker
52d3cf8568 Fix #131227: OpenGL: Sequence editor crash on legacy Intel platforms
There seems to be an issue inside Intel OpenGL driver of legacy
platforms that fails to link `gpu_shader_sequencer_strips`.
Uniform locations are used to fix an specialization constants issue.

This PR only adds the uniform location when the shader can be
specialized. It is unclear what is actually failing inside the driver
but there are other issues with the driver.

Pull Request: https://projects.blender.org/blender/blender/pulls/131293
2024-12-03 15:31:10 +01:00
Omar Emara
be22fcf425 Fix: Wrong border nearest interpolation around negative edges
The BLI wrapmode variant of nearest interpolation for border boundary is
wrong for coordinates between [-1, 0]. That's because the negative
comparison in wrap_coord is done on the integer rounded coordinates,
which will be zero in this case, so the condition will not fail. To fix
this, do the comparison on the original coordinates instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/131306
2024-12-03 15:04:50 +01:00
Jeroen Bakker
60d918c297 Fix #131269: Vulkan: Add support for GPU_DATA_UINT_24_8 read back
Add support for GPU_DATA_UINT_24_8 readback. Note that stencil reading/writing
are not supported.

Pull Request: https://projects.blender.org/blender/blender/pulls/131302
2024-12-03 14:56:43 +01:00
Julian Eisel
d9eb1d7155 Fix #130758: UI: Spreadsheet: Animation update does not affect tree view
Redraw was not triggered for the region containing the tree-views. Ensure it's
handled by the editor redrawing logic for animation playback.

Pull Request: https://projects.blender.org/blender/blender/pulls/131303
2024-12-03 14:15:02 +01:00
Jacques Lucke
13ed60dbd3 Fix #130503: Separate Geometry node outputs empty grease pencil layers
I'm not quite sure what was wrong about the old implementation, but it was confusing
because it also depended on the user counts of drawings and other more high level
functions like `duplicate_layer`.

This fix just reimplements the functionality using the grease pencil API that we use in
more places in geometry nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/131291
2024-12-03 13:55:58 +01:00
Butterscotch!
e2ff0a45aa Fix BVH import bone tail calculation with multiple children
When importing a BVH file with a parent node that has more than one
child that have offsets within `0.001 * global_scale` of the parent
node, the length of the parent node is considered to be zero.

For example: A parent node with `OFFSET 0 -0.1077 0`, two children with
`OFFSET 0 -0.1074 0`, and a global scale of `1.0`, the parent node's
length would be considered zero, therefore adding `global_scale / 10`
(`0.1` in this case) to the y component of the offset. The resulting
tail offset would then be `OFFSET 0 -0.0077 0`.

Ref !105492
2024-12-03 23:30:10 +11:00
Laurynas Duburas
b13e085109 OBJ Import: Improved NURBS curve support
Adds support of NURBS weights or "rat bspline" in OBJ terms.
Tries to guess Blender knot mode better:

- Detects and closes loops. This decision is based on geometry only. No metadata is provided in OBJ for this, so importer has checkbox to disable this feature.
- Bezier knot mode allows to import circles and circular arcs.

Pull Request: https://projects.blender.org/blender/blender/pulls/131169
2024-12-03 13:16:16 +01:00
Jeroen Bakker
c480b7ffd3 Vulkan: Incorrect image aspect when transferring depth textures
When copying from/to depth stencil images the aspect of the image was
set incorrectly. It pointed to only one aspect of the full image when
building resource links, which could lead to incorrect decisions in the
driver.

Found when researching #131269

Pull Request: https://projects.blender.org/blender/blender/pulls/131298
2024-12-03 12:36:39 +01:00
Jacques Lucke
f0500a28ee Fix: BLI: quaternion is not normalized after conversion
This applies the fix from 98334b8f7d to the c++ implementation.

Two notes:
* We need to work towards unifying these implementations which would have avoided this bug.
* In the C++ implementation, one can't use `math::dot` and `math::normalize` for quaternions
  where this function is implemented, because of include dependency order.

Both these things should be resolved, but right now correctness has priority for me.

Pull Request: https://projects.blender.org/blender/blender/pulls/131296
2024-12-03 12:24:55 +01:00
Jacques Lucke
4d24b5fc08 Fix: Grease Pencil: crash when drawing grid overlay without active layer
Found when checking #130503.

Pull Request: https://projects.blender.org/blender/blender/pulls/131290
2024-12-03 12:23:43 +01:00