Commit Graph

127055 Commits

Author SHA1 Message Date
Campbell Barton
0fb4c107db Makefile: remove "make authors"
Since adding authors involves checking if their contribution requested
exclusion from the AUTHORS list, this isn't an action that should be
run and committed without some manual checking.

Since the script works without arguments and isn't an action most
developers should be running & committing, having a convenience entry
isn't especially useful.
2023-08-18 09:26:02 +10:00
Campbell Barton
dbe0f0cfe0 Gitea: add note that developers must opt-out of inclusion in AUTHORS 2023-08-18 09:23:43 +10:00
Campbell Barton
74b4bb7c4c Doc: correct code-comment 2023-08-18 09:16:25 +10:00
Campbell Barton
bc1ffdce5b Cleanup: spelling in comments 2023-08-18 08:56:12 +10:00
Campbell Barton
bf35eb9cbc Cleanup: format 2023-08-18 08:38:02 +10:00
Almaz-Shinbay
28f4bb2007 Outliner: Port modifier elements to new tree-element code design
No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds new classes for modifier elements.

Pull Request: https://projects.blender.org/blender/blender/pulls/111114
2023-08-17 23:24:16 +02:00
Harley Acheson
d308f35896 UI: Make View3D Header Overlapped
Allow the View3D Header region to become transparent if "Region
Overlap" is enabled AND the Alpha of the Header's theme color is less
than 255. Basically its RGN_TYPE_HEADER and RGN_TYPE_TOOL_HEADER will
behave and look the same.

Pull Request: https://projects.blender.org/blender/blender/pulls/111194
2023-08-17 22:57:11 +02:00
Michael Kowalski
6f4cb9bc56 USD: Skeleton and blend shape import
Added support for UsdSkel animation import.

This addresses #110076.

Added USDSkeletonReader class which imports UsdSkelSkeleton primitives
as armatures.

Extended USDMeshReader to import UsdSkelBlendShape as shape keys.

Extended USDMeshReader to import USD skinning data as as deform groups
and an armature modifier on the mesh object.

Added USDMeshReader::get_local_usd_xform() to override the transform
computation to account for the binding transformation for skinned meshes.

Pull Request: https://projects.blender.org/blender/blender/pulls/110912
2023-08-17 20:11:51 +02:00
Bastien Montagne
1b25849ea6 Fix (unreported) missing handling of plane tracks' image ID pointer in MovieClip foreach_id code. 2023-08-17 19:58:07 +02:00
Bastien Montagne
75eb7ace73 Cleanup: move internal data handling from Mesh 'lib_link' to 'read_data' code.
No behavioral change expected from this commit.
2023-08-17 19:45:09 +02:00
Bastien Montagne
7d6e47a2b0 Fix (unreported) missing handling of Maks' spline parent ID pointer in foreach_id code. 2023-08-17 19:26:01 +02:00
Bastien Montagne
3822d8e3fc Fix (unreported) LineStyle foreach_id callback skipping some NULL ID pointers.
Not sure how bad that was in practice, was likely harmless. But
foreach_id logic should never decide to not process an ID pointer
because its value is NULL. Callback code is expected to handle NULL
pointers appropriately.
2023-08-17 19:19:05 +02:00
Bastien Montagne
a083e1cd0f Cleanup: Remove unused image Image pointer from LigthPrope data.
This pointer was fully unused, no point in keeping it around.
2023-08-17 18:57:54 +02:00
Bastien Montagne
3e0c95d1fc Cleanup: Remove unused parallax_ob Object pointer from LigthPrope data.
This pointer was fully unused, not even by 'bare metal' ID management
code (like foreach_id or lib_link areas). No point in keeping it around.
2023-08-17 18:45:19 +02:00
georgiy.m.markelov@gmail.com
37269c78d2 Hydra: saving changed to unpacking for packed images
For Hydra renderers to access packed images they need to be written to
disk. Previously it would save the image, but unpacking is much faster.

Ref: #110765

