Commit Graph

13789 Commits

Author SHA1 Message Date
Weizhen Huang
a2bb547b9a Fix: Cycles spot light spread sampling not considering non-uniform scaling
For spherical spot light, when the shading point is close to the light
source, we switch to sampling the light spread instead of the visible
cone from the shading point. This has the benefit of less noise when the
spread is small.
However, the light spread sampling was not considering non-uniform
object scaling, where the actual spread might be different.
This patch switches sampling method only when the smallest enclosing
spread cone is smaller than the visible cone from the shading point.

An alternative method would be to compute the actual solid angle of the
scaled cone, and sample from the scaled cone. However, that involves
ray transformation and modifying the sampling pdf and angle. Since
non-uniform scaling is rather a niche case, it's probably not worth the
computation effort.

Pull Request: https://projects.blender.org/blender/blender/pulls/119661
2024-03-19 18:55:35 +01:00
Weizhen Huang
a6fba7b59d Cleanup: Cycles: remove unnecessary storage of the spot light axes 2024-03-19 18:55:34 +01:00
Weizhen Huang
8536575263 Fix: Cycles area light ignores some valid samples in volume segment 2024-03-19 14:48:43 +01:00
Weizhen Huang
f5f10201ca Cleanup: remove unused function 2024-03-19 14:48:14 +01:00
Brecht Van Lommel
433d91fca8 Merge branch 'blender-v4.1-release' 2024-03-18 11:00:49 +01:00
Brecht Van Lommel
f57e4c5b98 Fix #119551: Cycles denoising crash canceling tiled render with MetalRT
The BVH has been freed at this point, but the Metal queue sets it on
every invocation. Make sure it's null so it doesn't get used anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/119581
2024-03-18 11:00:21 +01:00
Brecht Van Lommel
b8ea467475 Merge branch 'blender-v4.1-release' 2024-03-16 19:45:51 +01:00
Alaska
b8a3560a77 Fix #119545: Error drawing Cycles denoising settings with NONE device
Pull Request: https://projects.blender.org/blender/blender/pulls/119547
2024-03-16 19:34:16 +01:00
Weizhen Huang
8cbc386152 Fix: Cycles NEE not excluding self intersection
which resulted in bias when self intersection is excluded in forward scattering.
Below is a comparison using principled BSDF with emission. NEE and MIS were much brighter.

Pull Request: https://projects.blender.org/blender/blender/pulls/119440
2024-03-15 18:31:24 +01:00
Weizhen Huang
161881322e Merge branch 'blender-v4.1-release' 2024-03-15 18:13:40 +01:00
Weizhen Huang
682f984dbe Fix: Cycles mesh light ignores some valid samples in volume segment
Ref: #118534
turns out `in_volume_segment` does need to be checked. If the ray origin
lies on the wrong side of the mesh light, part of the ray could still be
lit by the other side, so the sample should not be considered invalid.

Pull Request: https://projects.blender.org/blender/blender/pulls/119529
2024-03-15 18:11:40 +01:00
Sergey Sharybin
f3f79ef4bd Merge branch 'blender-v4.1-release' 2024-03-15 09:53:25 +01:00
Alaska
7ec0ebf30c Cycles: Fix grammar issues in OIDN GPU command line reporting
Pull Request: https://projects.blender.org/blender/blender/pulls/119492
2024-03-15 09:52:47 +01:00
Brecht Van Lommel
335ff6efab Cycles: Disable OpenImageDenoise support for AMD GPUs in Blender 4.1
In older drivers with an integrated GPU, this may crash. This not only
affects HIP, but also can crash when using Cycles with an NVIDIA or
Intel GPU in combination with an AMD CPU.

Fixes for this are expected to be coming, but there will not be enough
time for user testing, and it is difficult to be certain that the fix
is complete.

So to be careful, this is postponed until it has had more testing.

