Commit Graph

109378 Commits

Author SHA1 Message Date
Clément Foucault
ea5e1fef2a EEVEE-Next: Sunlight Extraction
Sun extraction convert part of light comming from the world to a
sun light which increases the quality of the rendering. The goal
of this feature is to workaround the limitation of the storage
techniques used for environment lighting inside EEVEE.

This first implementation works by clamping the world lighting and
summing the excess lighting and (and its incomming directions) to
deduce the sun position.
All the lighting is then transfered into this light power. The sun
angle is computed based on the directionnality of the excess lighting,
the more divergent the excess lighting is, the bigger the angle.

This has a few benefits:
- It's stable and behave well under animation. This is because we
average a lot of data.
- It's fast as it can be done inside the remap shader in one pass.
- It requires only one parameter, the clamp threshold.

However, it has some issue:
- It modifies the lighting as we change the incomming direction for
excess lighting away from the chosen sun direction. This could be fixed
by masking only lighting around the chosen sun direction (requires 2
passes, slower).
- Given that this only average the direction, it behaves poorly if there
two opposite bright light sources (it puts the sun in the middle). This
could be fixed by extracting more suns, but that becomes more complex
and requires even more passes.
- It looks bad if the summed lighting is not supposed to be a perfect
disk in specular reflections or if the sources are too divergent as the
disk is too big and the approximation fails short. This could be
mitigated by adding an upper bound to the sun radius. For now we
workaround this issue by exposing the sun angle parameter in the UI.

A more precise algorithm can be implemented in the future to avoid
having to deal with these limitations. A possibility is to use
importance sampling to randomize sun position. But that would be only
for final render.

Pull Request: https://projects.blender.org/blender/blender/pulls/121455
2024-05-14 16:36:12 +02:00
Campbell Barton
981181ddde Extensions: show a one-time prompt to enable or dismiss online access
This is the preferences part of #120665.

- Use new URL https://extensions.blender.org/api/v1/extensions
- Disable extensions.blender.org by default.
- Enable "Check for Updates on Startup" for extensions.blender.org.
2024-05-15 00:16:18 +10:00
Sergey Sharybin
727a90a0f1 Compositor: Make GPU compositor an official feature
Effectively, make GPU compositor available without need to enable
an experimental feature set.

The compositor device is now exposed in the Performance panel of
Render Buttons. It is also still available in the compositor's
N-panel, together with some other options which are more about how
editing works, and not exactly related to render performance.

Pull Request: https://projects.blender.org/blender/blender/pulls/121398
2024-05-14 15:49:20 +02:00
Falk David
5d7e785fdd GPv3: Brush radius unit option
This implements and exposes the `View`/`Scene` brush radius option.

* `View`: Brush units are in pixels. Zooming in and out in the viewport will make the brush stay the same size relative to the view, but grow/shrink relative to the scene.
* `Scene`: Brush units are in meters. Zooming in and out in the viewport will make the brush grow/shrink relative to the view, but stay the same size relative to the scene.

The default radius unit is `Scene`, which is what GPv2 did.

The "2D Animation Template" was updated to disable using the radius in the unified paint settings. This means that using the template by default will use the brush radius, which also mimics the behavior of GPv2.

The user can change the radius brush unit from the `Advanced` panel.

Pull Request: https://projects.blender.org/blender/blender/pulls/120257
2024-05-14 15:20:31 +02:00
Campbell Barton
cdee8627b2 Extensions: rename repository "remote_path" to "remote_url"
Existing repository preferences will be reset to defaults.
2024-05-14 20:59:03 +10:00
Campbell Barton
e86018fc43 Cleanup: correct checking wrong member for sizeof(..) 2024-05-14 20:42:44 +10:00
Campbell Barton
ac3098d8ad Extensions: show "Check for Updates on Startup" in the Add Repo operator
Ref #120613.
2024-05-14 20:08:59 +10:00
Campbell Barton
bc7b595362 Fix use_sync_on_startup flag being negated 2024-05-14 20:08:59 +10:00
Nathan Vegdahl
6709d598cf Anim: don't split keyframing error messages into singular and plural
Having different strings for singular/plural is meaningless or
insufficient in some languages, and thus complicates localization
unnecessarily.
2024-05-14 11:55:14 +02:00
Falk David
d4496f5bd4 Fix #121774: GPv3: Crash after undo
The undo system needs to invalidate all caches when decoding
an undo step for now. This was not done for some caches
(probably because they were added at a later stage).