Pull Request: https://projects.blender.org/blender/blender/pulls/110933
2023-08-17 18:09:51 +02:00
Falk David
0bc755face Fix #109403: GP doesn't render selection outline
The issue was that there was a change in the shader that expected
a specific flag to be set. The current grease pencil code did not
set these flags.

This fix separates the old and new shader code so that
the old way of rendering the strokes remains untouched.

Pull Request: https://projects.blender.org/blender/blender/pulls/111227
2023-08-17 18:09:04 +02:00
Clément Foucault
672d25b02d EEVEE-Next: Shadow Rendering Refactor
Split shadow rendering per LOD per tilemap and improve
fragment shader invocation rate by using multi-viewport.

Also changes the layout of the atlas to be 4 x 4 x Layers.
This allow to grow the atlas while keeping the content
and page indirection correct, but this isn't implemented
in this patch.

# First attempt

Shadow rendering using atomic proved to be less than ideal
and performance were not quite to an acceptable level.

The previous method had issue with atomic contention when
a lot of triangle would overlap and too many fragment shader
invocations with quite complex indirection rules and biases
which made the technique costly.

The new implementation leverage multi viewport and
layered rendeing to effectively replace the need for atomic
and render directly to the shadow atlas. Using the well
supported extension these are free on modern hardware and
do not need a geometry shader.

One view per tile is needed since we use the viewport index
and the layer index as a way to index a specific tile in the
array.

# Geometric Complexity Problem

The counterpart of this is that we need to draw one geometry
instance per tile which is 32x32 time more instances (at most)
than with the previous method.

This means that we will have to find a way to mitigate this
geometry cost by either reducing the number of tiles per
tilemaps (in other words, making the system less memory efficient)
or splitting complex objects' geometry into smaller, more
cull friendly chunks (for example, like the sculpt PBVH nodes).
The later seems to be a longer term solution as it requires
way too much engineering time we have right now.

# Update Lag Problem

This also mean we can only update up to 64 tile per redraw
which is not enough even in the most basic cases. This leads
to missing or over shadowing when a light updates until there
is no updates and the shadow rendering can catch up.

One possible solution is to update a lower LODs first waiting
until there is no update to render. This would allow no artifact
during the transforms (unless there is too many light updates
even for lowest LOD, but that was an issue also for the
previous implementation). This could also help with the
geometric complexity.

# Solution

In the end, we decided to have one view per lod. This limits
the complexity of the fragment shader (improve speed),
reduces the number of views per tilemap (fix update lag),
and reduces the number of instances.
This also mean we cannot render directly to the atlas anymore
and reverted to the atomic solution. Using the smallest
possible viewport, we assure that there isn't that much fragment
shader invocations which was one of the bottleneck. And also
reduces the amount of geometry instances that pass the
clipping test.

Pull Request: https://projects.blender.org/blender/blender/pulls/110979
2023-08-17 17:35:19 +02:00
Sergey Sharybin
3a3390fcdd Cleanup: Strict compiler warning
Pull Request: https://projects.blender.org/blender/blender/pulls/111233
2023-08-17 17:22:08 +02:00
Omar Emara
9ef2310e5f Realtime Compositor: Implement Anisotropic Kuwahara
This patch implements the Anisotropic Kuwahara filter for the Realtime
compositor and replaces the existing CPU implementation with a new one to be
compatible with the GPU implementation. The implementation is based on three
papers on Anisotropic Kuwahara filtering, presented and detailed in the code.

The new implementation exposes two extra parameters that control the sharpness
and directionality of the output, giving more artistic freedom.

While the implementation is different from the existing CPU implementation, it
is a higher quality one that is also faster and conforms better to the methods
described in the papers.

Examples can be seen in the pull request description.

Pull Request: https://projects.blender.org/blender/blender/pulls/110786
2023-08-17 16:58:36 +02:00
Bastien Montagne
eb582b9441 Cleanup: move internal data handling from ScreenArea 'lib_link' to 'read_data' code.
No behavioral change expected from this commit.
2023-08-17 16:33:47 +02:00
Bastien Montagne
6033edd6b2 Cleanup: move internal data handling from Screen 'lib_link' to 'read_data' code.
No behavioral change expected from this commit.
2023-08-17 16:24:38 +02:00
Brecht Van Lommel
a5789eba98 Build: fix Xcode warnings related to integer conversion
Xcode enables additional warning flags by default. Disable some to match
command line build and other platforms more closely.

