Commit Graph

130221 Commits

Author SHA1 Message Date
Sergey Sharybin
db16038f4f Depsgraph: Log depsgraph name for timing summary
No functional changes, just makes logs more clear.
2023-11-13 11:54:39 +01:00
Sergey Sharybin
c723c69ede Compositor: Set dependency graph debug name
No functional changes on user level, just makes reading
timing information easier.
2023-11-13 11:54:39 +01:00
Iliya Katueshenock
4f03d502e6 Cleanup: Remove iostreams include from timeit header
Continuation of #110986

Pull Request: https://projects.blender.org/blender/blender/pulls/111010
2023-11-13 10:42:29 +01:00
Hans Goudey
df960e5fc3 Cleanup: Use C++ math functions in mesh normals code
Pull Request: https://projects.blender.org/blender/blender/pulls/114777
2023-11-13 10:32:01 +01:00
Jeroen Bakker
37d04f030d Cleanup: Make format 2023-11-13 08:12:39 +01:00
Ray Molenkamp
3816fcd861 Fix: build error with MSVC
BLI_math_base.h is still required to get defines like M_PI
2023-11-12 08:36:39 -07:00
Antonio Vazquez
7c899d2271 GPv3: Set caps operator
This operator is similar to V2 GPENCIL_OT_caps_set to set the type of cap used by the stroke curve.

Related to #113977

Pull Request: https://projects.blender.org/blender/blender/pulls/113978
2023-11-12 14:13:13 +01:00
Iliya Katueshenock
5c52d42350 Cleanup: Geometry Nodes: Early returns in Shortest Edge Paths node
Pull Request: https://projects.blender.org/blender/blender/pulls/114684
2023-11-11 23:50:58 +01:00
Hans Goudey
0d1831cd2e Cleanup: Small cleanups to mesh normals calculation
- Use consistent data fetch order
- Slightly tweak whitespace
- Use C++ vector type and math function
2023-11-11 22:41:21 +01:00
Hans Goudey
6273205c93 Fix: Debug build error after previous commit
To avoid including the C header in the C++ header, reference
the define by name for now.
2023-11-11 22:15:02 +01:00
Hans Goudey
583bd9662e Cleanup: Remove C header from C++ math header
Remove some redundancy between headers, more fully
separate the C++ headers from the older C headers.

Pull Request: https://projects.blender.org/blender/blender/pulls/114705
2023-11-11 21:09:54 +01:00
Campbell Barton
8b4c9b294a Cleanup: quiet warning building WITH_GMP=OFF 2023-11-11 19:53:46 +11:00
Campbell Barton
7d99be77f7 Cleanup: rename data -> ghost_data in wm_playanim
Follow naming convention used elsewhere in wm_playanim.cc.
2023-11-11 19:52:30 +11:00
Germano Cavalcante
172221e7fb Fix #114714: Rotating the View can drastically change the view's position when Auto Depth or Orbit Arround Select is set
Caused by 6faa39edb7

In that commit it was assumed that the view offset does not need to be
updated if the operator is `V3D_OP_MODE_ROTATE` instead of simply
checking `this->use_dyn_ofs`.

Since `use_dyn_ofs` is always `True` when using Auto Depth or Orbit
Arround Select, the offset should always be updated in these cases.
2023-11-10 19:07:25 -03:00
Sebastian Parborg
eaef914487 CMake: Allow building with system Vulkan and ShaderC
Previously the cmake code would try to run the LIBDIR specific "findX.cmake" files for both vulkan and shaderc.

However these would pick up system headers and libraries when LIBDIR were not present. This would lead to compilation errors as the system library configurations were not taken into account or queried.

This changes it so that if LIBDIR is not present, the proper pkgconfig files will be used instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/114639
2023-11-10 18:10:41 +01:00
Iliya Katueshenock
8618547dfe Cleanup: Geometry Nodes: General topology map creation in Shortest Edge Paths
Use general util to build mesh topology map instead of array of vectors.
This util can be optimized in future by better multithreading and new
algorithms with better CPU catch heuristics. For now this will provide
better usage of memory without a lot of small allocations.