The fix makes sure all caches on the `Drawing` runtime data
are tagged after decoding a step.

Pull Request: https://projects.blender.org/blender/blender/pulls/121777
2024-05-14 11:50:49 +02:00
Campbell Barton
566a77f605 UI: restore assert in CTX_wm_region_popup_set
This just hid that freed memory was being passed to
CTX_wm_region_popup_set.

The change from [0] exposed this issue, however the problem has
existed for a long time (likely since the inclusion of popups in the
context) it's just that setting the context member when popups
are first displayed made problems more likely to show up.

[0]: 38d11482f5
2024-05-14 19:34:21 +10:00
Pratik Borhade
60c9f4026b GPv3: Display layers in dopesheet and timeline
Include GPv3 layers/groups in dopesheet and timeline editor.
Call `animdata_filter_grease_pencil_data` in `animdata_filter_dopesheet_ob`
to draw layers.
Crash when transforming keys due to missing recalculation is also handled
in this PR.

Part of #110056

Pull Request: https://projects.blender.org/blender/blender/pulls/120605
2024-05-14 11:03:11 +02:00
Jeroen Bakker
5d5cbca7ed Vulkan: Refactor image views
Move ownership of image views to VKTexture. VKFramebuffer can request
access to the image views. This allows reconfiguring framebuffers when
the previous configuration is still in use by the render graph.

Pull Request: https://projects.blender.org/blender/blender/pulls/121727
2024-05-14 10:46:12 +02:00
Jeroen Bakker
9b531609bd Vulkan: Fix push constants tests
This fixes several issues with push constants.

Push constants test were failing due to setting incorrect parameters.
The pipeline stage was used as if it was a shader stage.

When using push constants fallback the uniform was loaded to the
descriptor set after the descriptor set was checked.

Suppress updating push constants of non render graph, when render
graph is active.

Pull Request: https://projects.blender.org/blender/blender/pulls/121772
2024-05-14 10:44:10 +02:00
Jeroen Bakker
b1b0f1207c Vulkan: Suppress GCC14 compiler warnings
Although this needs to be fixed before we can move to CPP20.

Pull Request: https://projects.blender.org/blender/blender/pulls/121770
2024-05-14 09:12:47 +02:00
Jeroen Bakker
f625c4e63d Vulkan: Fix compute test cases
Compute tests were failing due to recent changes.
* Incorrect image layout was used for writable image bindings.
* Incorrect pipeline stage was used for indirect command buffers.

Pull Request: https://projects.blender.org/blender/blender/pulls/121744
2024-05-14 08:22:18 +02:00
YimingWu
29dc4a85f7 Fix #121766: Softbody ensure current position
When reading a cached frame the unmodified goal positions are not
synchronized along. Now fixed.

Co-authored by @bjornmose

Pull Request: https://projects.blender.org/blender/blender/pulls/121768
2024-05-14 06:49:30 +02:00
Alaska
9320ee2a36 Print Blender branch when running --version command
Ref: !121769
2024-05-14 14:33:35 +10:00
Campbell Barton
a39e78ec29 Cleanup: declare uiPopupBlockHandle on assignment 2024-05-14 14:27:12 +10:00
Campbell Barton
9ed5ed1a2b Fix #121686: Regression: Context Menu has many operations disabled
Resolve own regression in [0] which caused operators poll functions
in context menus to fail because the menus own region was set
causing the button clicked on not to be detected as the active button.

Resolve by passing "can_refresh" as an argument to ui_popup_block_create
which only sets the "region_popup" context item for popups that can
refresh. This is done because previously "region_popup" was only ever
set for temporary regions that refreshed (details in code-comments).

