Commit Graph

128525 Commits

Author SHA1 Message Date
Jacques Lucke
9dda646ea3 Fix: try to call unavailable operator
This issue was introduced in d1fbc69e0331d569b1277cfe931d0ba2c9551624,
not exactly sure why this was renamed.
2023-09-26 11:28:12 +02:00
Jeroen Bakker
8f9c14145e EEVEE-Next: Fix World Reflection During Raytracing
Scenes that only uses a world probe would didn't work. Raytracing
would look for the closest light probe, didn't find any and shader
would use undefined behavior to sample in the reflectionProbes texture.

In some cases this resulted in correct results when the world was
located on layer 0 with subdivision 0. In any other case this would
sample incorrect incoming light what lead to black reflections.

This PR fixes this by returning the world probe when no nearest light
probe cound be found.

Pull Request: https://projects.blender.org/blender/blender/pulls/112893
2023-09-26 11:19:04 +02:00
Xavier Hallade
729e86d5a3 Cycles: oneAPI: fix perf regression by inlining svm_node_closure_bsdf
158dbc1b101b5c94596d21845dc0ad31bfdbc5b1 introduced a ~9% performance
regression on Intel GPUs, which we recover through this targeted change.

Pull Request: https://projects.blender.org/blender/blender/pulls/112878
2023-09-26 10:53:39 +02:00
Jeroen Bakker
aebcec0493 EEVEE: Fix Shader Compilation
Pull Request: https://projects.blender.org/blender/blender/pulls/112890
2023-09-26 10:24:47 +02:00
Clément Foucault
0a4fa62f51 EEVEE: Add support for metallic F82 tint
This adds a new entry to the split sum LUT to isolate
the effect of the F82 tint.

The application of the tint part is similar to cycles
and uses the same way for precomputing the `b` factor.

Results matches almost perfectly to the extent of the
split sum approximation.

Note that this removes the unused LTC MAG LUT for
EEVEE next to make space for the new table. It can still
be added back if needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/112881
2023-09-26 10:16:39 +02:00
Jeroen Bakker
3514d6ed52 Cleanup: Make format 2023-09-26 08:58:04 +02:00
Hans Goudey
d1fbc69e03 Cleanup: Move logic out of loops, remove unnecessary ui sublayouts 2023-09-25 22:07:11 -04:00
Hans Goudey
0cb01332f1 Cleanup: Consistency between asset-extended menu UI templates
Define the UI template in the namespace of its own module, and
consistently use references and const in those UI template functions.
2023-09-25 21:58:30 -04:00
Hans Goudey
34a1b5bdbd Fix: Node tools shortcuts don't display in menus
Since the menus are defined in the header region, but the keymap is part
of the 3D view window region, we need to specify that when creating the
operator buttons.
2023-09-25 21:41:50 -04:00
Hans Goudey
2aa393e727 Cleanup: Remove unnecessary struct keyword in BKE_screen.hh 2023-09-25 17:53:11 -04:00
Hans Goudey
916d4c9d9b Cleanup: Move BKE_screen.h to C++
See #103343
2023-09-25 17:53:11 -04:00
Michael Jones
1c1c6ac457 Cycles: Fix last failing unit test (T39823) on MetalRT
This PR fixes T39823, the sole failing unit test when running with MetalRT.  It does so by implementing and binding a missing intersection handler (`__anyhit__cycles_metalrt_volume_test_tri`) which is required for `scene_intersect_volume` (as used by `integrator_volume_stack_update_for_subsurface`) to work as intended. This scene exposed the error as it uses subsurface scattering on a sphere which is intersected by volume.

Pull Request: https://projects.blender.org/blender/blender/pulls/112876
2023-09-25 22:41:27 +02:00
Clément Foucault
bea13af81a Fix Realtime Compositor: Fix shader compilation on Metal 2023-09-25 22:00:06 +02:00
Jason Fielder
ee03bb38cb Metal: Add support for atomic image operations
Texture Atomics have been added in Metal 3.1
and enable the original implementations of
shadow update and irradiance cache baking.

However, a fallback solution will be
required for versions under macOS 14.0 utilising
buffer-backed textures instead.