Ref #111193
2023-08-17 16:23:28 +02:00
Bastien Montagne
b454fc2161 Cleanup/Fix VSE readfile code, fully deprecate SEQ_TYPE_SOUND_HD.
This fixes a few related issues in VSE code:
* 'lib_link' code was doing 'read_data' tasks (like cleaning up internal
  runtime data).
* Handling of `SEQ_TYPE_SOUND_HD` deprecated type of strips was
  extremely confusing (versioning done partly in 'lib_link' code, partly
  in some 2.50 do_version code).
* Still using deprecated `SEQ_TYPE_SOUND_HD` strip type outside of
  versioning code.
* Missing proper usage of deprecated `SEQ_TYPE_SOUND_HD` type inside of
  versioning code (!).

Note that the actual conversion from `SEQ_TYPE_SOUND_HD` to
`SEQ_TYPE_SOUND_RAM` is now done in the 'after setup' versioning
process, where it is somewhat safer to add IDs. This implies that
`SEQ_TYPE_SOUND_HD` must be taken into account throughout the whole
regular versioning process (before and after liblink).

Conversion logic itself has been moved to the VSE code.

Pull Request: https://projects.blender.org/blender/blender/pulls/111135
2023-08-17 16:09:15 +02:00
Bastien Montagne
ff72c45ce1 Fix (unreported) missing texuser handling in SpaceProperties' foreach_id code. 2023-08-17 16:08:05 +02:00
Bastien Montagne
d7d487e13a Refactor: Move Editors' 'foreach_id' code into a new SpaceType callback.
Was a known pending TODO for quite some time already.

This commit should have no behavior change at all.
2023-08-17 16:08:05 +02:00
Jeroen Bakker
a80de9ed40 Fix Incorrect Merge GPencil/Overlay shaders
Only Metal shaders where broken
2023-08-17 15:56:58 +02:00
Jeroen Bakker
85c5bb89a0 Vulkan: Convert Eevee(-next) Stage Interfaces
This PR makes all static shaders in Eevee and Eevee-next compatible with Vulkan.
If required, dynamic shaders will be converted later on.

Pull Request: https://projects.blender.org/blender/blender/pulls/111224
2023-08-17 15:49:32 +02:00
Jeroen Bakker
6c9f6eefe9 Vulkan: Convert Workbench Stage Interfaces
Convert workbench stage interfaces to be compatible with Vulkan.

Pull Request: https://projects.blender.org/blender/blender/pulls/111221
2023-08-17 15:48:22 +02:00
Jeroen Bakker
667be8c49d Vulkan: Convert Overlay Stage Interfaces
Convert overlay stage interfaces to be compatible with vulkan.

Pull Request: https://projects.blender.org/blender/blender/pulls/111218
2023-08-17 15:47:36 +02:00
Sergey Sharybin
d0dcfb8159 Color management: Tweak compatible look check
Change compatible look check so that if the view contains
explicitly configured looks the non-explicit looks are not
added to the list.

In practice this means that if there are looks "Low Contrast"
and "AgX - Low Contrast" only the latter one is considered to
be compatible with the "AgX" view.

Ref #110685

Pull Request: https://projects.blender.org/blender/blender/pulls/111229
2023-08-17 15:40:34 +02:00
Sergey Sharybin
259bfc4553 Fix GradingPrimaryTransform OCIO transform in Metal
This transform generates code `if ( gamma != vec3(1., 1., 1.) )`
which is not compatible with Metal.

This patch adds an extra OCIO code processing which converts syntax
to a portable version. It only handles this specific case for the
processing performance reasons.

To reproduce the issue add the following look at the end of the
config.ocio:

```
  - !<Look>
    name: Grading
    process_space: Filmic Log
    description: TEST
    transform: !<GroupTransform>
      children:
        - !<GradingPrimaryTransform>
          style: log
          contrast: {rgb: [0.7, 0.7, 0.7], master: 1}
          saturation: 1.15
          pivot: {contrast: -0.2}
```