[0]: 38d11482f5
2024-05-14 14:08:28 +10:00
Campbell Barton
01a78bf3e6 Cleanup: avoid matching names for public & static functions
While supported it's confusing to use the same name for a public
function and it's private implementation.
2024-05-14 13:27:18 +10:00
Campbell Barton
521cd53f29 Fix dangling references to temporary variables 2024-05-14 13:13:04 +10:00
Hans Goudey
ac7ceba950 Fix: Asset shelf missing deactivation if new item hidden
When a new item is active, other items are only deactivated in the
`set_state_active` method. This doesn't run if the new item is not
displayed by the shelf for whatever reason (e.g. catalog filters).
To fix this, just set the item inactive. This may be redundant with
the deactivation in `set_state_active`, or it might not be, depending
on whether the active item is visible.

Pull Request: https://projects.blender.org/blender/blender/pulls/121589
2024-05-14 05:11:07 +02:00
Clément Foucault
1589f3713a Fix: EEVEE-Next: Fix Shadow resolution limit step
The step is already multiplied by 0.01 internally.
2024-05-13 23:51:15 +02:00
Harley Acheson
41bbbd2359 UI: Color Tooltips
Hovering over a color button shows a tooltip that includes the color
values and a large sample.

Pull Request: https://projects.blender.org/blender/blender/pulls/117815
2024-05-13 23:48:29 +02:00
Harley Acheson
92e0545e9f UI: Remove BLF_draw_default_shadowed
With Aras's recent changes in #121383, our text shader now supports
outline shadows, which gives a result that has more contrast than can
be achieved with BLF_draw_default_shadowed. This removes that function.

Pull Request: https://projects.blender.org/blender/blender/pulls/121676
2024-05-13 22:32:59 +02:00
Falk David
fccdf7da0c Refactor: GPv3: Paste keyframes operator
The operator used `layer->remove_frame` which has been
replaced with `grease_pencil.remove_frames`.

Also makes a few variables `const` and cleans up some
namings.
2024-05-13 18:41:08 +02:00
Clément Foucault
e72c47751d EEVEE-Next: UI Shadow Resolution Limit
Improve naming and tooltips. Also fix a bug in the UI script.
2024-05-13 18:39:47 +02:00
Falk David
65f05f4284 Cleanup: GPv3: Remove unnecessary layer group API functions
The `LayerGroup` class had an API to add layers and layer groups.
The only thing these did was allocate a new layer/group and then
call the `add_node` API.

This removes these functions (they were only used in a single
place anyway) and does the allocation of the new layer/group
directly in the grease pencil API. This removes a few lines of
code and makes everything a bit easier to read.
2024-05-13 18:01:20 +02:00
Falk David
7006eb4805 Cleanup: GPv3: Rename add_layer to duplicate_layer
There was an overloaded version of `add_layer` that took
a const reference to a source layer. The function would
duplicate that layer.

The function name `add_layer` was a bit confusing in this
case. Calling it `duplicate_layer` makes it a bit clearer.
2024-05-13 17:44:10 +02:00
Sybren A. Stüvel
0caf6397df Anim, remove Action::binding_for_id() method
Remove the `Action::binding_for_id()` method, as it is a bit dangerous,
only useful in a very specific situation, and can be removed altogether
with just a little bit of refactoring. This in turn made some other
functions a bit simpler too.

Almost no functional changes. The only change is that when through some
magic (aka data corruption or other bug) the Binding is no longer valid
for the animated ID's type, the IDs properties may still show as
animated in the interface.

Pull Request: https://projects.blender.org/blender/blender/pulls/121748
2024-05-13 17:30:37 +02:00
Falk David
10b5a401dc Refactor: GPv3: Use insert_frame API in duplicate layer operator
This is part of #121565.

Uses the newer `GreasePencil::insert_frame` API to insert
a key and create a drawing. This means we no longer need
to deal with the drawing index, as this is handled by
`insert_frame` internally.
2024-05-13 17:03:02 +02:00
Iliya Katueshenock
cff53fdb53 Nodes: Increase size of shader attribute name
This can be a path to a property, so this field has to be longer.