This patch also includes a stub implementation if
building/running on older macOS versions which
provides locally-synchronized texture access in
place of atomics. This enables some effects to be
partially tested, and ensures non-guarded use
of imageAtomic functions does not result
in compilation failure.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/112866
2023-09-25 21:56:46 +02:00
Miguel Pozo
499c39cfb9 Fix #112867: Workbench: Final render fails to render hair
Add missing calls to the old draw manager functions.
2023-09-25 21:15:56 +02:00
Michael Jones
39baa94427 Cycles: Throttle MetalRT BVH builds to avoid exceeding working set limits
This patch adds `BVHMetalBuildThrottler` which limits the amount of Metal BVH building work that runs concurrently on the GPU. Previously we submitted BVH build requests to the GPU as fast as possible, but in extreme cases this could fail when the device's working set size passes safe limits.

Pull Request: https://projects.blender.org/blender/blender/pulls/112821
2023-09-25 20:20:17 +02:00
Miguel Pozo
0dfcde3fde Fix: EEVEE-Next: Ensure volume property textures are cleared
Clear volume property textures when there's no valid world volume
shader.

Pull Request: https://projects.blender.org/blender/blender/pulls/112871
2023-09-25 19:54:51 +02:00
Brecht Van Lommel
a469640861 USD: improve I/O of emission color in preview surface
Don't export color if strength is 0, and on import set strength to 1 when
there is a color. This is more important now that the default is color white
and strength 0 in the Principled BSDF.

Ref #99447
Ref #112848
2023-09-25 19:51:31 +02:00
Brecht Van Lommel
3d38b51435 Shaders: add "Weight" to Transmission/Subsurface/Coat/Sheen socket names
Ref #99447
Ref #112848
2023-09-25 19:51:27 +02:00
Brecht Van Lommel
1d265eed5d Shaders: rename Specular to Specular IOR Level in Principled BSDF
To clarify that this is no longer the primary control, but rather
and adjustment on IOR.

Ref #99447
Ref #112552
2023-09-25 19:51:22 +02:00
Brecht Van Lommel
239edb27ad EEVEE: optimize principled BSDF by skipping unused components
Ref #99447
Ref #112848
2023-09-25 19:51:17 +02:00
Alaska
a03ee1af81 Shaders: clamp various shader inputs for Principled BSDF
Ref #99447

Pull Request: https://projects.blender.org/blender/blender/pulls/112774
2023-09-25 19:51:12 +02:00
Lukas Stockner
6e2f29b421 Shader: change Specular input on Principled BSDF to affect IOR
This keeps the behavior similar to the Disney BRDF, where 0.5
is neutral and lower/higher values respectively decrease/increase
the dielectric specular. But it's more correct in that it's not
an arbitrary scale on Fresnel, but rather adjusting the IOR.

Ref #99447
Ref #112848

Pull Request: https://projects.blender.org/blender/blender/pulls/112552
2023-09-25 19:51:02 +02:00
Brecht Van Lommel
3d986b81c5 Shaders: move subsurface scale input below radius in Principled BSDF
To help clarify that this is a scale on the radius.

Ref #99447
Ref #112848
2023-09-25 19:50:56 +02:00
Brecht Van Lommel
3e3bdc9b89 Shader: rename subsurface scattering methods and change default
Clarify that one was specifically designed for skin shading.

Ref #99447
Ref #112848
2023-09-25 19:50:50 +02:00
Brecht Van Lommel
334027063e Shader: use single Principled BSDF input for metallic and specular tint
To match Standard Surface and OpenPBR.

Ref #99447
Ref #112848
2023-09-25 19:50:44 +02:00
Brecht Van Lommel
ca5f1c0f00 Shaders: rename Principled BSDF Emission to Emission Color
Ref #99447
Ref #112848
2023-09-25 19:50:41 +02:00
Weizhen Huang
def9b76207 Shader: Change specular tint in Principled BSDF from float to color
For more artistic control. Tints the reflection of dielectric materials
at normal incidence.

Ref #99447

Pull Request: https://projects.blender.org/blender/blender/pulls/112192
2023-09-25 19:42:05 +02:00
Lukas Stockner
86156566a7 Cycles: Add Metallic Tint to Principled BSDF using F82-Tint model
With the default value, this is backwards-compatible.

Ref #99447

Pull Request: https://projects.blender.org/blender/blender/pulls/112551
2023-09-25 19:42:05 +02:00
Lukas Stockner
7eead8912d Fix Cycles OSL potentially skipping closures when using layering
Pull Request: https://projects.blender.org/blender/blender/pulls/112213
2023-09-25 19:42:05 +02:00
Hans Goudey
7e0691d027 Fix: Grammar in operator description 2023-09-25 13:25:32 -04:00
Pablo Vazquez
9a3131323b UI: About: Update links and labels
Following f7af45ccfd, rename link labels:

* Release Notes -> What's New
* Development Fund -> Donate

The description are left as is since they
are still correct, just the labels to be more
in line with language used in blender.org
2023-09-25 18:40:36 +02:00
Pablo Vazquez
f7af45ccfd UI: Splash: Small changes to links and labels
* Rename "Development Fund" to "Donate", more in line with
  the language used in blender.org
* Rename "Release Notes" to "What's New". A bit more inviting
  to click and sounds less technical.
* In "Getting Started", remove "Credits" since it it nos related
  to getting started, and add relevant links already present
  in the Help menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/112741
2023-09-25 18:09:02 +02:00
b8c96d1b03 Fix #112059: Anim, Unable to add drivers to bone collections visibility
Previously it was possible to use drivers to manipulate armature layer
visibility, and now it's also possible to animate & drive bone collection
visibility.
2023-09-25 18:02:47 +02:00
Sergey Sharybin
19db9a213e Light linking: Allow re-ordering in the light linking collections
The order of collections in the light linking collection is important
as it is used for tie-breaking when the same object is reachable from
multiple linked collections with different light linking state.

This commit utilizes the generic tree view reordering operations to
allow insertion of elements to a specific location and to re-order
existing objects and collections in the light linking collection.

It is possible to re-order both collections and objects, even tough
re-ordering objects does not really make a difference for the light
linking behavior. It is not possible to place an object before
collections.

Pull Request: https://projects.blender.org/blender/blender/pulls/112849
2023-09-25 18:00:28 +02:00
ac1c5d943c Anim: make ANIM_bonecolor_posebone_get handle const only
The color returned by `ANIM_bonecolor_posebone_get()` is not supposed
to be edited, so just return it as `const` and take a `const bPoseChannel`
as argument.

