Commit Graph

13238 Commits

Author SHA1 Message Date
Dalai Felinto
a9aa0c3fc8 Cleanup: make format 2023-10-05 10:20:09 +02:00
Campbell Barton
c9130e38e3 Cleanup: spelling in comments 2023-10-05 13:07:58 +11:00
Germano Cavalcante
d6b2b5d0c5 Fix #112978: MacOS no longer has a path associated with the window
The problem was introduced in 636f3697ee

MacOS has a different way of handling the title.

In this OS the directory is searched and taken from the title string
which is then formatted.

This limits the title format and makes it prone to errors.

This commit makes the code more generic by splitting each component of
the title beforehand and allowing the associated directory to be informed
with `GHOST_SetTitle`.
2023-10-04 21:23:38 -03:00
Sergey Sharybin
d522938fd5 macOS: Enable secure coding for restorable state
There are secure implications of not using secure coding for the
restorable state described in the following article:

  https://sector7.computest.nl/post/2022-08-process-injection-breaking-all-macos-security-layers-with-a-single-vulnerability/

Starting with macOS 14 this secure coding is enabled implicitly
but with a warning printed into the console with a note that it
does not affect other versions of macOS.

This change makes it so the secure coding is used explicitly on
all supported macOS versions.

Blender does not use the restorable state itself, and used its
own code to take care of window placement, so there should be
no user-measurable changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/113240
2023-10-04 18:09:27 +02:00
Lukas Stockner
d071e0a5fc Fix #113058: Cycles: Bump mapping causing dark edges with subsurface
The refractive entry bounce does not like being below the shading normal,
so use the existing clamping logic.
2023-10-04 13:28:20 +02:00
Brecht Van Lommel
2f3e3cda51 Fix #113034: Cycles sheen breaks with low roughness
Also minor optimization to replace division by multiplication.
2023-10-03 20:30:40 +02:00
Campbell Barton
41d62f36d5 Fix uninitialized variable use accessing the screen size under Wayland
It's possible for there to be no outputs under Wayland
(when unplugging monitors for e.g.) so this must be accounted for.

Also avoid calculating the window position when the GHOST backend
doesn't support window positions (which is the case for Wayland).

Add checks for the SDL backend too, where accessing the
screen & desktop size may fail.
2023-10-03 15:40:58 +11:00
Brecht Van Lommel
94e2973f0b Build: support OpenColorIO 2.3
For Linux distributions or others that upgrade before we do.

Ref #113157

Pull Request: https://projects.blender.org/blender/blender/pulls/113163
2023-10-02 19:31:19 +02:00
Brecht Van Lommel
a455eca7a0 Fix #112931: Cycles mesh light sampling artifacts 2023-10-02 19:18:42 +02:00
Brecht Van Lommel
ed36398e16 Fix #109907: Cycles correlation issue with LCG random numbers
This showed up in 3.6 with multiscatter GGX, but could still be an issue
in current principled hair BSDF implementations.
2023-10-02 18:41:56 +02:00
Xavier Hallade
d8e8e8eb9a Cycles: oneAPI: fix device compilation with latest MSVC
<algorithm> header include is missing from some sycl headers, this will
be fixed upstream with https://github.com/intel/llvm/pull/10424,
meanwhile, we work around it by including it directly.
2023-10-02 09:17:17 +02:00
Lukas Stockner
b1a91c99bc Fix #111588: Cycles: Vector displacement with adaptive subdiv breaks normal
The compact form of the differential is not enough here, we need to store
and use the full vectors for bump evaluation.

Pull Request: https://projects.blender.org/blender/blender/pulls/112987
2023-10-02 02:19:51 +02:00
Campbell Barton
8337b3dd3f Fix mouse cursor failing to update for blocking actions on Wayland
Changes to the mouse cursor would only display when the main loop
was being handled, so blocking actions such as file load wouldn't
refresh the cursor.

Solve by flushing the display when the cursor changes.
2023-09-29 16:32:35 +10:00
Campbell Barton
d4f1a9b0ad Build: resolve build error on MSVC
Address error introduced by [0].

[0]: 6b967287c9
2023-09-28 14:23:11 +10:00
Campbell Barton
6b967287c9 MEM_guarded_alloc: restore execinfo.h back-trace on Linux/Apple
Recently [0] replaced back-traces from `execinfo.h` with ASAN's
`__asan_describe_address` since the linking options to hide symbols
cause the stack-traces only to include addresses (without functions).
Although using ASAN makes sense when enabled, in my tests the
stack-traces are sometimes empty. Using CMAKE_BUILD_TYPE=RelWithDebInfo
for e.g. wasn't showing a stack-trace for the leak fixed in [1].

A utility is now included to conveniently expand the addresses from
these stack traces (`tools/utils/addr2line_backtrace.py`).

Restore support for the execinfo stack-trace reporting, used when ASAN
is disabled.

[0]: 2e79ca3205
[1]: a9f0d19197
2023-09-28 12:45:04 +10:00
Alaska
c8365bb217 Fix #103284: Cycles uses sampling pattern from debug UI
The sampling pattern is only a debug setting at this point
and should not be used without the debug UI enabled where
users can actually see and edit the value.