Pull Request: https://projects.blender.org/blender/blender/pulls/121595
2024-05-13 16:51:26 +02:00
Clément Foucault
f16f9d9a96 EEVEE-Next: Use closure_light_set in foward lib
Was missing from the commit that introduced it.
2024-05-13 16:33:05 +02:00
Falk David
4f2f97d498 Formatting 2024-05-13 16:28:19 +02:00
Falk David
5c9fad1582 Refactor: GPv3: Use get_drawing_at in various helper functions
Part of #121565.

Updates `get_editable_frames_for_layer` and
`retrieve_editable_drawings_grouped_per_frame`
functions to not use drawing indices, but the
`get_drawing_at` function.
2024-05-13 16:27:46 +02:00
Iliya Katueshenock
75d17b1db5 Cleanup: Move BKE_node to namespace
Move all header file into namespace.
Unnecessary namespaces was removed from implementations file.
Part of forward declarations in header was moved in the top part
of file just to do not have a lot of separate namespaces.

Pull Request: https://projects.blender.org/blender/blender/pulls/121637
2024-05-13 16:07:12 +02:00
Sybren A. Stüvel
d94a56bdad Anim: merge Animation data-block into bAction
The new/experimental, layered `Animation` data-block is merged with the
existing `bAction` data-block.

The `Animation` data-block is considerably newer than `bAction`, so the
supporting code that was written for it is also more modern. When moving
that code into `bAction`, I chose to keep the modernity where possible,
and thus some of the old code has been updated as well. Things like
preferring references over pointers.

The `Animation` data-block is now gone from DNA, the main database, etc.
As this was still an experimental feature, there is no versioning code
to convert any of that to Actions.

The DNA struct `bAction` now has a C++ wrapper `animrig::Action`, that
can be obtained via `some_action->wrap()`.

`animrig::Action` has functions `is_empty()`, `is_action_legacy()`, and
`is_action_layered()`. They **all** return `true` when the Action is
empty, as in that case none of the data that makes an action either
'legacy' or 'layered' is there.

The 'animation filtering' code (for showing things in the dope sheet,
graph editor, etc) that I wrote for `Animation` is intentionally kept
around. These types now target 'layered actions' and the
already-existing ones 'legacy actions'. A future PR may merge these two
together, but given how much work it was to add something new there, I'd
rather wait until the dust has settled on this commit.

There are plenty of variables (and some comments) named `anim` or
`animation` that now are of type `animrig::Action`. I haven't renamed
them all, to keep the noise level low in this commit (it's already big
enough). This can be done in a followup, non-functional PR.

Related task: #121355

Pull Request: https://projects.blender.org/blender/blender/pulls/121357
2024-05-13 15:58:04 +02:00
Iliya Katueshenock
73d75be5de Fix: Nodes: Don't show default value in reroute dummy tooltip
This is issue that was acsidentially introduced in 8e830a95de.

Pull Request: https://projects.blender.org/blender/blender/pulls/121689
2024-05-13 15:48:15 +02:00
Pratik Borhade
fa72f9a5d8 GPv3: Swap layer order in Stroke primitive
This makes the layer order of stroke object of both GPv2 and GPv3 consistent.
Resolves #121734.

Pull Request: https://projects.blender.org/blender/blender/pulls/121741
2024-05-13 15:46:00 +02:00
Sybren A. Stüvel
ac4e00da0d Refactor: return C++ type in BKE_pose_minmax() instead of return params
Return a `std::optional<Bounds<float3>>` instead of having two return
parameters and returning a `bool`.

No functional changes.
2024-05-13 15:42:33 +02:00
Sybren A. Stüvel
81d73881ca Cleanup: Return early in BKE_pose_minmax
Reduce cognitive complexity by returning early in `BKE_pose_minmax()`.

Also rename `changed` to `found_pchan`, as that explains better what's
being tracked.

