Commit Graph

150077 Commits

Author SHA1 Message Date
Aras Pranckevicius
2296d3a94b Merge branch 'blender-v4.2-release' 2024-06-19 12:20:34 +03:00
Aras Pranckevicius
189410e1ff Fix #123333: VSE strip outline width now takes DPI/line width setting into account
Now the strip outline (1 point for unselected strips, 2 point outline +
1 pt dark inset) takes monitor DPI / user preference line width into
account, via the usual U.pixelsize machinery.

Pull Request: https://projects.blender.org/blender/blender/pulls/123369
2024-06-19 11:19:15 +02:00
Omar Emara
0582553bb0 Merge branch 'blender-v4.2-release' 2024-06-19 11:48:17 +03:00
Omar Emara
4329dafb4c Fix #123340: Zero division in Difference Key node
The Difference Key node suffered from zero division when the falloff is
zero. Fix that by using safe division.
2024-06-19 11:46:09 +03:00
Sergey Sharybin
dc88f53f21 Merge branch 'blender-v4.2-release' 2024-06-19 10:42:42 +02:00
Alaska
10737d719e Cleanup: Correct Cycles code comment
The code comment references a variable that was removed during the
review process of !123341

Pull Request: https://projects.blender.org/blender/blender/pulls/123409
2024-06-19 10:42:13 +02:00
Omar Emara
4f51033708 Nodes: Implement Gabor noise
This patch implements a new Gabor noise node based on [1] but with the
improvements from [2] and the phasor formulation from [3].

We compare with the most popular existing implementation, that of OSL,
from the user's point of view:

  - This implementation produces C1 continuous noise as opposed to the
    non continuous OSL implementation, so it can be used for bump
    mapping and is generally smother. This is achieved by windowing the
    Gabor kernel using a Hann window.

  - The Bandwidth input of OSL was hard-coded to 1 and was replaced with
    a frequency input, which OSL hard codes to 2, since frequency is
    more natural to control. This is even more true now that that Gabor
    kernel is windowed as opposed to truncated, which means increasing
    the bandwidth will just turn the Gaussian component of the Gabor
    into a Hann window. While decreasing the bandwidth will eliminate
    the harmonic from the Gabor kernel, which is the point of Gabor
    noise.

  - OSL had three discrete modes of operation for orienting the kernel.
    Anisotropic, Isotropic, and a hybrid mode. While this implementation
    provides a continuous Anisotropy parameter which users are already
    familiar with from the Glossy BSDF node.

  - This implementation provides not just the Gabor noise value, but
    also its phase and intensity components. The Gabor noise value is
    basically sin(phase) * intensity, but the phase is arguably more
    useful since it does not suffer from the low contrast issues that
    Gabor suffers from. While the intensity is useful to hide the
    singularities in the phase.

  - This implementation converges faster that OSL's relative to the
    impulse count, so we fix the impulses count to 8 for simplicitly.

  - This implementation does not implement anisotropic filtering.

Future improvements to the node includes implementing surface noise and
filtering. As well as extending the spectral control of the noise,
either by providing specialized kernels as was done in #110802, or by
providing some more procedural control over the frequencies of the
Gabor.

References:

[1]: Lagae, Ares, et al. "Procedural noise using sparse Gabor
convolution." ACM Transactions on Graphics (TOG) 28.3 (2009): 1-10.

[2]: Tavernier, Vincent, et al. "Making gabor noise fast and
normalized." Eurographics 2019-40th Annual Conference of the European
Association for Computer Graphics. 2019.

[3]: Tricard, Thibault, et al. "Procedural phasor noise." ACM
Transactions on Graphics (TOG) 38.4 (2019): 1-13.

