Commit Graph

180 Commits

Author SHA1 Message Date
bartus
5d06b7b906 Cycles: Add support for OpenPGL 0.6.0
Replace PGLFieldArguments with FieldConfig class for this version.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/118328
2024-02-19 12:36:04 +01:00
Attila Afra
7b8c438715 Fix: Set OIDN GPU memory limit for all filters 2024-02-12 18:13:23 +01:00
Brecht Van Lommel
1e1a8d5c8f Fix: Cycles denoise fails with multi tile render and Use GPU off 2024-02-09 15:11:21 +01:00
Brecht Van Lommel
f98468c988 Fix: Cycles uses GPU device for denoise even if disabled for scene 2024-02-09 15:02:46 +01:00
Nikita Sirgienko
9d0b811da6 Fix #117931: Swap oidn device when changing "Use GPU" during viewport render 2024-02-08 14:53:12 +01:00
Attila Afra
e7dcad8599 Fix: Release all OIDN GPU resources when recreating denoiser 2024-02-07 19:44:40 +01:00
Attila Afra
8e80b44796 Cycles: Fix initial OIDN GPU denoiser quality 2024-02-07 17:54:50 +01:00
Attila Áfra
c1f55288e9 Fix: Cycles OIDN GPU denoiser bugs
- Incorrect accurate prefiltering of albedo and normal (lower than expected quality)
- Changing the prefiltering mode has no immediate effect
- Default memory limit is too high (more than OIDN default)
- Memory limit is applied only to the main filter
- Quality setting applied only to the main filter

Pull Request: https://projects.blender.org/blender/blender/pulls/117930
2024-02-07 13:34:35 +01:00
Stefan Werner
31d55e87f9 Cycles: Metal support for OpenImageDenoise
This is supported on Apple Silicon GPUs and macOS 13.0+.

Co-authored-by: Stefan Werner <stefan.werner@intel.com>
Co-authored-by: Attila Afra <attila.t.afra@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/116124
2024-02-06 21:13:23 +01:00
Nikita Sirgienko
280b5c89ae Cycles: Set quality parameter for OIDN
OpenImageDenoise API exposes two modes, high quality and balanced.
This currently only has effect on Nvidia devices, on which it
provides a noticeable performance improvement without visible
difference in quality. This change sets quality to balanced for
the viewport, and high quality for final frame rendering, as
it's what makes the most sense.

Ref #115045

Co-authored-by: Werner, Stefan <stefan.werner@intel.com>
Pull Request: #115265
2024-02-06 20:58:17 +01:00
Nikita Sirgienko
bc886857f3 Cycles: Option to disable OpenImageDenoise GPU per scene
To reduce memory usage if needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/117874
2024-02-06 17:46:21 +01:00
Stefan Werner
d16d2bbd3a Cycles: Adding OIDN support for CUDA and OptiX devices
Small changes to turn on support and to build OIDN with the CUDA backend.

Co-authored-by: Werner, Stefan <stefan.werner@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115828
2024-01-24 08:19:39 +01:00
Brecht Van Lommel
d377ef2543 Clang Format: bump to version 17
Along with the 4.1 libraries upgrade, we are bumping the clang-format
version from 8-12 to 17. This affects quite a few files.

If not already the case, you may consider pointing your IDE to the
clang-format binary bundled with the Blender precompiled libraries.
2024-01-03 13:38:14 +01:00
Nikita Sirgienko
3cadec1892 Cycles: Log number of scheduled tiles
Pull Request: https://projects.blender.org/blender/blender/pulls/116379
2023-12-21 09:39:16 +01:00
Brecht Van Lommel
ac753fe9ae Fix: Cycles assert with CPU denoiser 2023-12-13 22:27:46 +01:00
Stefan Werner
fd8bb41224 Cycles: Enable HIP devices for OpenImageDenoise
This enables the HIP backend of OpenImageDenoise on supported devices.

Co-authored-by: Werner, Stefan <stefan.werner@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115854
2023-12-13 21:38:19 +01:00
Brecht Van Lommel
d015e98ee6 Fix Cycles ASAN error with boolean kernel arguments 2023-12-12 13:27:36 +01:00
Stefan Werner
8a6f7640d6 Cycles: Make OIDN on GPU use the existing SYCL queue
There's already a queue from the Cycles rendering device, so let OIDN use the same instead of creating a new one.

Co-authored-by: Werner, Stefan <stefan.werner@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115650
2023-12-07 14:16:21 +01:00
Werner, Stefan
3e7b8381cc Cleanup: Removed redundant code in OIDN integration
There was an unused mutex, memory limits can be left at their defaults.
2023-12-07 14:13:49 +01:00
Campbell Barton
343b48663b Cleanup: format 2023-11-27 09:30:52 +11:00
Werner, Stefan
b12a87b28a Revert "Cycles: Added quality parameter for OIDN"
This reverts commit 2e2291dd83e8dd41682063e52f680a687eb0671e.
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
fa64573434 Cycles: clearer message when denoising in build without OpenImageDenoise
Fix #115200
2023-11-21 18:57:00 +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
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
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
Brecht Van Lommel
39107b3133 Revert changes from main commits that were merged into blender-v4.0-release
The last good commit was 8474716abb0db3b06838a57f7217bc945638d8df.

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
Aras Pranckevicius
1c9d7d5267 Fix reported build failure due to missing ostream include
On FreeBSD 13 / clang 15 the missing include apparently does not
get included indirectly, see
https://projects.blender.org/blender/blender/pulls/111063#issuecomment-1033764
2023-09-29 17:59:14 +03:00
Stefan Werner
d7f1e6fb12 Cycles: GPU denoising refactor
Moved more generic code from OptiX to GPU denoiser in order to reuse
it for OIDN GPU support.

