Commit Graph

13437 Commits

Author SHA1 Message Date
Werner, Stefan b12a87b28a Revert "Cycles: Added quality parameter for OIDN"
This reverts commit 2e2291dd83.
2023-11-23 13:50:00 +01:00
Stefan Werner 2e2291dd83 Cycles: Added quality parameter for OIDN
OpenImageDenoise has two modes, high quality and balanced. This now exposes the modes as user parameters, with viewport denoising defaulting to balanced and final frame rendering set to high quality.

Ref #115045

Co-authored-by: Werner, Stefan <stefan.werner@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115265
2023-11-23 12:35:30 +01:00
Brecht Van Lommel b9227da2db Cleanup: rename sse2 specific functions to avoid accidentally using them
Ref #115098

Pull Request: https://projects.blender.org/blender/blender/pulls/115098
2023-11-22 19:45:58 +01:00
Leon Marz 6ec0e0104a Fix build error on architectures without SSE or sse2neon
As color_srgb_to_linear is only defined for them.

Pull Request: https://projects.blender.org/blender/blender/pulls/115098
2023-11-22 19:45:53 +01:00
Leon Marz ea1de499b3 Fix: Increase thread stack size for musl libc
Manually set the stack size to 2mb, same as with Apple

Co-authored-by: Damian Kurek <starfire24680@gmail.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/115094
2023-11-22 19:37:13 +01:00
Sergey Sharybin 6207b83194 Revert "CMake: Give kernel compilation targets access to console"
The side effect which wasn't that obvious from the documentation
is that tasks in the console pool are executed sequentially. This
made the compile-gpu step to take a long time, because the parallel
compilation got disabled.

That was unintended change, so reverting the change.

Instead, for the buildbot, increase the time limit for the step.

This reverts commit 4b891b4afe.
2023-11-22 15:18:12 +01:00
Clément Foucault a001cf9f2b EEVEE-Next: Displacement Option
This add the displacement option to EEVEE materials.
This unifies the option for Cycles and EEVEE.

The displacement only option is not matching cycles
and not particularly useful. So we decided to not
support it and revert to displacement + bump.

Pull Request: https://projects.blender.org/blender/blender/pulls/113979
2023-11-21 19:55:38 +01:00
Brecht Van Lommel fa64573434 Cycles: clearer message when denoising in build without OpenImageDenoise
Fix #115200
2023-11-21 18:57:00 +01:00
Brecht Van Lommel 8845dba79d Fix Cycles rare assert in ensure_valid_specular_reflection
When the incoming direction is exactly orthogonal to the normal

Ref #115071
2023-11-21 18:39:56 +01:00
Jeroen Bakker 27fdfb6538 Vulkan: Memory Statistics
This PR shows the memory footprint in the statusbar when activated.
Only memory allocated on the VRAM is counted. Memory allocated on host
memory is not counted.

![image](/attachments/33cedc89-9ada-4c0a-9a94-6c1b3e22b64b)

Pull Request: https://projects.blender.org/blender/blender/pulls/115184
2023-11-20 14:08:19 +01:00
Stefan Werner 02b5e27f89 Cycles: Add Intel GPU support for OpenImageDenoise
OpenImageDenoise V2 comes with GPU support for various backends. This adds a new class, OIDNDenoiserGPU, in order to add this functionality into the existing Cycles post processing pipeline without having to change it much. OptiX and OIDN CPU denoising remain as they are. Rendering on a supported Intel GPU will automatically select the GPU denoiser.

Device support is initially limited to the oneAPI devices that are supported by Cycles, but can be extended.

Ref #115045

Co-authored-by: Stefan Werner <stefan.werner@intel.com>
Co-authored-by: Ray Molenkamp <github@lazydodo.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/108314
2023-11-20 11:12:41 +01:00
Jesse Yurkovich 9eba3902c9 Fix: Allow Win32 clipboard to properly handle large images
The current code ran afoul of various arithmetic overflow conditions
when attempting to either Copy out or Paste in large images that would
overflow either the naive `w * h * 4` expression or the size of what the
DibV5 header allowed (DWORD, uint32_t).

Pull Request: https://projects.blender.org/blender/blender/pulls/115018
2023-11-18 22:46:41 +01:00
Hoshinova 0b11c591ec Nodes: Merge Musgrave node into Noise node
This path merges the Musgrave and Noise Texture nodes into a single
combined Noise Texture node. The reasoning is that both nodes
intrinsically do the same thing, which is the layering of Perlin noise
derivatives to produce fractal noise. So the patch de-duplicates code
and unifies the use of fractal noise for the end use.

Since the Noise node had a Distortion input and a Color output, while
the Musgrave node did not, those are now available to the Musgrave types
as new functionalities.