Pull Request: https://projects.blender.org/blender/blender/pulls/112606
2023-09-27 20:31:14 +02:00
Alaska
f9dce92767 Fix Cycles missing specular tint for transmissive Principled BSDF
Pull Request: https://projects.blender.org/blender/blender/pulls/112894
2023-09-27 17:44:49 +02:00
Lukas Stockner
2456897d9d Fix #112831: Cycles: Kernel assert and NaN in Sheen 2023-09-27 03:02:07 +02:00
Campbell Barton
9be80399aa Cleanup: update code comments for wayland cursor locking
Since this comment was written support for warping was added.
2023-09-26 19:50:48 +10:00
Campbell Barton
c4651af470 Cleanup: use initializer list for all GHOST_SystemWayland members 2023-09-26 19:50:48 +10:00
Campbell Barton
0309de1f15 Cleanup: use C++ style casts in GHOST/Wayland 2023-09-26 19:50:48 +10:00
Campbell Barton
077832e063 Cleanup: spelling in comments 2023-09-26 19:50:48 +10:00
Xavier Hallade
729e86d5a3 Cycles: oneAPI: fix perf regression by inlining svm_node_closure_bsdf
158dbc1b10 introduced a ~9% performance
regression on Intel GPUs, which we recover through this targeted change.

Pull Request: https://projects.blender.org/blender/blender/pulls/112878
2023-09-26 10:53:39 +02:00
Michael Jones
1c1c6ac457 Cycles: Fix last failing unit test (T39823) on MetalRT
This PR fixes T39823, the sole failing unit test when running with MetalRT.  It does so by implementing and binding a missing intersection handler (`__anyhit__cycles_metalrt_volume_test_tri`) which is required for `scene_intersect_volume` (as used by `integrator_volume_stack_update_for_subsurface`) to work as intended. This scene exposed the error as it uses subsurface scattering on a sphere which is intersected by volume.

Pull Request: https://projects.blender.org/blender/blender/pulls/112876
2023-09-25 22:41:27 +02:00
Michael Jones
39baa94427 Cycles: Throttle MetalRT BVH builds to avoid exceeding working set limits
This patch adds `BVHMetalBuildThrottler` which limits the amount of Metal BVH building work that runs concurrently on the GPU. Previously we submitted BVH build requests to the GPU as fast as possible, but in extreme cases this could fail when the device's working set size passes safe limits.

Pull Request: https://projects.blender.org/blender/blender/pulls/112821
2023-09-25 20:20:17 +02:00
Brecht Van Lommel
3d38b51435 Shaders: add "Weight" to Transmission/Subsurface/Coat/Sheen socket names
Ref #99447
Ref #112848
2023-09-25 19:51:27 +02:00
Brecht Van Lommel
1d265eed5d Shaders: rename Specular to Specular IOR Level in Principled BSDF
To clarify that this is no longer the primary control, but rather
and adjustment on IOR.

Ref #99447
Ref #112552
2023-09-25 19:51:22 +02:00
Alaska
a03ee1af81 Shaders: clamp various shader inputs for Principled BSDF
Ref #99447

Pull Request: https://projects.blender.org/blender/blender/pulls/112774
2023-09-25 19:51:12 +02:00
Lukas Stockner
6e2f29b421 Shader: change Specular input on Principled BSDF to affect IOR
This keeps the behavior similar to the Disney BRDF, where 0.5
is neutral and lower/higher values respectively decrease/increase
the dielectric specular. But it's more correct in that it's not
an arbitrary scale on Fresnel, but rather adjusting the IOR.

Ref #99447
Ref #112848

Pull Request: https://projects.blender.org/blender/blender/pulls/112552
2023-09-25 19:51:02 +02:00
Brecht Van Lommel
3e3bdc9b89 Shader: rename subsurface scattering methods and change default
Clarify that one was specifically designed for skin shading.

Ref #99447
Ref #112848
2023-09-25 19:50:50 +02:00
Brecht Van Lommel
334027063e Shader: use single Principled BSDF input for metallic and specular tint
To match Standard Surface and OpenPBR.

Ref #99447
Ref #112848
2023-09-25 19:50:44 +02:00
Brecht Van Lommel
ca5f1c0f00 Shaders: rename Principled BSDF Emission to Emission Color
Ref #99447
Ref #112848
2023-09-25 19:50:41 +02:00
Weizhen Huang
def9b76207 Shader: Change specular tint in Principled BSDF from float to color
For more artistic control. Tints the reflection of dielectric materials
at normal incidence.

Ref #99447

Pull Request: https://projects.blender.org/blender/blender/pulls/112192
2023-09-25 19:42:05 +02:00
Lukas Stockner
86156566a7 Cycles: Add Metallic Tint to Principled BSDF using F82-Tint model
With the default value, this is backwards-compatible.

Ref #99447