Pull Request: https://projects.blender.org/blender/blender/pulls/121820
2024-06-19 09:33:32 +02:00
Campbell Barton
df78d23f93 Merge branch 'blender-v4.2-release' 2024-06-19 16:01:53 +10:00
Campbell Barton
6eb2b5f47b Fix local extension errors being shown as remote errors
Also fix error with non extension add-on display by removing
an exception for extensions which is no longer needed.
2024-06-19 15:58:45 +10:00
Hans Goudey
d70bd00422 Merge branch 'blender-v4.2-release' 2024-06-18 23:49:46 -04:00
Hans Goudey
86e1ef2e31 Fix: Memory leak in purge orphans with no unused data-blocks
Operator cutom data was allocated but not freed in the early return.
2024-06-18 23:49:18 -04:00
Hans Goudey
b9f86b831c Sculpt: Avoid threading overhead for area/normal sampling function
Remove the `any_vertex_sampled` variable, which was just used when only
sampling the area normal, and was unnecessary since we also keep track
of how many vertices passed the sample tests. Though it's a simple
change, this more than doubles the performance of the sculpt brush
benchmark file from #118145 on my hardware, from 1.76s to 0.74s for
the brush evaluation. This is likely because writing to the same
memory from many separate threads interacts very poorly with CPU
caches. If this variable weren't unnecessary, another option would
be including it in the parallel reduction.
2024-06-18 23:19:21 -04:00
Hans Goudey
903e926809 Cleanup: Sculpt: Use const references for area normal/center sampling 2024-06-18 23:01:52 -04:00
Hans Goudey
d4a9d68a18 Cleanup: Sculpt: Extract view normal variable 2024-06-18 22:58:22 -04:00
Hans Goudey
417b0df883 Cleanup: Sculpt: Remove unnecessary undo type argument
Pull Request: https://projects.blender.org/blender/blender/pulls/123411
2024-06-19 04:54:56 +02:00
Hans Goudey
80e197e33c Cleanup: Sculpt: Use node argument instead of retrieving from undo node 2024-06-18 22:15:32 -04:00
Hans Goudey
21f204b06e Sculpt: Move object name out of per-node undo data
The object name is the same for all of the nodes in the vector,
there's no need to duplicate it for each one.
2024-06-18 22:15:32 -04:00
Hans Goudey
4854d69745 Cleanup: Sculpt: Simplify initialization/destruction of undo step data 2024-06-18 22:15:32 -04:00
Hans Goudey
de1c911d49 Sculpt: Initial data oriented refactor for clay strips brush
Part of #118145.
There isn't much to comment on here compared to the other refactors.
I measured something like a 20% performance improvement on the
benchmark file, but there are some obvious problems with the brush's
influence radius and affect in the benchmark file that that isn't a very
useful measurement.

Pull Request: https://projects.blender.org/blender/blender/pulls/123154
2024-06-19 03:25:36 +02:00
Hans Goudey
b0d68627a3 Fix: New sculpt brush factors broken with mask attribute
Caused by 6a5c14e58f which still inverted the mask even though
it was being subtracted from the factor, effectively inverting it anyway.
Instead restore the previous logic which gathered the mask before
dealing with visibility. That's preferred because it can be replaced with
a `gather` when mask storage is inverted to be like selection, and
because the logic is a bit simpler. Also remove the clamping of the mask
since it generally shouldn't break sculpt code and because mask values
are clamped by editing tools already.
2024-06-18 21:06:38 -04:00
Sean Kim
ea90d3f409 Cleanup: Add BLI_array.hh to includes for common brush code
Pull Request: https://projects.blender.org/blender/blender/pulls/123407
2024-06-19 02:35:00 +02:00
Campbell Barton
a9447cf09a Cleanup: spelling in comments 2024-06-19 10:03:37 +10:00
Campbell Barton
f50964bd6c Merge branch 'blender-v4.2-release' 2024-06-19 09:55:47 +10:00
Campbell Barton
30557c148a Merge branch 'blender-v4.2-release' 2024-06-19 09:55:43 +10:00
Harley Acheson
ad625d8dc4 Fix #122423: Clear handlers for non-temporary regions on exit
Resolve regression in [0] which incorrectly replaced
`WM_event_modal_handler_region_replace` with
`WM_event_ui_handler_region_popup_replace`
causing a crash when accessing dangling pointers.