Ref #110685

Pull Request: https://projects.blender.org/blender/blender/pulls/111231
2023-08-17 15:27:51 +02:00
Jeroen Bakker
101c9383d7 Vulkan: Convert Grease Pencil Shaders
Converting grease pencil stage interfaces to be compatible with vulkan.

Pull Request: https://projects.blender.org/blender/blender/pulls/111222
2023-08-17 15:25:36 +02:00
Campbell Barton
b6c014c731 CMake: enable comma-subscript GCC warning 2023-08-17 23:17:30 +10:00
Omar Emara
110cb5d0d5 BLI: Add square function
This patch adds the square function for both float and vector math BLI
libraries. It also renames the corresponding GLSL function for
compatibility.

Pull Request: https://projects.blender.org/blender/blender/pulls/111217
2023-08-17 15:05:52 +02:00
Campbell Barton
ab18bd6f84 CMake: revert use of cmake_language as it's unavailable in v3.10
Using cmake_language caused an error with 3.10, so revert [0] & [1].

[0]: 206f126617602ffa0b46b4eb45a9d41b6047d24f
[1]: e95e6ad66a8341641b6086806ebcc5988ed12ac0
2023-08-17 23:00:31 +10:00
Sergey Sharybin
77f6c83bd5 Fix compilation error after recent commits to color management
Individually patches were fine, but they got some conflict
when both are applied.

Pull Request: https://projects.blender.org/blender/blender/pulls/111228
2023-08-17 14:47:49 +02:00
Falk David
5aacbf6c81 Fix: GPv3: Crash because of missing null check
There was a missing null check in the `TreeNode::name()`
function.
2023-08-17 14:41:26 +02:00
Sergey Sharybin
16c44700e9 Color management: Validate look is compatible with view on load
While currently the only way to reproduce the issue is to modify
the default OCIO configuration, change the view (which does yet
validate look on change) and save-reload, it seems to be a good
thing to validate anyway, to be more future-proof.

Pull Request: https://projects.blender.org/blender/blender/pulls/111209
2023-08-17 14:38:52 +02:00
Sergey Sharybin
241fac09dd Color management: Validate Look on View Transform changes
If the new view transform does not support the currently configured
look reset look to the default None, similar to the color management
verification on .blend file open.

Currently it is not a problem as all views support the same set of
looks. But with an upcoming addition of AgX it will no longer be
true.

Ref #110685

Pull Request: https://projects.blender.org/blender/blender/pulls/111185
2023-08-17 14:38:07 +02:00
Christoph Lendenfeld
2b30d26ae9 Refactor: resolution_scale in graph_draw.cc
Recent patches added a variable `resolution_scale`
This variable defines how many points on the x or y axis to add.
However I find the name confusing.

Instead of that, change it to `pixels_per_unit`
and move the `points_per_pixel` factor
to `calculate_bezt_draw_resolution`

no functional changes

Pull Request: https://projects.blender.org/blender/blender/pulls/111037
2023-08-17 14:25:16 +02:00
Pratik Borhade
594dceda7f Fix #89479: Unable to select hierarchies of multiple objects from outliner
`select hierarchy` is treated in similar way as we're selecting single element from outliner.
When `object_select_hierarchy_fn` is called for the first time, we clear select flag for all elements
in `outliner_item_select`. This causes issue when `select hierarchy` is called for multiple elements.
So fix is to not touch select and activate flags when `OL_ITEM_RECURSIVE` flag is set.

This also fixes the hierarchy selection when "sync select" is OFF.

Old Differential Revision: https://archive.blender.org/developer/D16804

Pull Request: https://projects.blender.org/blender/blender/pulls/104737
2023-08-17 13:23:46 +02:00
Sergey Sharybin
33718b2d75 Fix #111165: Regression: Blender Crashes On Scene Switch
Fix missing depsgraph tag in the "Link Objects to Scene" operator.

