Commit Graph

13703 Commits

Author SHA1 Message Date
Weizhen Huang
95d11b0d33 Fix Cycles area light using MIS when the spread is zero
area light with zero spread was introduced in bf18032977. Such paths can
only be sampled with NEE, so MIS should not be used.
This fixes the discrepancy when Direct Light Sampling is set to MIS or NEE.

Pull Request: #118584
2024-02-23 12:40:48 +01:00
Weizhen Huang
c292d4dbee Fix assigning value to nullptr 2024-02-23 12:29:39 +01:00
Weizhen Huang
63dd44c810 Cleanup: avoid implicit conversion from int to float 2024-02-23 12:28:46 +01:00
Weizhen Huang
92c4a5fa09 Fix Principled Hair Huang wrong TIR condition
`cos_theta_t` was not initialized for TIR case

Thanks Christophe Hery for spotting the bug
2024-02-23 12:28:23 +01:00
Weizhen Huang
65d910aef7 Fix wrong roughness in Principled Hair Huang trrt+ component 2024-02-23 12:28:08 +01:00
Alaska
56bfd56735 Fix: Cycles incorrect rendering of certain negative strength lights
This fixes an issue where lights that make use of constant negative strength
emission shaders would render with the absolute of their strength.

Pull Request: https://projects.blender.org/blender/blender/pulls/118541
2024-02-22 19:06:22 +01:00
Weizhen Huang
0007c7a6b2 Fix #115997: Emission sampling setting ignored when not using light tree
if emission sampling is not set, we do not use MIS weight when sampling
from the BSDF, but we were still drawing samples from the light,
resulting in double contribution.

Pull Request: https://projects.blender.org/blender/blender/pulls/118534
2024-02-22 12:24:12 +01:00
Brecht Van Lommel
4c708a8c3e Linux: Avoid XDG_RUNTIME_DIR warnings running headless Blender
Pull Request: https://projects.blender.org/blender/blender/pulls/118530
2024-02-21 18:35:15 +01:00
Brecht Van Lommel
873472b747 Linux: Improve headless EGL initialization messages
When it succeeds, don't print an error message. When it fails, print
errors for both display and headless attempts.

Pull Request: https://projects.blender.org/blender/blender/pulls/118530
2024-02-21 18:35:10 +01:00
Jacques Lucke
8ea425d95d Fix #118402: enforce expected minimum alignment in MEM_CXX_CLASS_ALLOC_FUNCS
This `operator new` added in ecc3e78d787cce8a3f202e7de26575e2d47baea2
are only called if the alignment is greater than `__STDCPP_DEFAULT_NEW_ALIGNMENT__`.
This is generally 8 or 16 depending on the platform. `MEM_mallocN` does
guarantee 16 byte alignment currently (in fact it's usually not 16 byte aligned
because of `MemHead`). Now `MEM_mallocN_aligned` is used with the default
alignment, even if we don't know that the type does not require it.

An alternative would be to pass the alignment to `MEM_CXX_CLASS_ALLOC_FUNCS`,
but that would be more intrusive.

Pull Request: https://projects.blender.org/blender/blender/pulls/118568
2024-02-21 18:14:11 +01:00
Campbell Barton
479b46ca93 Fix #117896: Key-modifiers on window activation fails under Wayland
Register the last held key when activating a window
(not only modifiers keys) under Wayland.

This resolves a bug where holding the D-key and clicking on a window
wouldn't activate grease pencil drawing.
2024-02-21 14:09:04 +11:00
Jacques Lucke
ecc3e78d78 Fix #118402: support overaligned types in MEM_CXX_CLASS_ALLOC_FUNCS
Previously, the alignment of structs that use `MEM_CXX_CLASS_ALLOC_FUNCS`
were not taken into account when doing the allocation. This can cause some data
to be mis-aligned and leads to crashes when cpu instructions or code expect the
data to be aligned.

The fix is to provide an overload of `operator new` that accepts the alignment as parameter.

More info: https://en.cppreference.com/w/cpp/language/new (search for `align_val_t`).