Pull Request: https://projects.blender.org/blender/blender/pulls/114683
2023-11-10 15:20:56 +01:00
Jeroen Bakker
2a24e29241 Vulkan: Convert 3 Component Texture Formats
3 component texture formats are often not supported by vulkan devices.
Sometimes the support is less than 5%. The 4 components variants have
more than 90% support.

This PR builds on top of the existing vulkan data conversion to add
the ability to convert between RGB16F<=>RGBA16F and RGB32F<=>RGBA32F
texture formats.

This allows using color management other then Standard/sRGB. Most places
the 3 component texture formats are phased out, but OCIO, external
render engines and real time compositor uses them.

Pull Request: https://projects.blender.org/blender/blender/pulls/114708
2023-11-10 15:19:24 +01:00
Hans Goudey
5052e0d407 Mesh: Make vertex normal calculation deterministic
Currently, atomic additions in vertex normal calculation introduce
non-determinism that can influence the result of other operations,
sometimes causing non-reproduceable renders (in cases like #100250
and #101726). This is because the order used during threading when
accumulating face normals changes.

This commit fixes that non-determinism, using a vertex to face topology
map to calculate vertex normals without atomics. When the map is already
available, this can be faster too.

In the longer term future, this method of vertex normal calculation
means it will be easier to do partial recalculations when only part
of a mesh changes. That might be essential for cases like transforming
small selections in a non-BMesh edit mode.

As an experiment I tried a "fast" code path that avoids weighting face
normals by the corresponding corner angle when averaging them to
create vertex normals. This significantly reduces the necessary
computation and memory bandwidth for vertex normal calculation.
The results are shown below too, but it's not part of this PR.

I measured the FPS with two smooth shaded 16 million face grids:
|                                  | Before | After | After (fast) |
| -------------------------------- | ------ | ----- | ------------ |
| Created from scratch every frame | 0.96   | 0.91  | 0.92         |
| Deformed by geometry nodes       | 0.99   | 1.32  | 1.40         |

Though many other things besides normals are being tested here,
it's clear that the performance difference isn't that large either way,
though there is an observable regression with meshes created from
scratch, and there is a noticeable improvement when the topology
stays the same and is persistent.

Pull Request: https://projects.blender.org/blender/blender/pulls/111718
2023-11-10 15:19:01 +01:00
Bastien Montagne
cb5f650a5a Merge branch 'blender-v4.0-release' 2023-11-10 14:41:46 +01:00
Bastien Montagne
c688b03847 Fix (studio-reported) VSE prefetch process taking seconds to stop.
When VSE cache is invalidated (on most VSE edit operation e.g.), or
Blender quits, in some cases (complex and very long edits), the
prefetch job would block several seconds after being requested to stop.

This was because one codepath would keep looping over all frames without
checking for the `stop` flag.
2023-11-10 14:29:44 +01:00
Hans Goudey
70074a7d46 Cleanup: Follow style guide in new math function, use std:: namespace 2023-11-10 14:21:43 +01:00
Germano Cavalcante
9bf673a37d Fix #114215: Scanfill sometimes fails to identify holes
The problem is in the way of identifying "fast" intersections through bounds.

In the existing code, before testing the intersections (to identify
holes) the polys are sorted according to the bounds
(in the order x1 < x2 || y1 < y2).

Then a for loop is used on the order returned by sort.

Each time the bound of a polygon intersects with another, it is joined
and the bound is added.

The problem with this solution is that some bounds may not intersect
with the first, but could intersect one that is joined to the first,
which, as it is cleared, makes the intersection undetected.

The solution is to remove this code with `qsort` and create a
"target_map" that identifies a source polygon and a dest polygon.

Pull Request: https://projects.blender.org/blender/blender/pulls/114600
2023-11-10 12:56:20 +01:00
Jeroen Bakker
cc04bcd792 Vulkan: Reusing Textures from Pool
This PR solves an issue when using texture pools with textures that are not
natively supported by the device. In the previous implementation the
internal `Texture::format_` was changed. Any check if the texture could
be reused would fail as its format would be different that the requested one.

This PR fixes this by separating the requested format `Texture::format_` and
how it is stored on the GPU `VKTexture::device_format_`.

This solves the next artifacts:
* Workbench flickering artifacts on AMD/Intel GPUs
* Workbench TAA on AMD/Intel GPUs
* Overlays were not always drawn fully solid

Pull Request: https://projects.blender.org/blender/blender/pulls/114697
2023-11-10 12:52:34 +01:00
Jeroen Bakker
0c9433bf44 Vulkan: Retarget Depth Range
OpenGL uses a depth range between -1 and 1, which is then normalized.
Metal & Vulkan uses a depth range between 0 and 1, which is already normalized.

The final plan would be to default to a depth range between 0 and 1, but
for now the depth ranges are retargetted so they won't be clipped away.

This solves the next issues for users:
- Navigate control will be rendered correctly
- Ortographic view clipping artifacts
- EEVEE light evaluation

Retargetting happens at the end of the vertex stage or when a geometry
stage is present at the end of the geometry stage. Derivatives using
depth would have a different value compared to OpenGL, but would match
Metal backend. OpenGL performs clipping and generates derivatives based
on the original depth value.

`gl_FragCoord` and clipping would have some precision differences as clipping
and normalizing are done in a different order but would match Metal.

Geometry shaders should use `gpu_EmitVertex` to ensure that the retargetting
is done per vertex.

Pull Request: https://projects.blender.org/blender/blender/pulls/114669
2023-11-10 12:32:06 +01:00
Christoph Lendenfeld
06bcbc644c Refactor: extract function from insert_keyframe_value
No functional changes.

Extract code from the function `insert_keyframe_value`
to make it easier to use in other places.
I created a new function `remap_driver_frame` that
removes 3 parameters from the function.
And I removed the requirement for a `ReportList`
by just returning false and letting the caller
create a message.

Pull Request: https://projects.blender.org/blender/blender/pulls/114700
2023-11-10 12:22:45 +01:00
Pratik Borhade
66bd65c5f2 Merge branch 'blender-v4.0-release' 2023-11-10 16:19:08 +05:30
Pratik Borhade
ab2198d77b Fix #114687: Orbit opposite changes view to perspective
When `VIEWOPS_FLAG_PERSP_ENSURE` is set, it switches view to
perspective in `ED_view3d_persp_ensure` which is incorrect for orbit
operation.

Pull Request: https://projects.blender.org/blender/blender/pulls/114698
2023-11-10 11:41:28 +01:00
Pratik Borhade
270fc860cf Fix #114685: GP time offset modifier doesn't work if the animation is 1 frame long
This is due to the early return of current frame when start and end of
custom range is same
2023-11-10 16:07:05 +05:30
Julian Eisel
9638dfbe43 Merge branch 'blender-v4.0-release' 2023-11-10 11:34:16 +01:00
Julian Eisel
c05faeb053 Fix #114432: Custom themes overridden by default theme
Code was copying the default theme over the active theme, instead of
selectively updating a single theme option to fix #113683.

Pull Request: https://projects.blender.org/blender/blender/pulls/114675
2023-11-10 11:33:15 +01:00
Jeroen Bakker
672f14fee5 Cleanup: Make format 2023-11-10 11:07:04 +01:00
Hans Goudey
cda624032d Merge branch 'blender-v4.0-release' 2023-11-10 09:19:03 +01:00
Hans Goudey
821060f75a Fix #114686: Cannot execute node tool operators
A stupid mistake in 871c717c6ec2b869c8de caused node tools to trigger
the unsupported warning for data-blocks for geometry sockets as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/114693
2023-11-10 09:18:04 +01:00
nutti
cf41153798 Docs: include cls in bpy.utils.unregister_class
Ref: !114523
2023-11-10 14:32:23 +11:00
Germano Cavalcante
78943edc5d Transform: Custom modifier to navigate while transforming
Discussed in #114646.

This commit transforms the "alt_navigation" option of the transform
operators into a new modal key item. "PASSTHROUGH_NAVIGATE"

In addition to cleaning up a lot of the code, it allows you to
customize the key chosen to navigate while transforming.
2023-11-09 21:33:34 -03:00
Campbell Barton
8eb5223663 Cleanup: remove unused variables & imports in scripts/ 2023-11-10 10:06:41 +11:00
Campbell Barton
a615dcdfa8 Cleanup: add missing header to CMake, sort file lists 2023-11-10 09:40:05 +11:00
Campbell Barton
3841addab3 Cleanup: spelling in comments 2023-11-10 09:24:19 +11:00
Campbell Barton
4e6bca79cd Cleanup: quiet unused variable warnings in CMake
OpenMP_LIBRARIES was used when it wasn't defined.
2023-11-10 09:15:49 +11:00
Michael Jones
c30c6b2d4e Cycles: Fix Metal API validation error when Metal motion blur workaround is applied
Following #114544: When running with Metal API validation enabled, allocating a zero-sized buffer results in validation errors. This silences that.

Pull Request: https://projects.blender.org/blender/blender/pulls/114680
2023-11-09 22:23:37 +01:00
Xavier Hallade
e317831a82 Cycles: oneAPI: adjust reported device capabilities
It notably adds driver version as it can be helpful when triaging
end-user issues.
2023-11-09 21:46:27 +01:00
Jesse Yurkovich
7d375793bd Merge branch 'blender-v4.0-release' 2023-11-09 11:08:38 -08:00
Jesse Yurkovich
360684d5a4 Fix #114047: Use correct collection during USD import
Ensure that the view layer is properly synced before trying to get the
active collection.

Without the sync, imported objects typically get placed in the global
Scene Collection rather than the new collection that was just created
for the import.

Pull Request: https://projects.blender.org/blender/blender/pulls/114650
2023-11-09 20:07:51 +01:00
Brecht Van Lommel
7b26c3d517 Merge branch 'blender-v4.0-release' into main 2023-11-09 18:24:05 +01:00
Brecht Van Lommel
ffd701ab58 Build: auto update CMake config for shared library OpenImageDenoise 2023-11-09 18:23:52 +01:00
salipourto
13171183fa Fix Cycles HIP RT issues with deformation motion blur
The first problem was triangles with motion blur were all grouped into
one category without separating the ones with and without triangle
motion steps.

The second problem was HIP RT uses the generic motion triangle
intersection function and this function checks prim_visibility buffer.
HIP RT doesn't provide the buffer per primitive but passes it to HIP RT
core per instance.

The buffer name was changed to prim_visibility from visibility to be
the same as what Cycles uses but when the motion triangle intersection
function is called from HIP RT kernels, the instance id is passed to
the function instead of primitive id.

Pull Request: https://projects.blender.org/blender/blender/pulls/114555
2023-11-09 18:22:59 +01:00
Christoph Lendenfeld
cd90e04347 Refactor: arguments for get_normalized_fcurve_bounds
No functional changes.

In order for the function `get_normalized_fcurve_bounds` to be
reusable in [#114407: WIP: Anim: View FCurve of Property in the Graph Editor](https://projects.blender.org/blender/blender/pulls/114407)
the arguments need to be simplified.

Pull Request: https://projects.blender.org/blender/blender/pulls/114679
2023-11-09 17:17:07 +01:00
Christoph Lendenfeld
6e7af8ceff Refactor: More specific arguments for ANIM_get_normalization_flags
No functional changes.

`ANIM_get_normalization_flags` had the argument type of `bAnimContext *`.
That made it more difficult than it needs to be to reuse that function.
Pass a `SpaceLink *` instead since that is what the function actually uses.

Pull Request: https://projects.blender.org/blender/blender/pulls/114676
2023-11-09 17:02:13 +01:00
Sergey Sharybin
43c2c1844f Cleanup: Remove unused arguments from sculpt automasking API
Pull Request: https://projects.blender.org/blender/blender/pulls/114674
2023-11-09 16:15:54 +01:00
Jeroen Bakker
8c7f927ec8 Vulkan: Workbench Shadow Drawing
There were some issues with workbench shadow drawing. This PR
does some tweaks to fix the shadow drawing on vulkan.

* Framebuffer stencil clearing when write stencil is disabled
* Tweaks to stencil operation and tests
* Disable restart for line adjacency

Pull Request: https://projects.blender.org/blender/blender/pulls/114673
2023-11-09 16:07:26 +01:00