Pull Request: https://projects.blender.org/blender/blender/pulls/111214
2023-08-17 11:31:59 +02:00
Jeroen Bakker
53396816e4 Vulkan: Make Polyline Shaders Vulkan Compatible
Splitting interface stages based on the interpolation of its
attributes.

Then naming convention that have been used:

* use `interp` as instance name when using smooth interpolation
* use `interp_noperspective` when using no perpective interpolation
* use `interp_flat` when using flat interpolation

The same suffix will be added to the struct names.
The naming convention will be added to the GLSL code style and
applied to other shaders as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/111210
2023-08-17 11:31:10 +02:00
Bastien Montagne
a99cccaff8 Fix (unreported) WM 'foreach_id' code skipping unpinned_scene pointer.
Previous code would not process that ID pointer in case the
`workspace_hook` pointer was null.
2023-08-17 10:57:58 +02:00
Jeroen Bakker
826ebccb42 Cleanup: Make format 2023-08-17 10:53:53 +02:00
Jeroen Bakker
074f10470c Vulkan: Add Workaround for Mixed Interpolation Attributes
shaderc generates an error when a struct containing an int type
isn't qualified as flat. We work around this issue by changing the
interpolation mode to flat during code generation.

Pull Request: https://projects.blender.org/blender/blender/pulls/111211
2023-08-17 10:53:05 +02:00
Christoph Lendenfeld
bb8766ef01 Animation: Match Slope slider
It blends selected keys to the slope of neighboring ones.
It is used to push the segment closer to the values of the next or previous pose.

Co-authored-by: Ares Deveaux <aresdevo@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/110567
2023-08-17 10:28:46 +02:00
0e2875ede9 Prevent crash when color management is turned off
Prevent a segmentation fault when the viewport is set to 'Material Preview'
mode, drawing textures, and Blender built with `WITH_OPENCOLORIO=OFF`.

Most `IMB_colormanagement_...` functions assume that the `colorspace`
pointer can be `nullptr`, but the internal function
`colormanage_ensure_srgb_scene_linear_info()` does not, causing a crash.

Since this check can be done in multiple places, I picked one that seems
consistent with the rest of the code.

Pull Request: https://projects.blender.org/blender/blender/pulls/111144
2023-08-17 10:21:09 +02:00
Jeroen Bakker
f44447a628 Vulkan: Use Correct Interpolation Qualifier in Stage Interfaces
This PR cleans up the Stage Interface code generation and use the
correct interpolation qualifier. This is a cleanup/fix before we can
start converting shaders stage interfaces to be compatible with vulkan.

Ref: #111138 for more information about vulkan compatibility
Pull Request: https://projects.blender.org/blender/blender/pulls/111207
2023-08-17 09:40:34 +02:00
Jeroen Bakker
6f9c3b1bd5 Vulkan: Report Incompatible Shaders
A difference was detected between stage interfaces between OpenGL and Vulkan
that are not compatible with our current API.

**OpenGL**

In OpenGL an stage interface struct can have different interpolation qualifiers
per attribute.

```glsl
struct MyStageInterface {
    smooth vec4 color;
    flat int face_flag;
};
layout(..) MyStageInterface interp;
```

**Vulkan**

In vulkan the interpolation qualifier isn't supported on attribute
level and needs to be added to the struct.

```glsl
struct MyStageInterface {
    vec4 color;
};
struct MyStageInterface_flat {
    int face_flag;
};
layout(..) smooth MyStageInterface interp;
layout(..) flat MyStageInterface_flat interp_flat;
```

This patch reports shaders that are incompatible with Vulkan so they can be
patched. Report is only done in debug mode and when using the vulkan backend.
After all shaders are patched an error will be raised so developers will
known immediately when incompatibility are created.

Making the shaders compatible and adding the error will be done in future
patches.

**Python**

Via Python gpu module (gpu.types.GPUShaderCreateInfo) it isn't possible
to construct an incompatible shader as instance names cannot be set
via the API. So this isn't a breaking change.

Pull Request: https://projects.blender.org/blender/blender/pulls/111138
2023-08-17 08:59:03 +02:00