Pull Request: https://projects.blender.org/blender/blender/pulls/112229
2023-09-11 17:09:23 +02:00
Campbell Barton
24a8d6425a CMake: include missing files in source files 2023-08-24 11:51:25 +10:00
Aras Pranckevicius
7875074532 Cleanup: fewer iostreams related includes in Cycles
In the commonly used cycles headers, it's enough to include
much smaller <iosfwd> than the full <iostream>. While looking at it,
removed inclusion of some other headers from commonly used headers,
that seemed to not be needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/111063
2023-08-15 13:55:38 +02:00
Campbell Barton
c12994612b License headers: use SPDX-FileCopyrightText in intern/cycles 2023-06-14 16:53:23 +10:00
Sergey Sharybin
ba3f26fac5 Cycles: light and shadow linking
With light linking, lights can be set to affect only specific objects in the
scene. Shadow linking additionally gives control over which objects acts a
shadow blockers for a light.

Usage:
https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/Cycles

Implementation:
https://wiki.blender.org/wiki/Source/Render/Cycles/LightLinking

Ref #104972
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
2023-05-24 14:11:47 +02:00
Sebastian Herholz
493856427d Cycles: bumping OpenPGL minimum version to 0.5 and removing version checks 2023-05-23 13:23:09 +02:00
Sebastian Herholz
8d17458569 Cycles: Path Guiding: Adding guiding on glossy surfaces via RIS
Pull Request: https://projects.blender.org/blender/blender/pulls/107782
2023-05-22 16:47:05 +02:00
Nikita Sirgienko
04fc6fd8a7 Cycles: avoid doing zero-sized allocations with partitioned shader sorting 2023-05-17 11:07:56 +02:00
Brecht Van Lommel
36e5157693 Cleanup: remove redundant lerp function, mix already does the same 2023-05-12 21:00:52 +02:00
Campbell Barton
3958ae7241 Cleanup: use STRNCPY, SNPRINTF macros 2023-05-09 14:08:19 +10:00
Campbell Barton
6859bb6e67 Cleanup: format (with BraceWrapping::AfterControlStatement "MultiLine") 2023-05-02 09:37:49 +10:00
Sahar A. Kashi
557a245dd5 Cycles: add HIP RT device, for AMD hardware ray tracing on Windows
HIP RT enables AMD hardware ray tracing on RDNA2 and above, and falls back to a
to shader implementation for older graphics cards. It offers an average 25%
sample rendering rate improvement in Cycles benchmarks, on a W6800 card.

The ray tracing feature functions are accessed through HIP RT SDK, available on
GPUOpen. HIP RT traversal functionality is pre-compiled in bitcode format and
shipped with the SDK.

This is not yet enabled as there are issues to be resolved, but landing the
code now makes testing and further changes easier.

Known limitations:
* Not working yet with current public AMD drivers.
* Visual artifact in motion blur.
* One of the buffers allocated for traversal has a static size. Allocating it
  dynamically would reduce memory usage.
* This is for Windows only currently, no Linux support.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Ref #105538
2023-04-25 20:19:43 +02:00
Sergey Sharybin
daaed83a32 Fix set but unused variables in Cycles 2023-04-19 10:02:09 +02:00
Sergey Sharybin
7982d86117 Fix unqualified access to std::move in Cycles 2023-04-19 10:02:09 +02:00
Xavier Hallade
9821a2d397 Cycles: pass kernel features to get_bvh_layout_mask
This allows to selectively disable Hardware Raytracing in oneAPI
backend, depending on features used.
2023-04-18 22:09:42 +02:00
Brecht Van Lommel
0bc957063c Fix #106405: Cycles multi GPU crash with vertex color baking
Avoid division by zero when one of the devices gets no work.
2023-04-17 15:31:35 +02:00
Sebastian Parborg
aa6e95281f Add support for OpenPGL 0.5.0
Some functions changed slightly for this non beta release.
No functional changes though as we didn't use what was removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/106861
2023-04-13 11:44:35 +02:00
Sergey Sharybin
44d5a894c1 Fix #106667: Cycles: Multi-device denoise runs denoising data passes
Only use the denoised buffer for access of denoised passes, and
access the rest of the passes from the original render buffer.

This allows in-place modification of the guiding passes needed
by the denoiser without affecting the final render result pixels.

Pull Request: https://projects.blender.org/blender/blender/pulls/106668
2023-04-07 16:49:43 +02:00
Stefan Werner
a76bf65c9d Cycles: Refactored GPU denoising code
To prepare for OIDN2 with GPU support, some of the code that was exclusive to the OptiXDenoiser is being moved to the DenoiserGPU superclass.

Co-authored-by: Stefan Werner <stefan.werner@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/106496
2023-04-05 11:19:15 +02:00