Pull Request: https://projects.blender.org/blender/blender/pulls/118526
2024-02-20 18:44:26 +01:00
Brecht Van Lommel
0f2064bc3b Revert changes from main commits that were merged into blender-v4.1-release
The last good commit was 4bf6a2e564ad2.
2024-02-19 15:59:59 +01:00
Brecht Van Lommel
05f6a32b18 Merge branch 'blender-v4.1-release' into main 2024-02-19 13:18:27 +01:00
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
Harley Acheson
4acbda91f8 Merge branch 'blender-v4.1-release' 2024-02-17 11:30:55 -08:00
Harley Acheson
a677518cb5 Fix #118351: Pixel Shift with Win32 Clipboard DibV5 Image Transfer
My misreading of the Microsoft BITMAPV5HEADER specification causes a
shift of three pixels when transferring between applications using this
format. This does not occur when moving within or between Blender
instances. This PR just removes the incorrect 12-byte offset. Note
that many applications prefer PNG transfers over DibV5 so testing this
might be non-obvious.

Pull Request: https://projects.blender.org/blender/blender/pulls/118417
2024-02-17 20:29:41 +01:00
Campbell Barton
c47c1275a9 Merge branch 'blender-v4.1-release' 2024-02-17 14:57:07 +11:00
Campbell Barton
a8ca12f2a8 Fix #118233: No preference to disable multi-touch gestures on Wayland
Support this preference for Wayland, following macOS & WIN32 support.
2024-02-17 14:55:12 +11:00
Brecht Van Lommel
7453c5ed67 Merge branch 'blender-v4.1-release' into main 2024-02-16 19:31:31 +01:00
Raul Fernandez
324ff4ddef macOS: Remove unnecessary checks now that minimum version is macOS 11.2
MacOS minimum version is now 11.2 we no longer need to check for lower API versions.

Pull Request: https://projects.blender.org/blender/blender/pulls/118388
2024-02-16 19:03:23 +01:00
Campbell Barton
07ff3bcb70 GHOST/Wayland: support dropping text
This matches X11's support for GHOST_kDragnDropTypeString.

Dropping URL's from a web-browser uses this mime-type.
2024-02-16 14:27:00 +11:00
Campbell Barton
82c753a940 GHOST/Wayland: drag & drop cleanup, minor changes
- Don't generate a drop event when the drop data failed to read.
- Remove redundant drop-buffer duplication.
2024-02-16 14:26:58 +11:00
Campbell Barton
67481dcd47 Merge branch 'blender-v4.1-release' 2024-02-15 21:22:56 +11:00
Campbell Barton
4b7d44d015 Fix incorrect use of sizeof() for Wayland
The size of the string in bytes happened to match the the pointer size
on 64bit systems, nevertheless the logic was wrong would would fail on
32bit systems. Also use a character to search the string instead of a
single character string.
2024-02-15 20:56:45 +11:00
Hans Goudey
e6c919830c Cleanup: Remove unused logging macros that free the input string 2024-02-14 21:08:58 -05:00
Campbell Barton
bdd40f167e Merge branch 'blender-v4.1-release' 2024-02-15 11:03:42 +11:00
Hans Goudey
a52323d711 Cleanup: Move BKE_duplilist.hh to C++ 2024-02-14 10:51:46 -05:00
Brecht Van Lommel
088ae8d905 Build: Remove LLVM linking no longer needed by OSL
These are now included in the OSL shared libraries, so no reason to
link against it.

The CMake code for WITH_LLVM remains in case it is useful in the future,
but is not enabled by any Blender feature now.

Pull Request: https://projects.blender.org/blender/blender/pulls/118229
2024-02-14 12:06:52 +01:00
Campbell Barton
156fffbfde Merge branch 'blender-v4.1-release' 2024-02-14 14:29:55 +11:00
Brecht Van Lommel
dd382be067 Fix #118020: Cycles OptiX OSL crashes
Turns out we were not building OSL with OptiX enabled anymore.
Also check now if the OSL builds has OptiX support and if not
disable it in Cycles.

Building OSL with support for this (still) does not require
either the OptiX SDK or CUDA, it only needs LLVM.

Pull Request: https://projects.blender.org/blender/blender/pulls/118234
2024-02-14 03:40:01 +01:00
Damien Picard
1410615079 Nodes: expose multi-input sockets to custom nodes in the Python API
Currently the multi-input sockets are not exposed to the custom nodes
Python API. This makes some features cumbersome to implement if one
wants a node to process an arbitrary number of inputs.
One workaround is to make inputs duplicate themselves when a link is
created, but a proper multi-input would be easier to use for both
add-on developers and users.

This commit exposes a new `use_multi_input` boolean parameter when
creating a new node socket. This makes it possible to declare a
multi-input, while still leaving the existing `is_multi_input`
property read-only so that existing nodes cannot be made unstable.