No functional changes.
2024-05-13 15:42:33 +02:00
Sybren A. Stüvel
b4cc9329e5 Refactor: Anim, remove 'use_hidden' from BKE_pose_minmax()
Remove the `use_hidden` parameter of the `BKE_pose_minmax()` function.
This parameter was only used with `use_selected` set to the same value,
with the following effects:

- Both set to `true`: only selected bones are considered. Since hidden
  bones are automatically deselected, this effectively excluded hidden
  bones.
- Both set to `false`: explicitly excludes hidden bones.

So in both use cases hidden bones were ignored, which IMO is the correct
approach anyway, as the bounding box is used for centering in view,
snapping to bounding box, etc.

No functional changes.
2024-05-13 15:42:33 +02:00
Sybren A. Stüvel
6212c3c374 Fix #121161: Regression: Frame Selected Includes Hidden Bones
Refactor `BKE_armature_min_max()` so that it calls `BKE_pose_minmax(ob,
use_hidden=false)`. The former took neither bone visibility nor custom
bone shapes into account when computing the bounding box. Now these two
are unified, fixing the regression.

`BKE_armature_min_max()` is now basically a thin wrapper that uses more
modern C++ types in its signature. This will be cleaned up in a
follow-up refactor commit.

Another difference is that these functions return the AABB in different
coordinate spaces (object vs. world). This isn't done entirely correctly
(just transforming the two extreme points), but in a way that is
symmetrical with `BKE_object_minmax()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/121739
2024-05-13 15:42:33 +02:00
Sybren A. Stüvel
547067f599 Cleanup: Anim, add const to BKE_pose_minmax()
Make the `Object *` argument `const` in `BKE_pose_minmax()`. There is no
writing to the object to cache the bounding box, and that's now clear from
the declaration as well.

No functional changes.
2024-05-13 15:42:33 +02:00
Falk David
281bbe198d Cleanup: GPv3: Use get_drawing_at in modifier util functions
Part of #121565.

Instead of accessing the drawing indices directly, use
`get_drawing_at` in the utility functions.

Pull Request: https://projects.blender.org/blender/blender/pulls/121732
2024-05-13 15:40:36 +02:00
Falk David
a80d53bd75 Cleanup: GPv3: Use get_drawing_at in get_evaluated_grease_pencil_drawing_deformation
Part of #121565.

Use the `get_drawing_at` function instead of reading the drawing indices.
This gets us closer to not exposing the drawing indices
at all.
2024-05-13 14:54:20 +02:00
Clément Foucault
c7bc3334ad EEVEE-Next: Shadow: Add Maximum Resolution Option
This adds a light parameter to avoid near camera pixels
allocating too much shadow resolution.

This is more intuitive than the scale shadow setting and
allows reducing the precision without changing the look
of distant shadows.

For sun lights, the property sets the minimum pixel
size the shadow can contains. This allows to
remove a lot tilemap close up.

For local lights, there is another additional property
to set the maximum resolution in shadow space (like
EEVEE-Legacy) instead of in world space (like sun
lights). This allows making older files lighter and
allow a more conservative approach to resolution.

This add versionning code to handle EEVEE-Legacy files
that had fixed resolution per light type.

The resolution setting is always in world space distance
as the maximum shadow resolution distribution might change
in the future or be dependent on other parameters
(like beam angle). This ensure that there is no
dependency on these parameters, but make the
setting use very small units. But this is more of
a UI problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/121701
2024-05-13 14:34:11 +02:00
Clément Foucault
ab48b08cde Fix: EEVEE-Next: Avoid syncing issues on AMD with cryptomatte
There was a missing barrier, which created
blocky, non-deterministic artifacts in the
cryptomatte render tests.
2024-05-13 14:10:26 +02:00
Jeroen Bakker
e0da623d33 Vulkan: Don't record drawlist commands for invalid batches
Overlay engine extra layer can record draw list commands with an
empty index buffer. This would not affect any pixels and should be
ignored.

Issue detected when vulkan validation layers are turned on and loading
default scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/121736
2024-05-13 14:09:37 +02:00