Pull Request: https://projects.blender.org/blender/blender/pulls/112551
2023-09-25 19:42:05 +02:00
Lukas Stockner
7eead8912d Fix Cycles OSL potentially skipping closures when using layering
Pull Request: https://projects.blender.org/blender/blender/pulls/112213
2023-09-25 19:42:05 +02:00
Michael Jones
b7fe84d9bc Cycles: Fix #107714: Leak during MetalRT BVH buid
This patch fixes the memory leak described in #107714 by adding an `@autoreleasepool` around Metal BVH builds. Certain NSObjects were being retained indefinitely, specifically ones which had been value-passed via an NSArray into acceleration structure descriptors.

Pull Request: https://projects.blender.org/blender/blender/pulls/112820
2023-09-25 14:57:17 +02:00
Michael Jones
b8833a7f8c Cycles: Disable NanoVDB if not needed when specialising Metal PSOs
This patch adds a check to see whether we're actually using NanoVDB textures, and if not, removes `#define WITH_NANOVDB` when generating the scene-optimised kernels. This results in marginally faster render times (maybe 2 or 3%) for scenes that do not use NanoVDB. The generic kernels are unaffected, so this will not impact responsiveness on first render.

Pull Request: https://projects.blender.org/blender/blender/pulls/112822
2023-09-25 14:56:58 +02:00
Campbell Barton
e38ff7c06d Cleanup: use C++ comments for disabled code 2023-09-25 17:06:04 +10:00
Campbell Barton
3cd8b531a0 Fix intern/dualcon error in 2721b937fb 2023-09-24 16:07:49 +10:00
Campbell Barton
2721b937fb Cleanup: use braces in headers 2023-09-24 14:52:38 +10:00
Campbell Barton
d4dbbab5d9 Cleanup: locate break statements inside the case body
Follow the convention used almost everywhere in Blender's code.
2023-09-23 21:17:50 +10:00
Sergey Sharybin
015bc7ca4d Light linking: Make list interface look more similar to other places
This change makes it so the list interface in the properties panels looks
closer to things like shape keys, vertex groups and so on: there are two
buttons to add selected objects to the collection and remove active item
from the collection, as well as the "extra" drop down menu.

The add operator adds selected objects to the light linking collection
using the Include policy. For the light linking it means that the objects
are added as receivers that receive the light, and for the shadow linking
it means that objects are added as blockers which cast shadow from the
light.

The communication of the active list element is done via context property
similar to how it was done before. The difference is that these properties
are set on a parent of the list layout, which makes it so they are inherited
by the layout hierarchy needed to place the Remove button.

Pull Request: https://projects.blender.org/blender/blender/pulls/112713
2023-09-22 17:44:25 +02:00
Campbell Barton
f13f61df98 GHOST/Wayland: follow SDL's method of XDG window initialization
Using SDL's initialization logic, this is mainly a change for XDG
as LIBDECOR already required a configure event before accessing
the underlying XDG window.

While I didn't notice functional changes with this change window
flickering on startup remains an issue with some compositors
(KDE & river). Debugging these issues is simpler when both windowing
decoration systems work in a similar way & window configuration
is guaranteed to have run before the window is returned.
(via #xdg_surface_ack_configure).
2023-09-22 12:43:22 +10:00
Brecht Van Lommel
eadb4ad54d Cleanup: compiler warning 2023-09-21 20:10:01 +02:00
Jeroen Bakker
e93bf13626 Windows: Update Min OpenGL Version
https://archive.blender.org/developer/D13885 has added several
messages that mentioned OpenGL 3.3 as minimum requirement.
Blender 4.0 requires OpenGL 4.3 and this PR updates these messages.

Pull Request: https://projects.blender.org/blender/blender/pulls/112575
2023-09-20 09:20:56 +02:00
Weizhen Huang
cae90106ac Fix: Cycles: assert error in microfacet BSDF
due to assigning values to `*eval` and `*pdf` when the label is `LABEL_NONE`.
2023-09-19 15:02:47 +02:00
Campbell Barton
d8b8089630 Cleanup: spelling & typo in last commit 2023-09-19 15:53:51 +10:00
Campbell Barton
085b094f18 Cleanup: use const arguments & variables 2023-09-19 11:09:20 +10:00
Weizhen Huang
05c053cd25 Cycles: make transmission color in Pricipled BSDF match the base color
since the color is applied both at entry and exit, using the square root
of the color would make the perceived color closer to the desired one.
This also makes the transition smoother when changing the `Transmission`
value in the UI, and matches the behaviour of EEVEE.
2023-09-18 18:18:49 +02:00
Weizhen Huang
e894e6a411 Fix: Cycles: wrong refractive index in path guiding
should be the relative IOR of the outgoing media to the incoming media,
depending on `bsdf->ior` and whether the interaction is refraction.
Reference paper: [Robust Fitting of Parallax-Aware Mixtures for Path Guiding](https://uni-tuebingen.de/fakultaeten/mathematisch-naturwissenschaftliche-fakultaet/fachbereiche/informatik/lehrstuehle/computergrafik/lehrstuhl/veroeffentlichungen/robust-fitting-of-parallax-aware-mixtures-for-path-guiding/) Eq (35)

Pull Request: https://projects.blender.org/blender/blender/pulls/112157
2023-09-18 16:20:48 +02:00