The Dimension input of the Musgrave node is analogous to the Roughness
input of the Noise node, so both inputs were unified to follow the same
behavior of the Roughness input, which is arguable more intuitive to
control. Similarly, the Detail input was slightly different across both
nodes, since the Noise node evaluated one extra layer of noise. This was
also unified to follow the behavior of the Noise node.

The patch, coincidentally fixes an unreported bug causing repeated
output for certain noise types and another floating precision bug
#112180.

The versioning code implemented with this patch ensures backward
compatibility for both the Musgrave and Noise Texture nodes. When
opening older Blender files in Blender 4.1 the output of both nodes are
guaranteed to always be exactly identical to that of Blender files
created before the nodes were merged in all cases.

Forward compatibility with Blender 4.0 is implemented by #114236.
Forward compatibility with Blender 3.6 LTS is implemented by #115015.

Pull Request: #111187
2023-11-18 09:40:44 +01:00
Patrick Mours 697114c4b6 Fix #113325: Zero-sized curve leads to OptiX error
Empty hair geometry in Cycles may still report having one curve, even when
there are no actual segments in that curve. This caused an attempt to build
an acceleration structure with zero primitives, which due to other setup
OptiX rejected with an error. Fix that by checking the number of segments
rather than the number of curves in the hair geometry, since the former will
always be zero for empty geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/115044
2023-11-17 17:20:57 +01:00
Germano Cavalcante 952d74ebbb Fix #114867: 'i' key in Turkish layout is marked as 'EVT_QUOTEKEY'
Different from most layouts. The Turkish keyboard layout treats the `i` as the lowercase `İ` and the `ı` as the lowercase `I`.

So we have 2 different types of i: `ı` and `İ`. And two different I key positions on the keyboard.

This key with a different position is mapped as special and returns the corresponding `event->type` of the US keyboard `"` (`EVT_QUOTEKEY`).

The apparently most appropriate event for this key would be `EVT_IKEY`.

This type of change needs to be treated with care, as it may alter other shortcuts that are already common to Turkish users.

Pull Request: https://projects.blender.org/blender/blender/pulls/114917
2023-11-15 15:45:45 +01:00
Michael Jones 0334ca0617 Cycles: Fix #114919: Disable MetalRT-by-default if macOS < 14.0
This PR fixes the issue of Cycles renders ending in compilation failure on base M3 machines which are still on their factory installed OS, older than14.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/114920
2023-11-15 15:39:27 +01:00
Clément Foucault 3ead36a8ba GHOST: Cleanup: Remove GHOST_OPENGL_ALPHA
This is never define and has no use in current blender.

If we want to keep this functionality, we should
at the very least rename it to `GHOST_WINDOW_ALPHA`.

Pull Request: https://projects.blender.org/blender/blender/pulls/114815
2023-11-14 20:24:55 +01:00
Jeroen Bakker 4ecd6abf78 Vulkan: Make Anisotropy Sampling Optional
Anisotropy samplers are optional in Vulkan. This change will disable
anisotropy samplers when the feature isn't available on the device.

The support for anisotropy samplers is around 90% so would not expect
any compatibility issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/114833
2023-11-14 12:24:46 +01:00
Hans Goudey cda624032d Merge branch 'blender-v4.0-release' 2023-11-10 09:19:03 +01: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
Brecht Van Lommel 7b26c3d517 Merge branch 'blender-v4.0-release' into main 2023-11-09 18:24:05 +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
Campbell Barton 690d427045 Merge branch 'blender-v4.0-release' 2023-11-09 17:01:03 +11:00
Campbell Barton 391b5ac93c Fix uninitialized pending actions for Windows under Wayland
A windows pending actions wasn't cleared for new windows.
Although I'm not aware of user visible bugs, this prevents
unpredictable updates for new windows.
2023-11-09 16:57:06 +11:00
Campbell Barton 58ea0e051f Cleanup: spelling in comments 2023-11-09 09:54:28 +11:00
Campbell Barton 6bba008325 Cleanup: format 2023-11-09 09:34:49 +11:00
Werner, Stefan b414187efb Build: Update OpenImageDenoise to 2.1.0
Major new feature in v2 is GPU support. This is not enabled yet,
this commit only changes the library version without enabling new
functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/112143
2023-11-08 10:12:05 +01:00
Michael Jones 051ce95628 Cycles: Use Metal Program Scope Global Built-ins on macOS >= 14.0
This PR simplifies the kernel entrypoints by using [Metal Program Scope Global Built-ins](https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf) when available (macOS >= 14.0).

Pull Request: https://projects.blender.org/blender/blender/pulls/114535
2023-11-07 11:20:16 +01:00
Campbell Barton aaf05c2497 Cleanup: various C++ changes (use nullptr, function style casts) 2023-11-07 11:35:16 +11:00
Brecht Van Lommel adb41fe6b2 Merge branch 'blender-v4.0-release' into main 2023-11-06 19:13:18 +01:00
Brecht Van Lommel fe9e28c086 Fix build error on macOS x86, after Metal motion blur workaround
Ref #114544
2023-11-06 18:50:25 +01:00
Michael Jones 4f52ab0b49 Cycles: Workaround MetalRT TLAS build hanging in some motion blur scenes
This PR works around an issue where zero-filled motion TLAS instance descriptors can cause unexpected hangs during downstream TLAS builds on M3. Instead of zeroing the descriptor we insert an explicit "null" BLAS, achieving the same result.