Resolve by restoring the call to clear modal handlers regions.

Ref !122922

[0]: b25eefbf9a
2024-06-19 09:49:21 +10:00
Campbell Barton
0cc9762651 Cleanup: spelling in comments 2024-06-19 09:41:11 +10:00
Hans Goudey
6bb978d07d Fix #123382: Subdivision surface crash with no faces
Caused by 31a67805fe.
2024-06-18 19:10:17 -04:00
Sean Kim
8ac66b1c8e Cleanup: Add comments for StrokeCache variables
Pull Request: https://projects.blender.org/blender/blender/pulls/123402
2024-06-19 01:03:35 +02:00
Lukas Stockner
97b06c429f Cycles: Fix multiscattering Oren-Nayar at glancing angles, update tests 2024-06-18 22:57:52 +02:00
Sean Kim
963eda1db8 Merge branch 'blender-v4.2-release' 2024-06-18 12:50:48 -07:00
Sean Kim
bf2e59e1dd Fix: Relax face set occasionally too strong
In a previous refactor, the iteration variable was shadowed resulting in
the extra strength always being applied.

Pull Request: https://projects.blender.org/blender/blender/pulls/123350
2024-06-18 21:49:35 +02:00
Sean Kim
5a05ceb5db Merge branch 'blender-v4.2-release' 2024-06-18 12:33:26 -07:00
Brecht Van Lommel
a26fd603b0 Merge branch 'blender-v4.2-release' 2024-06-18 21:19:24 +02:00
Hans Goudey
79416a8b96 Refactor: GPU: Simplify access to vertex buffer data
Add a `.data<T>()` method that retrieves a mutable span. This is useful
more and more as we change to filling in vertex buffer data arrays
directly, and compared to raw pointers it's safer too because of asserts
in debug builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/123338
2024-06-18 21:10:45 +02:00
Lukas Stockner
5e40b9bb5c Cycles: Switch to energy-preserving multiscattering Oren-Nayar BSDF
This multiscattering term comes from the OpenPBR specification and nicely
preserves energy while correctly modeling increased saturation at high
roughness.

Preparation for adding a diffuse roughness option to the Principled BSDF.

To me, the difference in output and computation seems small enough to
not need an enum for the old behavior.

Note that this also switches sampling to cosine-weighted, in my tests this
gives lower noise. I also checked doing MIS between cosine and uniform,
using the A term as a weight for how often to use cosine (since that term
is Lambertian diffuse), but always using cosine was better.
A nice consequence of that is that you don't get a huge noise jump when
going from 0.0 to 0.01 roughness.

Pull Request: https://projects.blender.org/blender/blender/pulls/123345
2024-06-18 21:07:21 +02:00
Sean Kim
7a16b9f04f Fix #123335: Expand Face Set behaves incorrectly on new mesh
Without the call to ensure_face_sets_mesh, the initial values of the
cache are 0, not 1. The latter is the correct default value to represent
no face set.

Pull Request: https://projects.blender.org/blender/blender/pulls/123392
2024-06-18 21:03:27 +02:00
Clément Foucault
ff03ab4d08 Fix: EEVEE: Overblur of textures because of TAA
This was a missing block of the TAA implementation.
TAA jitter and reprojection have a tedency to soften
the texture. Add a 1.5 bias to make them a bit sharper.

Note that this is a bit different than the usual TAA
blurring. In final render we don't do reprojection
so it is only because the texture filter (box filter
from the LOD) is applied at the same time than our pixel
filter (blackmann-harris). It is less noticeable than
the normal TAA blur, but still blurs ~2px instead of
1.5px.
2024-06-18 19:31:47 +02:00
Falk David
10b1e45ca8 Fix: Curves: Crash in transform code for non bézier curves
This caused a crash in grease pencil when trying to transform strokes (poly curves).
The code assumed that the left and right handle indices existed.

