Commit Graph

3385 Commits

Author SHA1 Message Date
Brecht Van Lommel
59f8712040 Merge branch 'blender-v4.0-release' into main 2023-10-11 21:14:05 +02:00
Brecht Van Lommel
09046e8121 Fix #113461: Cycles subsurface artifacts with volume interior
Ignore self for the volume stack update from the the subsurface entry to
the exit point. This was meant for other objects only.
2023-10-11 21:13:28 +02:00
Brecht Van Lommel
5baf173609 Fix #113527: Cycles OSL crash with empty closure for layering 2023-10-11 21:12:57 +02:00
Alaska
4f5e684e24 Fix Cycles OSL geometry node point cloud inconsistency
Update the OSL script for the "Geometry" node to follow the correct
Tangent code path when working with point clouds.

There should be no functional change for the end user since the correct
code path was already taken by accident.

Pull Request: https://projects.blender.org/blender/blender/pulls/113472
2023-10-11 21:05:41 +02:00
Xavier Hallade
5aed85dcd7 Cycles: oneAPI: query graphics compiler for supported targets
In case a target isn't supported by the graphics compiler, it will be
filtered out from the target architectures to build for.

Pull Request: https://projects.blender.org/blender/blender/pulls/112669
2023-10-11 18:19:48 +02:00
Xavier Hallade
79b9fff399 Revert "Cycles: oneAPI: query graphics compiler for supported targets"
This reverts commit ad8c5fd441.
As it's currently failing on linux buildbot.
2023-10-11 15:44:55 +02:00
Sergey Sharybin
36e603c430 Cycles: Add option to control smoothing when using bump map
Cycles implements the "Taming the Shadow Terminator" paper by Matt Jen-Yuan
Chiang to solve shadow terminator issues when a bump map is applied, as well
as similar approach for the glossy reflection to ensure ray does not get
reflected to inside of the object.

This correction term is applied unconditionally, which makes it harder to have
full control over shading via normals for stylistic reasons.

This change exposes this corrective term as an option called "Bump Map
Correction" which is available in the shader settings next to the
"Transparent Shadows".

The reason to make it per-shader rather than per-object is to allow flexibility
of a control: it is possible that an object has multiple shaders attached to it,
and only some of them used for bump mapping. Another, and possibly stronger
reason to have it per-shader is ease of assets control: shader brings settings
which are needed for its proper behavior. So if material at some point
decides to take over normals, artists would not need to update settings on
every asset which uses that material.

The option is enabled by default, so there is no changes for existing setups.

Pull Request: https://projects.blender.org/blender/blender/pulls/113480
2023-10-11 15:07:21 +02:00
Xavier Hallade
ad8c5fd441 Cycles: oneAPI: query graphics compiler for supported targets
In case a target isn't supported by the graphics compiler, it will be
filtered out from the target architectures to build for.
2023-10-11 14:59:26 +02:00
Xavier Hallade
c4b49aa391 Cycles: oneAPI: rename target intel arch cmake setting
CYCLES_ONEAPI_SPIR64_GEN_DEVICES -> CYCLES_ONEAPI_INTEL_BINARIES_ARCH
so it's more aligned with the name for the other backends, such as
CYCLES_CUDA_BINARIES_ARCH.
2023-10-11 14:59:26 +02:00
Campbell Barton
137f8dd7bc Cleanup: spelling in comments 2023-10-10 09:44:57 +11:00
Brecht Van Lommel
5bb729b155 Merge branch 'blender-v4.0-release' into main 2023-10-09 19:19:11 +02:00
Alaska
85c4df2c42 Cycles: Update Glass BSDF to generalized_schlick
Update the Glass BSDF to internally use Generalized Schlick fresnel.
This allows for easier expansion of certain features in the future.

There should be no functional change from the users perspective.

Pull Request: https://projects.blender.org/blender/blender/pulls/112701
2023-10-09 19:17:15 +02:00
Campbell Barton
149d80946e Cleanup: CMake formatting 2023-10-07 19:46:38 +11:00
Brecht Van Lommel
1e567d05e9 Merge branch 'blender-v4.0-release' into main 2023-10-06 20:11:54 +02:00
Brecht Van Lommel
c1b4af86b9 Cycles: Speed up principled BSDF when IOR = 1.0
Skip the specular layer of the principled BSDF when IOR=1.0
since it has no visual impact on the material.

Pull Request: https://projects.blender.org/blender/blender/pulls/111586
2023-10-06 20:09:35 +02:00
Alaska
33cbe4c108 Fix Cycles SVM not using IOR Level for Subsurface entry
Make it consistent with OSL.

Pull Request: https://projects.blender.org/blender/blender/pulls/113192
2023-10-06 19:07:59 +02:00
Xavier Hallade
d26a2b09bc Cycles: oneAPI: use hardware cos
Speckles and missing lights were experienced in scenes with Nishita Sky
Texture and a Sun Size smaller than 1.5°, such as in Lone Monk and Attic
scenes.
We previously worked around these by using a more precise
software implementation of cosine.
After recent changes in Cycles, it turns out this workaround isn't
currently needed.
2023-10-06 13:10:27 +02:00
Lukas Stockner
887570065f Fix #112948: Cycles: Principled Sheen over Coat should use Coat normal
Conceptually, Sheen is layered over Coat, so if e.g. a bump map is applied
to the Coat layer, it should also affect Sheen.
2023-10-06 02:22:50 +02:00
Lukas Stockner
97dfbc9a63 Fix #110183: Cycles: Numerical issues with distant area light sampling
The solid angle computation for the sampling/PDF code was running into
cancellation issues for small solid angles.
Reformulating the terms using asin() instead avoids this.
2023-10-05 22:53:33 +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
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
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
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
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
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
Campbell Barton
e38ff7c06d Cleanup: use C++ comments for disabled code 2023-09-25 17:06:04 +10:00
Campbell Barton
2721b937fb Cleanup: use braces in headers 2023-09-24 14:52:38 +10:00
Brecht Van Lommel
eadb4ad54d Cleanup: compiler warning 2023-09-21 20:10:01 +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
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
Weizhen Huang
57990ec3fc Refactor: Cycles: adjust microfacet lobe selection pdf by tint
Now that there are different Fresnel types and the reflectance can be tinted,
it is better to sample based on the actually used Fresnel type, instead of
the original Fresnel. This also avoids computing Fresnel multiple times.

Pull Request: https://projects.blender.org/blender/blender/pulls/112158
2023-09-18 15:32:46 +02:00
Campbell Barton
5b9740c913 Cleanup: use braces for sources in intern/
Omitted intern/itasc as some of these sources are from KDL:
https://www.orocos.org/kdl.html
2023-09-17 09:05:40 +10:00
Jacques Lucke
c001fbb623 Cleanup: fix debug build 2023-09-16 10:58:43 +02:00
Lukas Stockner
5939810b3c Cycles: Remove unused Normal input on Hair BSDF
This was causing a warning when using OSL, since the OSL implementation
didn't implement the input.
Since the socket isn't really implemented on the Blender side anyways,
just get rid of it.

Also, the SVM code uses the shading normal while OSL used the geometric normal.
2023-09-16 03:29:46 +02:00
Lukas Stockner
c963e22a0c Cycles: Fix Geometry node Tangent output for curves when using OSL 2023-09-16 03:29:46 +02:00