Commit Graph

108744 Commits

Author SHA1 Message Date
Clément Foucault
f86135dc6e Fix: EEVEE-Next: GBUffer: Wrong normal layer load
This was because the normal layer code was assuming no missing
closure inside the GBuffer. Now use bin indexing and
fix `gbuffer_read_bin` and `gbuffer_pack`.

Also add test cases for this.

Fixes #120756

Pull Request: https://projects.blender.org/blender/blender/pulls/120779
2024-04-22 21:36:40 +02:00
Hans Goudey
cb639d5d1d Cleanup: Rename "is_mode_active" to "edit_mode_active"
"is_mode_active" doesn't really make sense because some mode
is always active technically. This always referred to edit mode anyway.
2024-04-22 15:31:55 -04:00
Clément Foucault
d44ee7bf11 EEVEE-Next: Make light clamping consistent
This adds clamping at the light combine stage for both direct
and indirect light.

This allows for clamping direct and indirect light separately.
While direct light clamping might not be very desirable in
EEVEE, it might be wanted to reduce the flickering from distant
shiny bumpy surfaces, or for artistic reason.

This happens after applying the BSDF throughput just like cycles.
This is done in order to minimize the performance impact and
allows to split the clamp for direct light and indirect light.

The indirect light clamp value is still used in the ray-tracing
pipeline to clamp the ray intensity. But this differs from cycles
as we clamp the ray without the BSDF throughput here. Sphere probe
have the same issues. Some more energy loss is expected compared
to the direct light clamp.

Note that we still clamp the indirect light after applying BSDF
in case the BSDF is scaling the energy up above the threshold.

This also corrects the clamping for volume that now clamps after
applying the scattering term.

Also adds clamping to volume indirect lighting.

Since we use light probe volumes for both surface and volume
indirect lighting, we need to clamp them at sampling time.

Pull Request: https://projects.blender.org/blender/blender/pulls/120866
2024-04-22 21:19:00 +02:00
Habib Gahbiche
f1d4859e2a Compositor: implement bicubic spline for CPU compositor
Affected nodes:
- Rotate
- Translate
- Stabilize 2D node

Pull Request: https://projects.blender.org/blender/blender/pulls/120886
2024-04-22 20:58:43 +02:00
Jeroen Bakker
3f6e2ea915 Vulkan: Shader interface access mask
When building the resource access used when adding dispatch/draw commands
to the render graph, the access mask is required. This PR stores the
access mask in the shader interface. When binding the resources referenced
by the state manager, the resource access info struct is populated with
the access flags.

In the near future the resource access info will be passed when adding
a dispatch/draw node to the render graph to generate the links.

Pull Request: https://projects.blender.org/blender/blender/pulls/120908
2024-04-22 20:47:30 +02:00
Jacques Lucke
3bddde1b30 Cleanup: update comment regarding blend expand callback 2024-04-22 20:13:06 +02:00
Iliya Katueshenock
d1f26dad9b Fix #120874: Geometry Nodes: propagate attribute usage through muted node
For example, the `Bake` node generally does not propagate any anonymous
attributes. That's true regardless of whether it is baked or not. However, if it
is muted, the attributes should be propagated.

Pull Request: https://projects.blender.org/blender/blender/pulls/120887
2024-04-22 20:11:21 +02:00
Jesse Yurkovich
32ed9bb107 Collection Export: Enable STL and PLY exporters
Enables the STL and PLY formats for Collection export.

Changes
- Set the export operator on the File handlers
- Plumb through the `collection` property and make use of it while
  building the depsgraph
- Skip drawing the "Selection only" and "Batch" mode options when used
  with collections

Pull Request: https://projects.blender.org/blender/blender/pulls/120944
2024-04-22 20:05:34 +02:00
Harley Acheson
49bd285529 UI: Collapse XYZ Operations in Status Bar
Reduce the number of duplicated modal operator keymap entries by just
showing "XYZ Axis" rather than "X X Axis", "Y Y Azis", etc. This allows
more items to be shown on the status bar. Note this only does so if the
keymap contains all of X, Y, & Z.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/120148
2024-04-22 20:03:11 +02:00
Laurynas Duburas
3d9519544d Transform: support properly transforming implicitly shared curves positions
The issue was that the transform code kept non-const pointers into the
position arrays of `CurvesGeometry` for an extended period if time and
changed the positions through those pointers. This is not safe, because
the underlying position array may become shared (e.g. with the
corresponding evaluated object), in which case it's not allowed to change
the position array anymore without making a copy.