The parameter is optional so existing scripts stay compatible. It also
raises an error when used on output sockets, since it makes no sense
for those to be multi-input.

The Custom Node Tree Python template was updated to reflect this
change by making one of the inputs of the custom node multi-input.

Pull Request: https://projects.blender.org/blender/blender/pulls/114474
2024-02-12 20:28:56 +01:00
Nikita Sirgienko
c48ea92429 Merge branch 'blender-v4.1-release' 2024-02-12 18:16:19 +01:00
Attila Afra
7b8c438715 Fix: Set OIDN GPU memory limit for all filters 2024-02-12 18:13:23 +01:00
Campbell Barton
3dbbc013de Cleanup: spelling in comments 2024-02-10 22:35:35 +11:00
Thomas Dinges
30a22b92ca Cycles: Rename SSE4.1 kernel to SSE4.2
This commit updates all defines, compiler flags and cleans up some code for unused CPU capabilities.

There should be no functional change, unless it's run on a CPU that supports sse41 but not sse42. It will fallback to the SSE2 kernel in this case.

In preparation for the new SSE4.2 minimum in Blender 4.2.

Pull Request: https://projects.blender.org/blender/blender/pulls/118043
2024-02-09 17:25:58 +01:00
Brecht Van Lommel
01f2c32700 Merge branch 'blender-v4.1-release' into main 2024-02-09 15:16:55 +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
JonasDichelle
f2e27ef7b6 Cycles: Override World option per View Layer
This feature is useful for many production scenarios as it allows for the
creation of separate render passes with specific worlds. This would help
workflows that require different skies or other backgrounds for compositing.

Ref #117919

Pull Request: https://projects.blender.org/blender/blender/pulls/117920
2024-02-09 12:16:16 +01:00
Sergey Sharybin
4196cbd175 Merge branch 'blender-v4.1-release' 2024-02-08 17:03:19 +01:00
Miguel Pozo
74b8f99b43 Render: Merge EEVEE and Cycles motion blur settings
Merge duplicated motion blur settings between Cycles and EEVEE,
and move them to `RenderData`/`scene.render`:
* `scene.cycles.motion_blur_position` -> `scene.render.motion_blur_position`
* `scene.eevee.use_motion_blur` -> `scene.render.user_motion_blur`
* `scene.eevee.motion_blur_position` -> `scene.render.motion_blur_position`
* `scene.eevee.motion_blur_shutter` -> `scene.render.motion_blur_shutter`

On the C/C++ side, this also renames `RenderData::blurfac` to
`RenderData::motion_blur_shutter`.

Pull Request: https://projects.blender.org/blender/blender/pulls/117913
2024-02-08 16:49:18 +01:00
Michael Jones
322a2f7b12 Cycles: Future-proof ordering of AppleGPUArchitecture enum
_No response_

Pull Request: https://projects.blender.org/blender/blender/pulls/117982
2024-02-08 16:31:52 +01:00
Nikita Sirgienko
0ed2d3e260 Merge branch 'blender-v4.1-release' 2024-02-08 14:54:13 +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
Campbell Barton
510a7ff452 Merge branch 'blender-v4.1-release' 2024-02-08 12:42:23 +11:00
Koranir
bba1893f67 Fix crash with fractional scaling on Wayland with NVIDIA graphics
Ref: !117531
2024-02-08 12:34:35 +11:00
Campbell Barton
67c12236e6 GHOST/WIN32: remove start time offset from getMilliSeconds
This isn't necessary and has been removed from macOS & X11,
Wayland never did this.

Besides removing the offset GetTickCount() has been replaced by
GetTickCount64 to prevent 32bit rollover when high resolution timers
aren't supported.

Ref !117618
2024-02-08 08:53:34 +11:00
Attila Afra
e7dcad8599 Fix: Release all OIDN GPU resources when recreating denoiser 2024-02-07 19:44:40 +01:00
Brecht Van Lommel
bd8a44e169 Lights: Option to use old point light falloff
Add new "Soft Falloff" option on point and spot light that uses
the old light behavior from Blender versions before 4.0. Blend
files saved with those older versions will use the option.

This option is enabled by default on new lights.

Fix #114241

Co-authored-by: Weizhen Huang <weizhen@blender.org>
Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/117832
2024-02-07 19:07:11 +01:00