Pull Request: https://projects.blender.org/blender/blender/pulls/114544
2023-11-06 17:30:48 +01:00
Miguel Pozo 6d0b5e2ace EEVEE-Next: New shadow settings
Remove `Material > Shadow Mode` and use `Object > Shadow Ray Visibility`
and `Material > Transparent Shadows` instead.

The versioning system auto-updates objects/materials in EEVEE
scenes so their behavior is as close as possible to the previous one.

Update Cycles to use the native `use_transparent_shadow` property.

Note:
Material changes don't set any `recalc` flag on the objects that use
them, so the EEVEE Next shadow maps don't update when changing
settings/nodes.
Fixing this issue is required for 4.1, but it's out of the scope of this PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/113980
2023-11-06 15:45:00 +01:00
Campbell Barton 2b508f7ae3 Cleanup: cmake indentation 2023-11-04 16:41:18 +11:00
Campbell Barton 134393e846 Cleanup: spelling in comments 2023-11-04 14:08:13 +11:00
Brecht Van Lommel 14f470cdae Merge branch 'blender-v4.0-release' into main 2023-11-02 19:02:35 +01:00
Brecht Van Lommel 49c3dc9d7f Fix 114336: Cycles crash switching render pass in the viewport 2023-11-02 17:24:54 +01:00
Xavier Hallade 1161455084 Build: upgrade Intel Graphics Compiler on Linux
In order to speedup compilation, we upgrade IGC to 1.0.14828.26 along
with ocloc and the associated dependencies.
We also bump min-driver version accordingly to 26918.

Ref !114341
2023-11-02 22:27:38 +11:00
Sergey Sharybin 317ee3b6ea Merge branch 'blender-v4.0-release' 2023-10-31 17:29:41 +01:00
Sergey Sharybin 4b891b4afe CMake: Give kernel compilation targets access to console
Done by passing USES_TERMINAL to the add_custom_command().

This allows to see sub-command messages early on, before they
are finished executing.

This should help buildbots to "see" that the kernels are still
being compiled and not kill the build because it did not output
anything in a long time.

Pull Request: https://projects.blender.org/blender/blender/pulls/114327
2023-10-31 17:29:03 +01:00
Campbell Barton 3d3b8ae736 Merge branch 'blender-v4.0-release' 2023-10-31 21:36:34 +11:00
Michael Jones f2bb4c617f Cycles: Apple M3 tuning including hardware raytracing
This PR adds tunings for the [newly announced](https://www.youtube.com/watch?v=ctkW3V0Mh-k) M3 family of chips. In particular, MetalRT will be enabled as the automatic default for intersection testing on M3 and beyond to take advantage of hardware raytracing. This will result in significant path-tracing speedups, as well as faster BVH builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/114296
2023-10-31 11:14:16 +01:00
Jeroen Bakker e7148fc28e Vulkan: Enable Optional Vulkan 12 Features
`shaderOutputLayer` and `shaderOutputViewportIndex` are optional in
Blender, but when used they should be activated on physical device level.
This wasn't the case and when used the validation layer reported an error.

This PR activates the features when creating the device if the features
are available.

Pull Request: https://projects.blender.org/blender/blender/pulls/114303
2023-10-31 08:37:31 +01:00
Lukas Stockner d15013b583 Merge branch 'blender-v4.0-release' 2023-10-31 05:48:58 +01:00
Alaska a15f9e49ec Shader: Only clamp undefined or unsupported inputs of Principled BSDF
Adjust clamping of inputs in the Principled BSDF to avoid errors and
inconsistencies between render engines, while trying to leave as many
inputs as possible unclamped for artisitc purposes.

Pull Request: https://projects.blender.org/blender/blender/pulls/112895
2023-10-31 03:14:04 +01:00
Brecht Van Lommel 39107b3133 Revert changes from main commits that were merged into blender-v4.0-release
The last good commit was 8474716abb.

After this commits from main were pushed to blender-v4.0-release. These are
being reverted.

Commits a4880576dc from to b26f176d1a that happend afterwards were meant for
4.0, and their contents is preserved.
2023-10-30 21:40:35 +01:00
Brecht Van Lommel 9b2deb37a0 Fix Cycles render not stopping on OpenImageDenoise error
Stop so that render farms do not save an image that failed to be denoised
properly and assume it is correct.
2023-10-30 18:08:34 +01:00
Sergey Sharybin ecb346d9df Merge branch 'blender-v4.0-release' 2023-10-30 12:49:40 +01:00