Generally, the scope at which some code has multiple access to data
should be as small as possible to avoid this kind of issue.

The solution is to store the positions that are modified by the transform
code in a new array and to copy those back into the `CurvesGeometry`
in one go. This way, the program scope in which the positions may be
modified is more obvious and much smaller.

Pull Request: https://projects.blender.org/blender/blender/pulls/120824
2024-04-22 20:02:52 +02:00
Jacques Lucke
d7d8cefd72 Fix: incorrect safe float4x4 to quaternion conversion
The issue was that when a 4x4 matrix is normalized, it does not
always mean that any inner 3x3 matrix is normalized too.
2024-04-22 19:52:47 +02:00
Iliya Katueshenock
ed9921185a Geometry Nodes: more detailed socket tooltips for multi-input sockets
Tooltip for multi-input socket. This kind of inspection can help to
see what data are passed into a node. Any invalid, muted or dangling
link will not be taken into account. This feature reuse the already
existing tooltip formatting and just add column indentation in multi-line case.

Pull Request: https://projects.blender.org/blender/blender/pulls/104468
2024-04-22 19:48:57 +02:00
Hans Goudey
8c1bd99c28 Fix: Missing active layer assert in mesh tangent calculation
When there is no tangent layer with the active UV name we can't set
anything active. Better to do nothing than assert.
2024-04-22 13:27:47 -04:00
Falk David
cf59d2a385 GPv3: Expose Shader FX in the UI
Enables GPv3 in the UI poll functions for shader FX.
2024-04-22 18:26:00 +02:00
Clément Foucault
5f1faec6ff Fix: EEVEE-Next: Tangent normal map node affected by object scale
Use the same approach as Legacy EEVEE and normalize the
normal before interpolation.
Fix #120455
2024-04-22 16:38:13 +02:00
Sergey Sharybin
048c7da4e9 Fix: Difficult to LMB-click-drag motion tracking tracks
When using RMB selection and RMB-click-drag from a track border it
did not initiate translation of the track.

This i because the selection operator does not return PASSTHROUGH
for such selection. The code which was responsible for this has
been ported from the tools branch to minimize the code difference,
but it is not possible to detect condition under which the new
operator behavior is needed without modifying the keymap.

Simple solution: remove the code which was doing the wrong
assumption in the main branch.

Ref #119773

Pull Request: https://projects.blender.org/blender/blender/pulls/120940
2024-04-22 15:46:18 +02:00
Falk David
563ad616f0 Cleanup: GPv3: Improve readability in AnimDataConvertor
The class `AnimDataConvertor` was implementing `operator bool`
to indicate "if this AnimDataConvertor is valid, i.e. can be used to process animation data from source ID".
The cleanup replaces this with a `is_vaild` function, making the
code easier to read and allowing to jump to the function definition
of `is_valid`.
2024-04-22 15:30:43 +02:00
Clément Foucault
3182ce2393 DRW: Add asserts for nullptr binding
These will crash at submission time anyway and will
be hard to track back to the actual resource causing
the issue. Better fail earlier.
2024-04-22 15:26:48 +02:00
Bastien Montagne
fc08f7491e Fix: GPv3: Conversion of 'thickness adjustment' not clamping radius to 0
Legacy GPv2 code seems to clamp the final computed radius to `0` (at
least in some cases, see e.g. line 3992 in
`gpencil_stroke_perimeter_ex`).

Add a clamping node to the generated geometry node used to mimmic the
legacy thickness adjustment in GPv3 converted data.

NOTE: There are still some artifacts in testfile used to investigate
this issue (`(Anim) 10 Picknick by Susanne Weise.blend`), that looks
like invalid radius handling on some curves ends... Clamping _may_ be
needed in other places maybe?

Pull Request: https://projects.blender.org/blender/blender/pulls/120840
2024-04-22 15:03:06 +02:00
Jeroen Bakker
cfaa91296f Fix #120918: EEVEE-Next world volume on iGPU HD530
When using world shaders with volume, older hardware could create
errors when the world background wasn't behind a surface. The reason
is that the world volume shader had a color attachment attached, but
none were defined by the shader interface. This lead to undefined
behavior.

This PR fixes this by attaching the occupancy frame buffer. This
framebuffer only contains a depth attachment.

Pull Request: https://projects.blender.org/blender/blender/pulls/120927
2024-04-22 14:59:30 +02:00
Sybren A. Stüvel
910360637b Fix #120574: Broken animation when saving file with NLA tweak mode entered
Fix linking & library-overriding with NLA Tweak Mode enabled. This is a
two-pronged approach:

- When linking an animated ID from a library file, and it happens to be
  in NLA Tweak Mode, it is forced out of tweak mode. This ensures that
  the correct Action is loaded, and that all the NLA flags are set
  correctly to display the NLA animation (instead of only the tweaked
  strip).
- For library overrides there is now a post-process step that runs after
  all 'apply' functions have been run. This is necessary to ensure that
  all the flags and pointers that NLA Tweak Mode depends on are actually
  set correctly and consistently.

This also adds one utility function `BKE_nla_debug_print_flags()` that
is by now unused. It was very useful in debugging this, though, and I
think it'll be useful in the future as well.

Design task: #120573

Pull Request: https://projects.blender.org/blender/blender/pulls/120830
2024-04-22 14:56:05 +02:00
Sergey Sharybin
a48f685e2e Fix tracking slide zones are not intuitive under certain UI scale/zoom
This is a regression caused by some previous refactor of the code,
which was preparing it for transition to a tool-based tracking
workflow. Some of the hot zones got tweaked, and a change in the
behavior was done so that when click happens far away from any
slidable marker "widget" all markers gets de-selected (which
matches behavior in 3D viewport).

The pixel tolerance did not apply UI scale factor, and applied
zoom level after squaring (which is wrong calculation of pixel
space in screen space).

Ref #119773

Pull Request: https://projects.blender.org/blender/blender/pulls/119971
2024-04-22 14:44:42 +02:00
Aras Pranckevicius
91f0368fe2 Fix #120871: VSE crashes when sound strip has hold start offset larger than start
Caused by addition of new code in 4e10aa6e71, which was not guarding
against negative frame values. The only other place that called
BKE_sound_set_scene_sound_pitch_constant_range guarded against negative
frames (added in 1fb692e896 + 49a0502f35), but generally it looks like
negative frames are a "no no" in audaspace, so just move the value
sanitization into BKE_sound_set_scene_sound_pitch_constant_range itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/120891
2024-04-22 14:44:05 +02:00
Sietse Brouwer
4fbef3dc6b GPv3: Cutter tool
This PR implements the Cutter Tool for GPv3. The Cutter tool deletes
points in between intersecting strokes. New points are created at the
exact intersection points, so as a result the cutted strokes will fit
perfectly.

For feature parity, the tool follows the GPv2 behavior:

- The cutter tool works on all editable layers.
- Intersections are only detected for curves on the same layer,
so intersection of curves on _seperate_ layers are not handled.

Technical notes
The implementation uses the `compute_topology_change` function
created for the Hard Eraser. So at intersection points, point
attributes will be interpolated.

Pull Request: https://projects.blender.org/blender/blender/pulls/113953
2024-04-22 14:05:22 +02:00
Jacques Lucke
ed111e1907 Fix: assert when opening debug build with OpenGL backend
Can't use `GPU_type_matches` there, because it requires `GPG.init` to be called beforehand.

Pull Request: https://projects.blender.org/blender/blender/pulls/120928
2024-04-22 13:57:18 +02:00
Jacques Lucke
1609541bbf Fix #120875: crash when deleting all group output nodes
This didn't take `geometry_nodes_default_cpp_value` into account properly.
2024-04-22 13:29:51 +02:00
Jeroen Bakker
0c2085a316 GPU: Remove GPU_compute_shader_support
Compute shaders are required since 4.0. There was one occasion where
an older AMD driver failed and support was turned off. This driver
is now marked unsupported.

This PR includes:
- removing the check in viewport compositing
- remove properties from system info
- always construct draw manager.
- remove unused pass logic in draw hair/curves
- add deprecation warning when accessed from python

Pull Request: https://projects.blender.org/blender/blender/pulls/120909
2024-04-22 13:28:10 +02:00
Lukas Stockner
cc541f2c07 UI: Add Wavelength unit for scene-independent nanometer-scale inputs
Currently this is only used for the Wavelength node, but it will also be relevant for the Thin Film Interference support in the Principled BSDF.

Pull Request: https://projects.blender.org/blender/blender/pulls/120900
2024-04-22 13:10:16 +02:00
Pratik Borhade
f4894c098f Fix #120920: Can not edit strokes/points when materials array is empty
Return entire points/curves range if object has no material.

Pull Request: https://projects.blender.org/blender/blender/pulls/120923
2024-04-22 13:04:15 +02:00
Sybren A. Stüvel
43cd394832 Anim: Slider operators, prevent pass-through of Tab key
When a slider operator has only a single 'slider property', disregard
Tab keyboard events.