Pull Request: https://projects.blender.org/blender/blender/pulls/123311
2024-06-18 19:08:11 +02:00
Miguel Pozo
feed10a4c2 Fix: GPU: Workaround for validation errors on replaced passes 2024-06-18 18:36:09 +02:00
Nathan Vegdahl
295df94478 Anim: add "legacy behavior" option to Limit Rotation constraint
This adds a "Legacy Behavior" option to the Limit Rotation constraint that makes
it behave how Limit Rotation constraints did prior to
ed2408400d. Newly created constraints have this
option disabled, but versioning code enables the option on constraints from
older files to ensure that the behavior of e.g. existing rigs is not altered.

This is one part of a two-part fix for #123105. The other part is in PR
extensions/rigify#4.

Pull Request: https://projects.blender.org/blender/blender/pulls/123361
2024-06-18 18:29:25 +02:00
Brecht Van Lommel
44309ac7e1 Build: Change make deps HARVEST_TARGET to new Git LFS location 2024-06-18 18:20:54 +02:00
Clément Foucault
355c7b788e Fix: EEVEE: Remaining references to EEVEE-Legacy in codebase
Fix #123387
2024-06-18 18:17:34 +02:00
Falk David
6ad04beff8 Cleanup: GPv3: Move create_curves_outline into grease_pencil_geom.cc
Moves the `create_curves_outline` into the editor file `grease_pencil_geom.cc`
in preperation to use it in other places (draw tool).

Pull Request: https://projects.blender.org/blender/blender/pulls/123383
2024-06-18 18:12:45 +02:00
Sybren A. Stüvel
3013630137 Refactor: simplify make_new_animlistelem() by returning early
No functional changes. Just avoiding having the entire function in a
condition.

Pull Request: https://projects.blender.org/blender/blender/pulls/123388
2024-06-18 17:53:44 +02:00
Clément Foucault
e5f514c60c Fix: EEVEE: AO Pass: Regression in quality caused by sample count
Sample count was mismatching the LOD offset leading to
quality regression. Using the same specialization
constant as the fast GI fixes the issue.
2024-06-18 17:53:22 +02:00
Clément Foucault
90c1d5832e Fix: EEVEE: AO: Only clip occluders based on front sample
This is cheaper but avoid loosing the sample influence when
thickness is large.
2024-06-18 17:53:22 +02:00
Clément Foucault
3112799804 Fix: EEVEE: AO: LOD transition too visible at high sample count
This add dithering to the lod steping allowing for a smoother
transition.
2024-06-18 17:53:22 +02:00
Clément Foucault
d41cd2095a EEVEE: Make render tests use volume indirect lighting 2024-06-18 17:53:22 +02:00
Pablo Vazquez
e55af25f38 VSE: Enable "Preview During Transform" by default
Turn on `Preview During Transform` by default on new scenes.

Old files are not affected, they will keep whatever setting they had.

Pull Request: https://projects.blender.org/blender/blender/pulls/123374
2024-06-18 17:38:07 +02:00
Alaska
56bb8b2b3c Fix #123324: Improve Cycles camera bounding box size calculation
Cycles runs a check to see if the camera is possibly inside a
volumetric object by seeing if the bounding box of the camera
and volumetric object intersect.

If the calculation is wrong (Cycles says the camera is outside the
volume when it's inside it), then the volume will not render properly.

This commit resolves most of these issues by making the camera
bounding box larger than before, taking into consideration
features like:

1. The impact DOF could have on the camera ray start position and how
that should impact the bounding box size.
2. Taking into consideration near clipping, which was missed from the
orthographic camera due to a oversight in a previous commit
(08cc73a9bb).

Pull Request: https://projects.blender.org/blender/blender/pulls/123341
2024-06-18 17:35:16 +02:00