This makes the function usable in a wider range of situations, for example
the drawing code (which shouldn't alter any of these colors).
2023-09-25 17:29:04 +02:00
Pablo Vazquez
05fc31f27f UI: Remove redundant "Context Menu" in menu titles
Context menus are a type of menu, like header menus, there is no need to mention
the type as part of the name since it is implied by context.

Pull Request: https://projects.blender.org/blender/blender/pulls/112662
2023-09-25 16:25:55 +02:00
Sergey Sharybin
489693ef6d Light linking: Use checkbox icons for state indication
This is as per design task #104972

The same icons as exclusion in the outliner are used.

Pull Request: https://projects.blender.org/blender/blender/pulls/112857
2023-09-25 15:29:49 +02:00
persun
90d8a07213 UI: Move "Reset Recent" inside a menu
Move the File Browser's `Reset Recent` button into a menu to prevent
accidental clicks of a destructive operation.

Also rename it to a more descriptive  `Clear Recent Items`, and since
the word "Reset" is used for resetting values to default.

Pull Request: https://projects.blender.org/blender/blender/pulls/112853
2023-09-25 15:15:53 +02:00
Clément Foucault
f2fb74d30c Fix #112802: EEVEE-Next: Invalid weight when mixing closures
This was caused by a weight of 0 leading to `x = 0 / 0` which
resulted in NaNs and missing closure data.

Pull Request: https://projects.blender.org/blender/blender/pulls/112855
2023-09-25 15:14:45 +02:00
Omar Emara
6b53fd5cf6 Realtime Compositor: Allow more result types
Previously, the Result class was reserved for inputs and outputs of
operations, so its allowed types were naturally those exposed to the
user. However, we now use the Result class internally for intermediate
results, so it now makes sense to expend the allowed types.

The types are now divided into two categories, those that are user
facing and need to be handled in implicit operations and those that
are internal and can be exempt from such handling. Internal types are
reserved for texture results, as the single value mechanism is only
useful for user facing results.

The patch merely adjusts the switch cases across the code base, adding
one new internal type as an example.

Pull Request: https://projects.blender.org/blender/blender/pulls/112414
2023-09-25 15:12:52 +02:00
Michael Jones
b7fe84d9bc Cycles: Fix #107714: Leak during MetalRT BVH buid
This patch fixes the memory leak described in #107714 by adding an `@autoreleasepool` around Metal BVH builds. Certain NSObjects were being retained indefinitely, specifically ones which had been value-passed via an NSArray into acceleration structure descriptors.

Pull Request: https://projects.blender.org/blender/blender/pulls/112820
2023-09-25 14:57:17 +02:00
Michael Jones
b8833a7f8c Cycles: Disable NanoVDB if not needed when specialising Metal PSOs
This patch adds a check to see whether we're actually using NanoVDB textures, and if not, removes `#define WITH_NANOVDB` when generating the scene-optimised kernels. This results in marginally faster render times (maybe 2 or 3%) for scenes that do not use NanoVDB. The generic kernels are unaffected, so this will not impact responsiveness on first render.

Pull Request: https://projects.blender.org/blender/blender/pulls/112822
2023-09-25 14:56:58 +02:00
Colin Basnett
166f7c7a98 Assets: Add full_path attribute to AssetRepresentation
The current documentation on `AssetRepresentation.full_library_path` indicates
that it will give the fully qualified path to the asset (the path to the
`.blend` file extended with the path to the asset).

This is not the case however, and it only returns the path to the `.blend`
file, leaving there no way to actually get an easy-to-use path to the asset.

This commit adds a new `full_path` property to `AssetRepresentation` that lets
the user get the fully qualified path to the asset. The documentation for the
`full_library_path` has been updated to accurately reflect what it does.
2023-09-25 14:53:41 +02:00
eab95fa2aa Anim: enable visual keying of IK-influenced bones
Enable visual keying of bones that are influenced by an IK constraint.
This wasn't possible before, as the visual keying system only checked
constraints on the bone itself, and not whether the bone was part of an
IK chain.

This commit introduces a new `bPoseChannel::constflag` value
`PCHAN_INFLUENCED_BY_IK` that is set whenever the pose bone is part of
an IK chain.

The `pchan->constflag` field is computed during depsgraph evaluation. If
the depsgraph is active, it is now also written back to the original
pchan, so that it can be used in the "should visual keying be used"
function.

Fixes: #76791 "Different results when keyframing visual transforms and
applying transforms manually on IK constraint". Note that visually
keying does *not* copy the visual pose to the current pose. Furthermore,
when visually keying only part of the IK chain, the result of
re-evaluating the IK constraint (for example by moving the scene forward
and then backward by one frame) may still produce a different result, as
the IK chain now has a different start orientation.

Note that commit explicitly does not cover Spline IK constraints. They
can introduce heavy shear, especially with the default settings, which
cannot be represented by keys on loc/rot/scale.

For historical reference: 876cfc837e2f065fa370940ca578983d84c48a11
introduces the 'use visual keying' preference option, where Blender
automatically chooses whether or not to use visual keying. This is why
there is a function at all that determines whether to use visual keying
or not.
2023-09-25 14:37:22 +02:00
caf46c9fbb Refactor: anim, rename flag PCHAN_HAS_TARGET to PCHAN_HAS_NO_TARGET
Rename the `bPoseChannel::flag` `PCHAN_HAS_TARGET` to `PCHAN_HAS_NO_TARGET`
as that is actually the meaning of the flag (in the majority of the code).

Since the flag was so confusingly named, there were some mixups in the
armature overlay drawing code as well, which have been fixed now too.
2023-09-25 14:33:51 +02:00
0ddd0460f0 Anim, when removing bone constraints, clear the constflag
When removing all constraints from pose bones, just reset the `constflag`
field to `0`, instead of clearing out specific flags. It was already
missing a flag that should have been cleared.

Effectively no functional changes, just a nice cleanup.
2023-09-25 14:33:51 +02:00
05b725c744 Anim: redefine PCHAN_HAS_CONST flag to mean "has a constraint"
Change the definition of the `PCHAN_HAS_CONST` pose channel flag. It used
to mean "has a constraint that is not IK or Spline IK", and now it just
means "has a constraint".

This has no direct effect yet, as the flag is only used in drawing code
when there is no (spline) IK constraint. However, I feel that the flag
name should match its expected behaviour, and IMO, in this case, making
that behaviour simpler is better than documenting more.
2023-09-25 14:33:51 +02:00
12fc4b6c58 Refactor: anim, change if-elseif-else chain to switch + reduce iterations
Refactor `BKE_pose_channel_copy_data()` so that it iterates over the entire
armature only once (instead of twice), and to use a `switch` instead of
a chain of `if`/`else if`/`else` clauses.

No functional changes.
2023-09-25 14:33:51 +02:00
69bf3f4e9a Refactor: simplify visualkey_can_use() function
Just some reordering to simplify things, and to put the cheapest checks
first.

No functional changes, except for the addition of a `BLI_assert()` to
check cases in which this function shouldn't be called anyway.
2023-09-25 14:33:51 +02:00