This fixes an issue where the Tab key would make the slider operator
misbehave in a way that required cancelling the operator and re-starting
it.

Context: Depending on the specific operator, Tab can be used to toggle
between different parameters. The generic handler for modal slider
operators didn't take this into account, though, and passed through the
Tab key to the rest of Blender, when it wasn't handled by the specific
operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/120922
2024-04-22 12:51:16 +02:00
Bartosz Kosiorek
a36d7774cc Physics: Enable liquid mesh generation by default
Previously mesh generation was disabled by default. This meant it was
only visible for wireframe or x-ray in the viewport, and not visible
in renders.

Pull Request: https://projects.blender.org/blender/blender/pulls/120832
2024-04-22 12:26:12 +02:00
Pratik Borhade
b153b25876 GPv3: Delete strokes not working from menu
This fails due to wrong/unnecessary invoke callback. Since this operator
does not have any property, `WM_menu_invoke` fails to call exec()
- - -
Steps to Reproduce:
- Add gpv3 stroke -> switch to edit mode
- Topbar -> Grease Pencil menu -> Delete -> Delete

Pull Request: https://projects.blender.org/blender/blender/pulls/120819
2024-04-22 12:12:34 +02:00
Chao Li
74b9c6a8a0 GPv3: Copy/Paste Keyframes
This commit implements Copy and Past Keyframes for GPv3.
The copy operator copies the selected GPv3 keyframes and the paste
operator paste the keyframes from the clipboard.
See #113110.

Pull Request: https://projects.blender.org/blender/blender/pulls/117388
2024-04-22 12:06:21 +02:00
Sietse Brouwer
f4a1095245 Fix: GPv3: Non-edit mode tools unaware of stroke positions changed by modifiers
All tools in Draw Mode, Sculpt Mode and Weight Paint Mode didn't work
correctly when the position of strokes was changed by modifiers.

In technical terms this was caused by
`get_evaluated_grease_pencil_drawing_deformation()`: when not in Edit
Mode, it effectively always returned the original position of stroke points
instead of the modified ones. In this PR there is a little fix for that.

Pull Request: https://projects.blender.org/blender/blender/pulls/120672
2024-04-22 11:41:31 +02:00
casey bianco-davis
2df13ce4a3 GPv3: Primitive Tools: Line, Polyline, Arc, Curve, Box and Circle Tool
Adds the primitive tools in draw mode to GPv3.

This also adds rotation and scale sub-operators with `r` and `s` keybinds.
Also all control points are editable after extruding.

Pull Request: https://projects.blender.org/blender/blender/pulls/119039
2024-04-22 10:48:03 +02:00
Jacques Lucke
d02bab4c44 Fix #120707: invalid persistent modifier uid when creating liquid 2024-04-22 09:47:00 +02:00
Jacques Lucke
1ad633187e Fix #120805: crash when using multiple curves attributes in shader
Currently, `cache.eval_cache.final.attributes_buf[i] != nullptr` is used as
high level check to see if attributes need to be recomputed. However, this
buffer was not freed when a related buffer was freed that has to be
recomputed.
2024-04-22 09:39:30 +02:00
Sietse Brouwer
7b7e9f224c GPv3: Fix incorrect multi-frame falloff factor due to miscalculation in frame range
The multi frame falloff factor was calculated incorrectly due to a
`min`/`max` typo in the function that established the frame range.

Pull Request: https://projects.blender.org/blender/blender/pulls/120870
2024-04-22 08:38:00 +02:00
Jeroen Bakker
6106bb3d3b GPU: Remove Compute test from test cases
Test cases that uses compute shaders were exited when run on platforms
not supporting compute shaders. Since 4.0 Blender requires a platform
that supports compute shaders.

We should eventually phase out `GPU_compute_shader_support` as it
would always return true. Note that in OpenGL a platform is mentioned
that doesn't support compute shaders, but that is from an old driver
and should be save to remove as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/120907
2024-04-22 06:55:09 +02:00
Jeroen Bakker
e6fad4b779 Vulkan: Fix memory leak in render graph
There was a memory leak in the render graph where nodes where freed,
but not the data it could keep. Detected during adding support for
compute shaders and running the draw tests.