Pull Request: https://projects.blender.org/blender/blender/pulls/119476
2024-03-14 18:18:18 +01:00
Campbell Barton
fc13d2c165 Cleanup: format 2024-03-12 20:56:48 +11:00
Jose Vicente Barrachina
692de6d380 GHOST/Wayland: copy & paste image to clipboard support
Adds copy and paste images functionality to and from the image editor
in Linux/Wayland clipboard.

Currently the only format supported is PNG.

Ref: !119117
2024-03-12 17:42:02 +11:00
Campbell Barton
fff99c2e62 Merge branch 'blender-v4.1-release' 2024-03-12 17:08:53 +11:00
Campbell Barton
dd42a9718d Cleanup: format 2024-03-12 17:08:29 +11:00
Campbell Barton
8c276cb073 Merge branch 'blender-v4.1-release' 2024-03-12 17:04:59 +11:00
Campbell Barton
353ec1090a Unbreak build with USE_EVENT_BACKGROUND_THREAD disabled 2024-03-12 17:03:09 +11:00
Jacques Lucke
deb332601c Fix #113090, #111450, #104909: node rna properties collide with built-in names
This fixes the following name collisions:
* Compositor Box/Ellipse Mask node: `width` -> `mask_width`
  (also renamed the `height` property accordingly)
* Shader AOV Output node: `name` -> `aov_name`
* Geometry Color node: `color` -> `value`.

Those are breaking changes unfortunately, because looking up those property
names yielded the node-specific and not the common property. Therefore, this is
targeted at `main` instead of `4.1`.

Pull Request: https://projects.blender.org/blender/blender/pulls/119284
2024-03-11 15:57:30 +01:00
Brecht Van Lommel
92f6ba5a5f Merge branch 'blender-v4.1-release' 2024-03-11 15:09:55 +01:00
Brecht Van Lommel
c388ed1e53 Fix #118709: Crash in OIDN GPU detection for unsupported HIP device
Pull Request: https://projects.blender.org/blender/blender/pulls/119315
2024-03-11 15:09:24 +01:00
Brecht Van Lommel
9d0f49c843 Merge branch 'blender-v4.1-release' 2024-03-11 13:11:36 +01:00
Brecht Van Lommel
f7a071bd60 Fix: Build failing when WITH_OPENIMAGEDENOISE is OFF 2024-03-11 12:59:46 +01:00
Alaska
989e9ef890 Fix: Assert in Cycles multi-device OIDN check
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/119267
2024-03-11 12:54:45 +01:00
Miguel Pozo
a53e8d6d24 Merge branch 'blender-v4.1-release' 2024-03-11 12:27:39 +01:00
Attila Afra
60e8b56bcd Fix: CUDA module memory leak since using primary context
Previously the CUDA context was always destroyed and the module along
with it. Now that this no longer happens, the missing module free became
a memory leak.

Also fix the same issue for HIP, though this is destroying the context
so it's not a problem yet.

Fix part of #119035

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
2024-03-11 10:39:24 +01:00
Jacques Lucke
2c5f51e683 Merge branch 'blender-v4.1-release' 2024-03-10 14:04:35 +01:00
Campbell Barton
e33f5e36ac Cleanup: spacing around C-style comment blocks 2024-03-09 23:40:57 +11:00
Brecht Van Lommel
0f1e93e78a Cleanup: Remove debug print 2024-03-09 12:27:16 +01:00
Campbell Barton
74d9fb60ba Cleanup: use 'const' where possible, remove redundant check 2024-03-09 16:38:25 +11:00
Hans Goudey
2d3d8c80c3 Cleanup: Make format 2024-03-08 18:29:11 -05:00
Brecht Van Lommel
2e8e2be0af Merge branch 'blender-v4.1-release' 2024-03-08 22:55:42 +01:00
Brecht Van Lommel
9bebd39197 Cycles: Default to OIDN for NVIDIA in the viewport
For consistency across GPU devices, and between viewport and final
render.