Pull Request: https://projects.blender.org/blender/blender/pulls/120906
2024-04-22 06:22:31 +02:00
Hans Goudey
3539cdfbdd Cleanup: Use const for sculpt automasking cache 2024-04-21 20:21:22 -04:00
Jeroen Bakker
1d9d0f0056 Vulkan: Missing include when compiling draw tests
MoltenVK includes are not found when compiling draw tests on certain
configurations. It has to do with the number of ways the VulkanSDK and
MoltenVK can be configured. Other executables the molten vk was included
to the system includes, except when compiling drawing tests.

This PR will equalize the includes how MoltenVK between the different
binaries

Pull Request: https://projects.blender.org/blender/blender/pulls/120888
2024-04-21 17:39:08 +02:00
Jeroen Bakker
463a4c6211 Cleanup: Move specialization constant default hash
The specialization constant default hash was implemented in gl_shader.hh
But the same implementation is needed for vulkan. This PR moves the
default hash to a common place where both backends can use it.

Pull Request: https://projects.blender.org/blender/blender/pulls/120889
2024-04-21 16:56:00 +02:00
Fermin
821b773d95 FIX #109121: VR: Render controllers only if they are active
When turning on VR mode, if no controllers are available,
a fallback model (a sphere) is rendered in the middle of the VR area.

This change uses the OpenXR API to check if the controllers are
available, sets new properties in `GHOST_XrPose` and `wmXrController`
that store if each controller is active or not, and uses
those properties to render the controllers in the VR view only
when they are active.

NOTE: in `wmXrController`, two state properties have been included,
but only `grip_active` is currently used. `aim_active` has been
included for consistency, but it could be removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/119989
2024-04-21 03:28:35 +02:00
Aras Pranckevicius
689fce50bd Fix #120789: Slowness when using image vectorscope opacity slider
Since image vectorscope RGB mode addition (567455124d), changing
the opacity was causing the scope to get recalculated from scratch,
because opacity value was put into vecscope_rgb data directly.

Instead of that, make vecscope_rgb data only contain RGB, and fill in
the GPU vertex buffer alpha values when creating the GPU batch.

Now tweaking the scope opacity slider feels at about the same
performance as in 4.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/120854
2024-04-20 17:08:56 +02:00
Sybren A. Stüvel
933f74ca02 Anim: Baklava, add Animation data-block to anim filtering code
Add minimal support for the `Animation` data-block to the anim filtering
code. This means:

- F-Curves in the `Animation` data-block are shown in the Dope Sheet and
  Graph Editor.
- The `Animation` is shown underneath each animated data-block, just
  like an `Action` would be.
- Contrary to Actions, the expanded/collapsed state is stored on
  `id->adt` and not on `Animation`. Because an `Animation` is intended
  to be used by multiple data-blocks, they each should have their own
  flag for this.
- In the filtering code, this PR adds the 'fillanim' channel type. This
  is simply mimicking the name from the Action's 'fillact' type.

Limitations:

- Deleting of F-Curves is explicitly blocked, as that'll be introduced
  in a later PR. The block prevents Blender from crashing.
- The Dope Sheet doesn't have an Animation mode yet, that'll be for a
  later PR too.

Pull Request: https://projects.blender.org/blender/blender/pulls/120654
2024-04-20 12:19:16 +02:00
Sybren A. Stüvel
075b4c178a Refactor: Anim, clarify a bit of NLA drawing code
Clarify the code in `nla_draw_strip()` by extracting some flags into
booleans, and renaming some variables.

- `solo` is flipped in value, and renamed to `is_other_track_soloed`, as
  this is what is actually modelled by the variable.
- The check for the `NLASTRIP_FLAG_INVALID_LOCATION` flag is stored in a
  `const bool` to aid in debugging.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/120828
2024-04-20 11:25:39 +02:00
Pratik Borhade
eea73bffb4 UI: Fade all non-ID children if parent is hidden in outliner
Part of !120397.
For non-id tree elements, call `element_should_draw_faded` and get the
fade status of their parent. For example, this will fix the fading of
modifier, actions, bones, etc. in outliner.

Pull Request: https://projects.blender.org/blender/blender/pulls/120813
2024-04-20 10:46:12 +02:00
Clément Foucault
df064270a1 Fix: EEVEE-Next: Light: Missing shadows inside sphere light
The function `light_sphere_disk_radius` was misbehaved inside
the sphere. The LTC code has a early return but the shadow
code has not. In any cases, this patch avoids NaN issue.
2024-04-20 09:01:03 +02:00
Guillermo Venegas
1587abc148 Fix #119854: Avoid unsetting HIDDEN flag on properties
Ref !119881
2024-04-20 14:59:32 +10:00