Pull Request: https://projects.blender.org/blender/blender/pulls/119213
2024-03-08 22:52:36 +01:00
Brecht Van Lommel
f278e4138c Fix #118016: OpenImageDenoise not using GPU for CPU + GPU render
Thanks to Alaska for pointing out the cause of the problem.
2024-03-08 22:52:35 +01:00
Hans Goudey
04a9790035 Merge branch 'blender-v4.1-release' 2024-03-08 16:35:33 -05:00
Clément Foucault
4205718dce GPU: Cleanup type aliases
This define all aliases for supported types,
document which one to use in C++ shared code,
move relevant defines to their backend file.

Rename `bool1` to `bool32_t` and cleanup
its usage as mentioned in #118961.

Rel. #118961

Pull Request: https://projects.blender.org/blender/blender/pulls/119098
2024-03-08 19:09:10 +01:00
Brecht Van Lommel
898187cfab Fix #118466: Cycles renders black on Metal + AMD
Global built-ins appear to not work on AMD cards.

Also add a tweak to avoid a performance regression, similar
to what was done before. Disable adaptive subdivision kernel
code if not used.

Pull Request: https://projects.blender.org/blender/blender/pulls/119175
2024-03-08 16:41:27 +01:00
Alaska
2a18bbbdbc Fix #119141: Cycles Metal compilation errors
Correct order for alignment attribute.

Pull Request: https://projects.blender.org/blender/blender/pulls/119148
2024-03-07 11:41:37 +01:00
Sergey Sharybin
032a24d8ac Fix Cycles compilation error with OIDN < 2.2
The enumerator values for various GPU compute platforms were
added starting with OIDN 2.0, with the Metal GPU type added
in OIDN 2.2.

This is an alternative fix to ebb781675d, which does not lead to
unhandled cases in switch statement, and follows the configuration
of OIDN and not Cycles (as OIDN might report devices which are
disabled in local Cycles build).

Pull Request: https://projects.blender.org/blender/blender/pulls/119155
2024-03-07 11:13:41 +01:00
Campbell Barton
0cd414120b Unbreak build on macOS with AppleClang from recent cleanup
Exact an exact match with Clang broke building when the compiler ID
was "AppleClang", reverting parts of [0].

[0]: 6549019ae1
2024-03-07 19:56:58 +11:00
Campbell Barton
6549019ae1 Cleanup: use STREQUAL instead of MATCHES for exact comparisons
MATCHES takes a REGEX and searches the input for a match,
this isn't necessary for CMAKE_SYSTEM_PROCESSOR & CMAKE_*_COMPILER_ID.
2024-03-07 17:56:41 +11:00
Hans Goudey
1e1d7034ec Cleanup: Move GPU_uniform_buffer.h to C++ 2024-03-06 21:54:28 -05:00
Campbell Barton
a975c7096a Cleanup: line length in CMake files 2024-03-07 13:26:55 +11:00
Sebastian Parborg
ebb781675d Fix: Add missing ifdef guards for OIDN GPU devices
It is not guaranteed that the GPU variables will be available depending
on the current OIDN configuration
2024-03-06 19:19:23 +01:00
Anthony Roberts
445fd42c61 Windows: Add ARM64 support
* Only works on machines with a Qualcomm Snapdragon 8cx Gen3 or above.
  Older generation devices are not and will not be supported due to
  some driver issues
* Requires VS2022 for building.
* Uses new MSVC preprocessor for sse2neon compatibility.
* SIMD is not enabled, waiting on conversion of blenlib to C++.

Ref #119126

Pull Request: https://projects.blender.org/blender/blender/pulls/117036
2024-03-06 16:14:34 +01:00
Anthony Roberts
3d5fa7698f Cycles: Add Windows ARM64 support
Ref #119126

Pull Request: https://projects.blender.org/blender/blender/pulls/117036
2024-03-06 16:14:34 +01:00
Sergey Sharybin
d88686fb2b Cycles: Add debug logging to the OIDN GPU checks
No functional changes, just something that could help troubleshooting
cases when option to use GPU for denoising is grayed out.

Pull Request: https://projects.blender.org/blender/blender/pulls/119123
2024-03-06 14:54:19 +01:00
Brecht Van Lommel
44d418143e Merge branch 'blender-v4.1-release' 2024-03-05 19:55:07 +01:00