Commit Graph

13196 Commits

Author SHA1 Message Date
Campbell Barton
faa3ef6ad5 Cleanup: format 2023-08-19 23:52:47 +10:00
Campbell Barton
20b4a77872 datatoc: exclude the initial C-style comment from GLSL/MSL/Cuda files
Add optional argument `STRIP_LEADING_C_COMMENTS` to CMake macros:
data_to_c_simple & data_to_c.

Strip leading C-style comments that don't bloat binary size.
Comments are replaced with blank lines so line numbers in error messages
match. Reduces Blender's binary size by ~70kb.
2023-08-19 17:57:12 +10:00
Weizhen Huang
6f8011edf7 Cycles: new Principled Hair BSDF variant with elliptical cross-section support
Implements the paper [A Microfacet-based Hair Scattering
Model](https://onlinelibrary.wiley.com/doi/full/10.1111/cgf.14588) by
Weizhen Huang, Matthias B. Hullin and Johannes Hanika.

### Features:
- This is a far-field model, as opposed to the previous near-field
Principled Hair BSDF model. The hair is expected to be less noisy, but
lower roughness values takes longer to render due to numerical
integration along the hair width. The hair also appears to be flat when
viewed up-close.
- The longitudinal width of the scattering lobe differs along the
azimuth, providing a higher contrast compared to the evenly spread
scattering in the near-field Principled Hair BSDF model. For a more
detailed comparison, please refer to the original paper.
- Supports elliptical cross-sections, adding more realism as human hairs
are usually elliptical. The orientation of the cross-section is aligned
with the curve normal, which can be adjusted using geometry nodes.
Default is minimal twist. During sampling, light rays that hit outside
the hair width will continue propogating as if the material is
transparent.
- There is non-physical modulation factors for the first three
lobes (Reflection, Transmission, Secondary Reflection).

### Missing:
- A good default for cross-section orientation. There was an
attempt (9039f76928) to default the orientation to align with the curve
normal in the mathematical sense, but the stability (when animated) is
unclear and it would be a hassle to generalise to all curve types. After
the model is in main, we could experiment with the geometry nodes team
to see what works the best as a default.

Co-authored-by: Lukas Stockner <lukas.stockner@freenet.de>
Pull Request: https://projects.blender.org/blender/blender/pulls/105600
2023-08-18 12:46:13 +02:00
Campbell Barton
bc1ffdce5b Cleanup: spelling in comments 2023-08-18 08:56:12 +10:00
Sergey Sharybin
3a3390fcdd Cleanup: Strict compiler warning
Pull Request: https://projects.blender.org/blender/blender/pulls/111233
2023-08-17 17:22:08 +02:00
Sergey Sharybin
259bfc4553 Fix GradingPrimaryTransform OCIO transform in Metal
This transform generates code `if ( gamma != vec3(1., 1., 1.) )`
which is not compatible with Metal.

This patch adds an extra OCIO code processing which converts syntax
to a portable version. It only handles this specific case for the
processing performance reasons.

To reproduce the issue add the following look at the end of the
config.ocio:

```
  - !<Look>
    name: Grading
    process_space: Filmic Log
    description: TEST
    transform: !<GroupTransform>
      children:
        - !<GradingPrimaryTransform>
          style: log
          contrast: {rgb: [0.7, 0.7, 0.7], master: 1}
          saturation: 1.15
          pivot: {contrast: -0.2}
```

Ref #110685

Pull Request: https://projects.blender.org/blender/blender/pulls/111231
2023-08-17 15:27:51 +02:00
Campbell Barton
0a04a6d1a1 Cleanup: quiet GCC's -Wsuggest-attribute=format warning 2023-08-17 16:52:45 +10:00
Campbell Barton
5478798526 Cleanup: use lowercase cmake commands
The `Find*.cmake` modules originally used uppercase commands to match
CMake's own conventions. Since then CMake uses lower-case and even
within our own find modules, using all uppercase wasn't done
consistently. Opt for lowercase everywhere.
2023-08-17 13:15:56 +10:00
Campbell Barton
c713c70781 CMake: quiet uninitialized warnings 2023-08-17 11:53:56 +10:00
Campbell Barton
3ce80d2168 CMake: remove reference to unused OPENIMAGEIO_DEFINITIONS 2023-08-17 11:53:55 +10:00
Campbell Barton
a7c1a57957 CMake: correct WITH_X11_XF86VMODE include path 2023-08-17 11:53:49 +10:00
Germano Cavalcante
fc39963b31 Cleanup: Deduplicate code
By unifying the return, we don't need to duplicate the `CoTaskMemFree`
call.

Ref 84718feb4b.
2023-08-16 18:29:12 -03:00
Guillermo Venegas
84718feb4b Fix potential leaks using SHGetKnownFolderPath
Documentation for `SHGetKnownFolderPath` remarks that the `PWSTR`
parameter should always be freed with `CoTaskMemFree`  even if it
succeeds or not.

Pull Request: https://projects.blender.org/blender/blender/pulls/111128
2023-08-16 23:10:00 +02:00
Campbell Barton
92c4756d02 Fix replacement of "Blender Foundation" in recent header change
The recent change to header copyrights [0] unintentionally changed
"Blender Foundation" to "Blender Authors" for the WIN32 file path
which blender is installed into.

Revert lines changed that aren't related to copyright text.

[0]: e955c94ed38595cb12fa6cf517b6ba8033017141
2023-08-16 21:21:55 +10:00
Alaska
71587663ac Fix #111156: Principled BSDF transmission not rendering in OSL
After recent changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/111157
2023-08-16 10:14:00 +02:00
Harley Acheson
5741a5d433 UI: Allow Eyedropper Outside of Blender
This adds a new Ghost function, GHOST_GetPixelAtCursor, that allows
picking colors from outside of Blender windows. This only has an
implementation for the Windows platform, but this should allow other
platforms to also do so if possible.

Pull Request: https://projects.blender.org/blender/blender/pulls/105324
2023-08-16 01:14:36 +02:00
Hoshinova
0702c24a36 Nodes: Add Lacunarity and Normalize inputs to Noise node
This PR adds the Lacunarity and Normalize inputs to the Noise node
similar to the Voronoi node.

The Lacunarity input controls the scale factor by which each
successive Perlin noise octave is scaled. Which was previously hard
coded to a factor of 2.

The Noise node normalizes its output to the [0, 1] range by default.
The Normalize option makes it possible for the user to disable that.
To keep the behavior consistent with past versions it is enabled by
default.

To make the aforementioned normalization control easer to implement,
the fractal noise code now accumulates signed noise and remaps the
final sum, as opposed to accumulating positive [0, 1] noise.

Pull Request: https://projects.blender.org/blender/blender/pulls/110839
2023-08-15 17:38:45 +02:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Brian Savery (AMD)
e90ceefd18 Change packed_float3 to internal float3 for HIP
Remove a workaround for no built in vector type in HIP fixed in ROCM 5.1:
    https://github.com/ROCm-Developer-Tools/HIP/issues/706

Shouldn't have any functional change.  Mainly cleaning up the code.

Co-authored-by: arskell <arskell221@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111122
2023-08-15 15:40:29 +02:00
Jeroen Bakker
dd4ab50065 GPU: Add Dummy Backend For Unsupported Platforms
With the introduction of metal and vulkan we use a different
GPU backend selection which broke the dialog box for unsupported
platforms.

Blender asserted and segfaulted before the dialog was being shown
to the user.

This patch solves this by introducing a dummy GPU backend in case no
GPU backend was supported by OpenGL, Metal and Vulkan Backend.

It also adds the showMessageBox to GHOST_SystemCocoa.

Related to #110335

Pull Request: https://projects.blender.org/blender/blender/pulls/110919
2023-08-15 14:15:12 +02: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
311fa9768d Cleanup: spelling in comments 2023-08-12 16:29:51 +10:00
Brecht Van Lommel
6fa4519b98 Cycles: remove unnecessary transform parameters from lights
The transform matrix already specifies everything, no need to duplicate
this which can lead to mistakes.

Ref #110689
2023-08-11 17:41:06 +02:00
Nicolas Sourd
092251b1fd Fix Cycles Hydra render delegate ignoring the light falloff property
If the falloff is defined with a supported value, a LightFalloffNode is added
to the graph, instead of the default EmissionNode.

Pull Request: https://projects.blender.org/blender/blender/pulls/110690
2023-08-11 17:24:08 +02:00
Nicolas Sourd
23ce783f8d Fix Cycles Hydra render delegate not rendering spot lights
Because axisu and axisv were not initialized. The default null vector led
to NaN values in the lighting code.

Pull Request: https://projects.blender.org/blender/blender/pulls/110689
2023-08-11 17:23:36 +02:00
Brecht Van Lommel
ae10823ff2 Fix OSL build error on Windows after recent changes
Include just oslversion.h to avoid conflicts with OIIO in kernel.
2023-08-11 17:06:44 +02:00
Brecht Van Lommel
c5bd71b375 Fix compiler warning about undefined OSL_LIBRARY_VERSION_CODE
Pull Request: https://projects.blender.org/blender/blender/pulls/111048
2023-08-11 14:55:40 +02:00
Campbell Barton
9810942adf Cleanup: avoid uninitialized members in GHOST classes 2023-08-11 09:34:08 +10:00
Lukas Stockner
2ac0b36e4e Cycles: Rework component layering in Principled BSDF
Overall, this commit reworks the component layering in the Principled BSDF
in order to ensure that energy is preserved and conserved.

This includes:
- Implementing support for the OSL `layer()` function
- Implementing albedo estimation for some of the closures for layering purposes
  - The specular layer that the Principled BSDF uses has a proper tabulated
    albedo lookup, the others are still approximations
- Removing the custom "Principled Diffuse" and replacing it with the classic
  lambertian Diffuse, since the layering logic takes care of energy now
- Making the merallic component independent of the IOR

Note that this changes the look of the Principled BSDF noticeably in some
cases, but that's needed, since the cases where it looks different are the
ones that strongly violate energy conservation (mostly grazing reflections
with strong Specular).

Pull Request: https://projects.blender.org/blender/blender/pulls/110864
2023-08-10 23:53:37 +02:00
Jacques Lucke
cc4d5c432c RNA: move headers to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/111022
2023-08-10 22:40:27 +02:00
Brecht Van Lommel
11bca76f96 Cycles: update OSL to work with version 1.13.2
While keeping compatibility with older versions.

Ref #110708

Pull Request: https://projects.blender.org/blender/blender/pulls/110980
2023-08-10 20:01:09 +02:00
Bastien Montagne
bcc0b9f73f Tweaks to previous commit affecting debug reports of our guarded allocator.
Somehow missed these tweaks (from @LazyDodo) in own recent 2e79ca3205
commit, sorry for the noise.
2023-08-10 17:56:36 +02:00
Bastien Montagne
2e79ca3205 Fix #110971: Replace our own barely-working backtrace on memleaks feature with ASAN utils.
Instead of storing the backtrace in all memory blocks, and trying to get
meaningful info out of this list of pointers when printing leaked ones,
just use `__asan_describe_address` when ASAN is enabled.

This also work on Windows, in addition to linux and (presumably) OSX,
but does require to build with ASAN enabled.

The previous code was not working very well anymore, for some reason the
call to `backtrace_symbols` seems to fail to give any meaningful
information nowadays on most of Blender code. And it was only
implemented for linux and OSX.

Based on an idea from @LazyDodo, many thanks!

Pull Request: https://projects.blender.org/blender/blender/pulls/111006
2023-08-10 17:54:56 +02:00
Bastien Montagne
c5feb0cada MEM_guarded_alloc: Fix LSAN not reporting memory leaks.
The fact that the guarded-allocated memory blocks are all linked to the
static `membase` listbase is enough for LSAN to not detect them as
leaks.

So this commit adds a new (private) callback to clear the memlist, which
is only used in the destructor of the `MemLeakDetector` class.

Many thanks to @Sergey for identifying the root issue here.

Pull Request: https://projects.blender.org/blender/blender/pulls/110995
2023-08-10 15:05:53 +02:00
Aras Pranckevicius
d973355b3a Cleanup: reduce amount of math-related includes
Using ClangBuildAnalyzer on the whole Blender build, it was pointing
out that BLI_math.h is the heaviest "header hub" (i.e. non tiny file
that is included a lot).

However, there's very little (actually zero) source files in Blender
that need "all the math" (base, colors, vectors, matrices,
quaternions, intersection, interpolation, statistics, solvers and
time). A common use case is source files needing just vectors, or
just vectors & matrices, or just colors etc. Actually, 181 files
were including the whole math thing without needing it at all.

This change removes BLI_math.h completely, and instead in all the
places that need it, includes BLI_math_vector.h or BLI_math_color.h
and so on.

Change from that:
- BLI_math_color.h was included 1399 times -> now 408 (took 114.0sec
  to parse -> now 36.3sec)
- BLI_simd.h 1403 -> 418 (109.7sec -> 34.9sec).

Full rebuild of Blender (Apple M1, Xcode, RelWithDebInfo) is not
affected much (342sec -> 334sec). Most of benefit would be when
someone's changing BLI_simd.h or BLI_math_color.h or similar files,
that now there's 3x fewer files result in a recompile.

Pull Request #110944
2023-08-10 14:51:40 +03:00
Campbell Barton
cc95c02a89 Fix building WITH_OPENGL_BACKEND=OFF 2023-08-10 17:40:24 +10:00
Campbell Barton
ea10e601fd Cleanup: use _get() suffix for GHOST/Wayland methods
Avoid variables shadowing methods for common names such as
scale & outputs.
2023-08-10 17:38:34 +10:00
Campbell Barton
23cd37de25 Cleanup: redundant checks 2023-08-10 17:11:24 +10:00
Campbell Barton
9dfb3fc550 CMake: refactor flag checking function to take multiple argument pairs
Many calls to add_check_c_compiler_flag add_check_cxx_compiler_flag
resulted in over long lines & visual noise. Replace with a function that
takes multiple (cache_var flag) pairs to reduce duplication.
2023-08-10 11:28:22 +10:00
Sergey Sharybin
ba81908a2d Color management: Improve no-op color space detection
Make it so transform between color spaces which is a no-op does not
peroform any calculations.

This was initially found when working on #110941, but the issue can
be replicated easily by renaming "Linear" to "Linear Rec.709" and
adding alias as "Linear".

Doing so would result in a failure of the compositor_matte_test.
The reason for that is due to the image data-block still referring
to the "Linear" color space, the name-based comparison not detecting
that "Linear" and "Linear Rec.709" are the same spaces, and that the
cryptomatte requires bit-perfect floating point values.

Pull Request: https://projects.blender.org/blender/blender/pulls/110959
2023-08-09 16:24:49 +02:00
Jason Fielder
2367ed2ef2 macOS: Enable support for EDR rendering
Add a High Dynamic Range option in the Color Management > Display panel.
This enables display of extended color ranges above 1.0 for the 3D
viewport, image editor and render previews.

This requires a monitor that can display HDR colors, and a view
transform designed for HDR output. The Standard view transform works,
but Filmic does not as it was designed to bring values into the 0..1
range for SDR displays.

This patch is limited to allowing the display to visualize extended
colors, but does not include future looking work to better integrate HDR
into the full workflow.

It is implemented by rendering to high bit-depth texture formats for
the user interface, and uncapping the color range in color management.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/105662
2023-08-09 14:25:15 +02:00
Campbell Barton
da0fef65c0 Cleanup: remove unsafe string API use
This was only enabled WITH_GHOST_DEBUG, getKeyString now returns
a static string instead of filling in a buffer.
2023-08-09 15:50:32 +10:00
Campbell Barton
bff7962c80 Cleanup: remove redundant struct/void in C++, function style casts 2023-08-09 13:37:37 +10:00
Campbell Barton
5f1b02937a Cleanup: remove 'struct' prefix from GHOST/Wayland types
Move struct members into sub-structs (wl/wp/xdg/xkb) to prevent
naming collisions with the types & struct members.
2023-08-09 12:54:19 +10:00
Clément Foucault
983ff8e616 GPU: Framebuffer: Add multi viewport support
This add the possibility to define different
viewports inside a single framebuffer and
let the vertex shader decide which viewport
to render to.

This only contain the GL and VK implementation.
The Vulkan implementation works but still
has a validation error related to shader features
and extension. The test passes nonetheless.

Pull Request: https://projects.blender.org/blender/blender/pulls/110923
2023-08-08 17:12:49 +02:00
Hoshinova
b880485492 Nodes: add Floored Modulo mode to Math nodes
Both the `Math` node and the `Vector Math` currently only explicitly
support modulo using truncated division which is oftentimes not the
type of modulo desired as it behaves differently for negative numbers
and positive numbers.

Floored Modulo can be created by either using the `Wrap` operation or
a combination of multiple `Math` nodes. However both methods obfuscate
the actual intend of the artist and the math operation that is actually
used.

This patch adds modulo using floored division to the scalar `Math` node,
explicitly stating the intended math operation and renames the already
existing `"Modulo"` operation to `"Truncated Modulo"` to avoid confusion.
Only the ui name is changed, so this should not break compatibility.

Pull Request: https://projects.blender.org/blender/blender/pulls/110728
2023-08-08 12:13:00 +02:00
Sergey Sharybin
d7886ee759 Color management: Further relax threshold for sRGB detection
Apparently, the SSE optimization in the OCIO is not nearly as accurate
as a naive implementation. For example, exponent transform of 1 gives
result of 1.000024.

Ref #110685

Pull Request: https://projects.blender.org/blender/blender/pulls/110895
2023-08-07 15:53:03 +02:00
Jeroen Bakker
b1357f6790 Vulkan: Error When Creating Windows Offscreen Context
Thanks to UPBGE developers to point this one out.

Pull Request: https://projects.blender.org/blender/blender/pulls/110892
2023-08-07 14:58:06 +02:00
Sergey Sharybin
d50b139b06 Color management: Relax threshold for sRGB detection
The current core was only detecting sRGB transform when it is defined
as sRGB->Linear using srgb.spi1d. If it is defined as an inverse of
Linear->sRGB using srgb_inv.spi1d, or as an analytical formula using
ExponentWithLinearTransform then the code did not detect the color
as sRGB on anything by Apple Silicon platform.

The naming of the checks could be improved to make it more clear that
the check is only used to allow lossless access to 8bit sRGB textures.

Ref #110685

Pull Request: https://projects.blender.org/blender/blender/pulls/110889
2023-08-07 14:32:16 +02:00
Alaska
52ed6a216f Fix #110255: Cover up CPU/GPU differences with small suns in light tree
This pull request covers up a subtle difference between the CPU and GPU
when rendering with a light tree. Specifically a case where the user
has a sun light with a small angle.

The difference was caused by the dot() function being different between
CPU and GPU backends, with the GPU showing more meaningful
floating-point precision losses when working with small suns.

Pull Request: https://projects.blender.org/blender/blender/pulls/110307
2023-08-07 07:29:14 +02:00
Campbell Barton
7f34ad736a Cleanup: spelling in comments 2023-08-05 13:54:25 +10:00
Campbell Barton
0caf227530 License headers: use SPDX-FileCopyrightText for *.inl and *.osl files 2023-08-04 13:24:17 +10:00
Campbell Barton
de391cf811 Cleanup: use nullptr instead of zero 2023-08-03 19:17:43 +10:00
Sergey Sharybin
8ea68765fc Fix CUDA error with light linking and emissive world volume
The issue was an out-of-bounds read access when checking whether
the world volume emission needs to be accumulated.

Solution is to check for this case. Done in the generic place, so
that the shade_volume kernel is more readable and no branching
added there, and there is no impact on scenes without the light
linking.

Assume that the world emissive volume belongs to the default light
linking group, as there is no way to link it explicitly to anything.

Pull Request: https://projects.blender.org/blender/blender/pulls/110733
2023-08-03 07:54:06 +02:00
Campbell Barton
8c8ff6b85b Cleanup: spelling in comments, use C-style comments 2023-08-03 09:44:28 +10:00
Campbell Barton
7cc3ef3260 Cleanup: use C++ includes, various non-functional changes for C++ 2023-08-02 20:30:02 +10:00
Kaspian Jakobsson
5a9128af25 Fix #109679: incorrect handling of negative Z normal maps after recent fix
Implement clamped scaling on the Z-axis, so that strength zero means the
normal map has no effect.

Ref #109763
2023-08-01 20:23:12 +02:00
Campbell Barton
dec70e84b6 Cleanup: use nullptr in intern/ghost 2023-08-02 00:21:44 +10:00
Ray molenkamp
2d1d361e6e libmv: Fix missing algorithm header in numeric/poly.h
numeric/poly.h uses std::swap but was not including the `<algorithm>`
header.

Pull Request: https://projects.blender.org/blender/blender/pulls/110659
2023-08-01 15:44:29 +02:00
Campbell Barton
8d4c847052 Fix #110627: crash on start with Wayland
Older versions of Wayland would crash on startup because of the
requested zwp_pointer_gestures_v1 version.

Resolve by supporting older versions.
2023-07-31 22:59:54 +10:00
Campbell Barton
6d2326dabf Cleanup: use function style casts 2023-07-31 19:57:32 +10:00
Alaska
462dbe9929 Fix NaN in Cycles light tree bone.axis
Fix `NaN` in the light tree `bcone.axis` that can occur when
normalizing direction vectors of 0 length.

Pull Request: https://projects.blender.org/blender/blender/pulls/110374
2023-07-31 10:56:15 +02:00
Alaska
18575e411b Cleanup: Cycles device_update_lights
Rearrange and remove some unnecessary lines of code
to improve readability.

Pull Request: https://projects.blender.org/blender/blender/pulls/110377
2023-07-31 10:46:31 +02:00
Alaska
1261272da7 Cleanup: Simplify get centroid in Cycles light tree builder
`scene->lights[object_id` is already available as `lamp`.

Pull Request: https://projects.blender.org/blender/blender/pulls/110376
2023-07-31 10:40:40 +02:00
Campbell Barton
ed01e16aa6 Cleanup: quiet uninitialized warnings 2023-07-29 13:47:57 +10:00
Brecht Van Lommel
635c2591ff Fix #109683: Cycles AOV render without surface output missing attributes 2023-07-28 17:35:50 +02:00
Jacques Lucke
d1aeb1c3b4 Cleanup: add static assert for detect bad usage of MEM_SAFE_FREE
Without this, there is not compilation error when doing e.g.:
```
int a;
MEM_SAFE_FREE(a);
```
2023-07-28 13:50:02 +02:00
Harley Acheson
1f4e59a96f Cleanup: Make format
Small format changes in various files (not just mine).
2023-07-27 13:12:52 -07:00
salipourto
9a150b95c5 Fix #109417: Cycles HIP RT crash with multi device rendering
A couple of checks were missing to handle the multi device rendering.

Pull Request: https://projects.blender.org/blender/blender/pulls/110512
2023-07-27 18:29:58 +02:00
Jacques Lucke
3e6025c1b1 Cleanup: move some files to c++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110529
2023-07-27 13:10:42 +02:00
Lukas Stockner
c66a694056 Cycles: Replace Sheen model in the Principled BSDF
This replaces the Sheen model used in the Principled BSDF with the
model from #108869 that is already used in the Sheen BSDF now.

The three notable differences are:
- At full intensity (Sheen = 1.0), the new model is significantly
  stronger than the old one. For existing files, the intensity is
  adjusted to keep the overall look similar.
- The Sheen Tint input is now a color input, instead of the
  previous blend factor between white and the base color.
- There is now a Sheen roughness control, which can be used to
  tweak the look between velvet-like and dust-like.

Pull Request: https://projects.blender.org/blender/blender/pulls/109949
2023-07-27 02:17:44 +02:00
Brecht Van Lommel
0fab1f4f68 Fix #110170: Cycles CUDA cloud rendering artifacts with spatial splits
The fix in commit d9273d857 exposed a pre-existing issue in the code.
2023-07-26 17:18:45 +02:00
Xavier Hallade
b0d1226b6c Cycles: refine MSVC version check for /jumptablerdata
MSVC_VER 1937 included 17.7 preview 1 and 2 that didn't support the flag
while developers may be using these versions already because of the
issues with 17.6. We now check for preview 3 specifically.
2023-07-25 19:54:59 +02:00
Xavier Hallade
716f909a4f Cycles: add /jumptablerdata to MSVC compiler flags
Starting with MSVC 17.7 preview 3, /jumptablerdata is available and
allows to ensure switch tables don't get mixed with the code, helping on
performance when there is contention in a large switch statement, such
as in svm.h.

Pull Request: https://projects.blender.org/blender/blender/pulls/110470
2023-07-25 19:19:35 +02:00
Ray molenkamp
4ea2baf4ae CMake: revert last weeks modernizations
The cleanup of blenkernel last weeks , caused the house of cards to
collapse on  top of bf_gpu's shader_builder, which is off by default
but used on a daily basis by the rendering team.

Given the fixes forward in #110394 ran into a ODR violation in OSL that
was hiding there for years, I don't see another way forward without
impeding the rendering teams productivity for "quite a while" as there
is no guarantee the OSL issue would be the end of it.

the only way forward appears to be back.

this reverts :

19422044edbd8e8d524db3d02768c4a52f5274be
a670b53abe82f7a36d2caa0d8ae2c67c2bc8c39a
0f541db97c47e5fcd1c71160d71642235d9ea743
be516e8c814dbf7bc43ea91c6913be9f7f96e006
3e88a2f44c413fa7f671f638409a975d59f8c1fb
4e64b772f5ed8f352c2744baece802f70e2430e7
9547e7a317d6f86ab8fbfb3d440f127c2ab75df2
07fe6c5a57d7bcf89318204c0319db1f4a2f5cbd

The problematic commit was 07fe6c5a57d7bcf89318204c0319db1f4a2f5cbd
as blenkernel links most of blender, it's a bit of a link order issue
magnet. Given all these commits stack, it's near impossible to revert
just that one without spending a significant amount of time resolving
merge conflicts. 99% of that work was automated, so easier to just
revert all of them, and re-do the work, than it is to deal with the
merge conflicts.

Pull Request: https://projects.blender.org/blender/blender/pulls/110438
2023-07-25 16:43:21 +02:00
Xavier Hallade
aefc9835f8 Cycles: oneAPI: fix kernel host-side compilation with MSVC 17.7
<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-07-25 12:01:09 +02:00
Campbell Barton
530ee6e7fa Cleanup: make class doc-strings directly above classes
In some cases it wasn't clear if a comment before a class was meant
to be it's doc-string. Remove blank lines between the class & it's
doc-string.
2023-07-25 14:11:42 +10:00
Campbell Barton
ac5be3efde Cleanup: use SPDX copyright in header 2023-07-25 13:59:53 +10:00
Hans Goudey
5e9ea9243b Mesh: Rename "polys" to "faces"
Implements part of #101689.

The "poly" name was chosen to distinguish the `MLoop` + `MPoly`
combination from the `MFace` struct it replaced. Those two structures
persisted together for a long time, but nowadays `MPoly` is gone, and
`MFace` is only used in some legacy code like the particle system.

To avoid unnecessarily using a different term, increase consistency
with the UI and with BMesh, and generally make code a bit easier to
read, this commit replaces the `poly` term with `poly`. Most variables
that use the term are renamed too. `Mesh.totface` and `Mesh.fdata` now
have a `_legacy` suffix to reduce confusion. In a next step, `pdata`
can be renamed to `face_data` as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/109819
2023-07-24 22:06:55 +02:00
Lukas Stockner
b19011e2db Cycles: Fix build error due to missing svm_closure_weight 2023-07-24 16:56:52 +02:00
Lukas Stockner
2c3b095995 Cycles: Don't store SVM closure weight in ShaderData
This is only used as temporary state while evaluating SVM nodes,
there's no point in storing it in the ShaderData for later.
Since ShaderData size is relevant for GPU performance, we should
save the space and only keep it where needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/110366
2023-07-24 16:09:46 +02:00
Lukas Stockner
b220ec27d7 Cycles: Update Velvet BSDF to Sheen BSDF with new Microfiber sheen model
This patch extends the old Velvet BSDF node with a new shading model,
and renames it to Sheen BSDF accordingly.

The old model is still available, but new nodes now default to the
"Microfiber" model, which is an implementation of
https://tizianzeltner.com/projects/Zeltner2022Practical/.

Pull Request: https://projects.blender.org/blender/blender/pulls/108869
2023-07-24 15:36:36 +02:00
Lukas Stockner
56bc24aa9b Cycles: Merge OSL Clearcoat closure into microfacet()
There's no reason why this would need to be its own closure, it was
just a slightly different microfacet distribution with a hardcoded
IOR and intensity multiplier internally.

No functional change, just cleaning up the mess of custom OSL closures.

Pull Request: https://projects.blender.org/blender/blender/pulls/109951
2023-07-22 05:07:11 +02:00
Lukas Stockner
89218b66c2 Cycles: Remove Transmission Roughness from Principled BSDF
This was already unsupported in combination with Multiscattering GGX,
prevented the Principled BSDF from using microfaced-based Fresnel for
Glass materials, and would have made future improvements even trickier.

Pull Request: https://projects.blender.org/blender/blender/pulls/109950
2023-07-22 04:16:49 +02:00
Lukas Stockner
8639bf013c Cycles: Fix MNEE not accounting for closure Fresnel
Previously Glass Fresnel used to get baked into the closure weight,
so the MNEE code could just ignore it.
However, now that it's part of the closure implementation, we need
to account for it in the MNEE throughput calculation as well.
2023-07-22 04:02:14 +02:00
Ray Molenkamp
0f541db97c Cleanup: CMake: Modernize bf_intern_clog dependencies
Pretty straightforward

- Remove any clog paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/110350
2023-07-21 18:37:30 +02:00
Campbell Barton
08f4f1f41e Cleanup: spelling in comments, capitalize tags 2023-07-20 09:42:00 +10:00
Clément Foucault
cdb8a8929c GHOST: Delete Mac OpenGL support
The maximum OpenGL versions supported on mac
doesn't meet the minimum required version (>=4.3) anymore.

This removes all the OpenGL paths in GHOST
Cocoa backend and from the drop down menu in
the user preferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/110185
2023-07-19 14:16:03 +02:00
Jeroen Bakker
567d992a69 Cleanup: Silence Compilation Warnings in GHOST
Pull Request: https://projects.blender.org/blender/blender/pulls/110260
2023-07-19 12:59:49 +02:00
Campbell Barton
29c2e71d1f Cleanup: quiet warnings 2023-07-18 14:18:06 +10:00
–kaspian.jakobssongmail.com
b767a62f32 Fix #109679: Normal Map node strength interpolation artifacts
Previously the normal strength linearly interpolated and extrapolated
the normal in world space. Instead do it in tangent space, in a way
that ensure the normal remains above the surface and valid.

Pull Request: https://projects.blender.org/blender/blender/pulls/109763
2023-07-17 20:06:41 +02:00
Clément Foucault
8191b152ec GHOST: Guard GL context creation behind WITH_OPENGL_BACKEND
Even if not currently needed, it should be possible to compile
without OpenGL.

Also make sure the logic is similar for all GHOST implementations.

Pull Request: https://projects.blender.org/blender/blender/pulls/110165
2023-07-16 19:58:10 +02:00
Campbell Barton
caf0024463 Cleanup: add degrees UTF8 symbol, prefer ascii over unicode in comments 2023-07-16 21:54:58 +10:00
Campbell Barton
d594954bf2 Cleanup: use C++ compatible struct declarations for Python API
Also add m_base & ob_base comments.
2023-07-16 18:13:15 +10:00
Clément Foucault
3478093183 GHOST: Bump OpenGL minimum version to 4.3
This removes the GL 3.3 fallback because default viewport engine
now require some features only present in GL 4.3.
Blender now also check for GL version 4.6 instead of 4.5 in some
cases.

Note that this does not remove the OpenGL support on Apple
hardware.

Pull Request: https://projects.blender.org/blender/blender/pulls/109390
2023-07-15 15:31:40 +02:00
Campbell Barton
3889baab4f Cleanup: spelling in comments 2023-07-15 15:54:55 +10:00
Weizhen Huang
a86506b741 Cleanup: sort enum KernelFeatureFlag in order
no functional change expected
2023-07-14 12:19:11 +02:00
Brecht Van Lommel
cc1ee96407 Fix Cycles HIP RT kernel not rebuilding on changes
Changes to the kernel source would not update the HIP RT binaries, leading
to render errors due to the kernel being mismatched with Blender.

The code this was copied from was inside a macro that defines the sources
variable, but it's not defined here.

Ref #109418

Pull Request: https://projects.blender.org/blender/blender/pulls/110073
2023-07-13 23:08:14 +02:00
Weizhen Huang
4724147479 Fix #109945: Division by zero in brick texture 2023-07-13 15:44:15 +02:00
Sergey Sharybin
99b962811b Cleanup: Fix typo in Cycles error log
Pull Request: https://projects.blender.org/blender/blender/pulls/110045
2023-07-13 09:37:02 +02:00
Harley Acheson
65e8b21a95 Fix #109525: Improved Win32 Repeat Key Filtering
Allows Win32 key repeat filtering to support multiple simultaneously
repeating keys, as can happen with modifiers. Removes
m_keycode_last_repeat_key and instead checks current down status.

Pull Request: https://projects.blender.org/blender/blender/pulls/109991
2023-07-12 20:55:00 +02:00
Germano Cavalcante
75658109be Fix #109630: Grave and Single Quote keys not being detected on MacOS
The `UCKeyTranslate` function was being used wrong.

The `deadKeyState` param should use `kUCKeyTranslateNoDeadKeysMask`
instead of `kUCKeyTranslateNoDeadKeysBit` (optionally could also use
`(1 << kUCKeyTranslateNoDeadKeysBit`)).

This commit also dispenses with accessing the keyAction, as this is not
crucial for determining the key.

Comments have also been added to better describe the code.

Pull Request: https://projects.blender.org/blender/blender/pulls/109987
2023-07-12 20:06:43 +02:00
Harley Acheson
b7a119c785 Fix #40059: Use Modifier Keys Between Windows on Win32
Use modifier keys that are pressed before activating a new window.
Allows call of `wm_window_update_eventstate_modifiers` on
`GHOST_kEventWindowActivate` by using `GetAsyncKeyState` instead of
`GetKeyState` in GHOST_SystemWin32::getModifierKeys, which retrieves
actual hardware state.

Pull Request: https://projects.blender.org/blender/blender/pulls/110020
2023-07-12 20:01:37 +02:00
Brecht Van Lommel
7f04df62e4 Fix Cycles division by zero in recent distant light texture coordinates 2023-07-12 18:14:11 +02:00
Hans Goudey
9a879b27b3 Cleanup: Fix macOS build error, move set performance test out of header
Fixes, similar to a5a72019a910952ac082e9613e95d0c672cf2964

Pull Request: https://projects.blender.org/blender/blender/pulls/110017
2023-07-12 18:04:13 +02:00
Ray Molenkamp
1058fd1b2b Ghost: Fix build error with MSVC 17.7 preview 3
the initialization of m_pkts with an int threw an error with
17.7P3 since it decided int -> uint64_t required a narrowing
conversion. Not sure why it got picky here all of a sudden
but given it's not wrong, we may as well fix it properly.

This change changes the queueSize parameter to size_t and
adds a bounds check at the calling site to ensure the value
it gets will be positive before casting.
2023-07-12 09:32:35 -06:00
Weizhen Huang
0b3efc9d8c Cleanup: Cycles: remove SHARP distribution internally
this option was already unselectable in the UI, and is treated as GGX
with zero roughness. Upon building the shader graph, we only convert a
closure to `SHARP` when option Filter Glossy is not used and the
roughness is below certain threshold. The benefit is that we can avoid
calling `bsdf_eval()` or return earlier in some cases, but the thresholds
vary across files.
This patch removes `SHARP` closures altogether, and checks if the
roughness value is below a global threshold `BSDF_ROUGHNESS_THRESH`
after blurring, in which case the flag `SD_BSDF_HAS_EVAL` is not set.
The global threshold is set to be `5e-7f` because threshold smaller than
that seems to have caused problem in the past (c6aa0217ac). Also removes
a bunch of functions, variables and arguments that were only there
because we converted closures under certain conditions.

Pull Request: https://projects.blender.org/blender/blender/pulls/109902
2023-07-12 12:36:31 +02:00
Harley Acheson
30d44548e3 Fix #109886: Win32 AutoFocus Between Main Windows
Allow auto-focusing between multiple parent (main) windows when they
are immediately adjacent.

Pull Request: https://projects.blender.org/blender/blender/pulls/109946
2023-07-11 21:13:50 +02:00
Ray molenkamp
07fe6c5a57 Cleanup: CMake: Modernize bf_blenkernel dependencies
Pretty straightforward

- Remove any blenkernel paths from INC
- Add a dependency though LIB

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/109939
2023-07-11 19:28:01 +02:00
Clément Foucault
40f89d23cb GHOST: Fix OpenGL backend isolation on Linux
This makes sure you can compile without the
WITH_OPENGL_BACKEND option.
2023-07-11 11:32:45 +02:00
Clément Foucault
1978b4fc92 GHOST: Replace WITH_OPENGL build option
Replaces it by WITH_OPENGL_BACKEND and cleanup its usage.
Limits visibility of opengl enums and cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/109947
2023-07-11 09:17:31 +02:00
Ray Molenkamp
04235d0e55 Cleanup: CMake: Modernize bf_blenlib dependencies
Pretty straightforward

- Remove any blenlib paths from INC
- Add a dependency though LIB

Pull Request: https://projects.blender.org/blender/blender/pulls/109934
2023-07-10 22:04:18 +02:00
Ray Molenkamp
57ad866d81 Cleanup: CMake: Modernize bf_guardedalloc dependencies
Pretty straightforward

- Removes any guardedalloc paths from INC
- Adds a dependency though LIB

Pull Request: https://projects.blender.org/blender/blender/pulls/109925
2023-07-10 18:44:19 +02:00
Hoshinova
41335edf22 Fix #109254: Voronoi distance output is clamped at 8
The Voronoi distance output is clamped at 8, which is apparent for distance
metrics like Minkowski with low exponents.

This patch fixes that by setting the initial distance of the search loop to
FLT_MAX instead of 8. And for the Smooth variant of F1, the "h" parameter is set
to 1 for the first iteration using a signal value, effectively ignoring the
initial distance and using the computed distance at the first iteration instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/109286
2023-07-10 17:42:24 +02:00
Ray Molenkamp
7cebb61486 Cleanup: CMake: Modernize bf_dna dependencies
There's quite a few libraries that depend on dna_type_offsets.h
but had gotten to it by just adding the folder that contains it to
their includes INC section without declaring a dependency to
bf_dna in the LIB section.

which occasionally lead to the lib building before bf_dna and the
header being missing, while this generally gets fixed in CMake by
adding bf_dna to the LIB section of the lib, however until last
week all libraries in the LIB section were linked as INTERFACE so
adding it in there did not resolve the build issue.

To make things still build, we sprinkled add_dependencies wherever
we needed it to force a build order.

This diff :

Declares public include folders for the bf_dna target so there's
no more fudging the INC section required to get to them.

Removes all dna related paths from the INC section for all
libraries.

Adds an alias target bf:dna to signify it has been updated to
modern cmake

Declares a dependency on bf::dna for all libraries that require it

Removes (almost) all calls to add_dependencies for bf_dna

Future work:

Because of the manual dependency management that was done, there is
now some "clutter" with libs depending on bf_dna that realistically
don't. Example bf_intern_opencolorio itself has no dependency on
bf_dna at all, doesn't need it, doesn't use it. However the
dna include folder had been added to it in the past since bf_blenlib
uses dna headers in some of its public headers and
bf_intern_opencolorio does use those blenlib headers.

Given bf_blenlib now correctly declares the dependency on bf_dna
as public bf_intern_opencolorio will get the dna header directory
automatically from CMake, hence some cleanup could be done for
bf_intern_opencolorio

Because 99% of the changes in this diff have been automated, this diff
does not seek to address these issues as there is no easy way to
determine why a certain dependency is in place. A developer will have
to make a pass a this at some later point in time. As I'd rather not
mix automated and manual labour.

There are a few libraries that could not be automatically processed
(ie bf_blendthumb) that also will need this manual look-over.

Pull Request: https://projects.blender.org/blender/blender/pulls/109835
2023-07-10 15:07:37 +02:00
Brecht Van Lommel
f2705dd913 Fix #109683: Cycles and Eevee missing AOVs when no closure connected
No reason to skip these, and this will be useful for faster shader node
preview rendering based on AOVs.

Pull Request: https://projects.blender.org/blender/blender/pulls/109709
2023-07-10 12:41:44 +02:00
Weizhen Huang
ab12d2836b Cycles: add texture to sun light
Using area-preserving mapping from cone to disk. Has somewhat distortion
near 90°.
The texture rotates with the transformation of the light object, can
have negative and non-uniform scaling.

Pull Request: https://projects.blender.org/blender/blender/pulls/109842
2023-07-10 12:20:47 +02:00
Campbell Barton
4da96623ff CMake: use mark_as_advancd for most non WITH_* options
Avoid showing many obscure CMake options by default.
2023-07-10 12:02:15 +10:00
Campbell Barton
6290451712 Cleanup: spelling in comments 2023-07-09 21:22:45 +10:00
Guillermo Venegas
751db88748 Fix #109532: Added missing conversion from wl_fixed to int in Wayland
When blender is not focused and a selection is executed
with the mouse, since there is no conversion from `wl_fixed` to `int`,
the bounds of the selection can cause the selection box to be too large,
causing `draw_select_framebuffer_depth_only_setup` to fail when create
`g_select_buffer.texture_depth`.

Ref !109834
2023-07-09 16:57:37 +10:00
Brecht Van Lommel
7e55dfcf27 Fix #103918: Cycles point cloud motion blur artifacts on the GPU
Change storage to consistently put xyz + radius in the motion blur attribute.

Pull Request: https://projects.blender.org/blender/blender/pulls/109830
2023-07-07 20:15:36 +02:00
Brecht Van Lommel
f36d8eb064 Cycles Hydra: set background color depending if there are lights
So that there is some lighting when there are no lights in the scene,
and black when there are lights. This matches the behavior of other
Hydra renderers.

Ref #96731
2023-07-07 18:20:57 +02:00
Brecht Van Lommel
05c97df2de USD: improve light units conversion
* Use pi factor to convert between radiant flux and intensity
* Mark lights as normalized on export
* Add spot light export support
* Add treatAsPoint support for import and export
* Empirically match normalized distant light
* Fix wrong unnormalized point/sphere/disk light unit in Cycles

Overall it should be much closer now for all light types. Point and distant
light units are inconsistent between renderers, so not possible to match
everything there.

Ref #109404

Pull Request: https://projects.blender.org/blender/blender/pulls/109795
2023-07-07 18:20:39 +02:00
Lukas Stockner
213204c229 Cycles: Change sun lamp to have uniform intensity at high angles
This fixes the issue described in https://projects.blender.org/blender/blender/issues/108957.

Instead of modeling distant lights like a disk light at infinity, it models them as cones. This way, the radiance is constant across the entire range of directions that it covers.

For smaller angles, the difference is very subtle, but for very large angles it becomes obvious (here's the file from #108957, the angle is 179°):
| Old | New |
| - | - |
| ![old_bigsun.png](/attachments/4ef8e7a7-1a29-4bdf-a74c-3cfa103bf1e7) | ![new_bigsun.png](/attachments/d53c7749-2672-40b6-9048-ccf2fffceeb7) |

One notable detail is the sampling method: Using `sample_uniform_cone` can increase noise, since the sampling method no longer preserves the stratification of the samples. This is visible in the "light tree multi distant" test scene.
Turns out we can do better, and after a bit of testing I found a way to adapt the concentric Shirley mapping to uniform cone sampling. I hope the comment explains the logic behind it reasonably well.

Here's the result, note that even the noise distribution is the same when using the new sampling:
| Method | Old | New, basic sampling | New, concentric sampling |
| - | - |- | - |
| Image | ![old.png](/attachments/b3258a70-f015-4065-a774-193974cce439) | ![new_basic.png](/attachments/a9008576-0af6-4152-a687-c800fd958bbd) | ![new_concentric.png](/attachments/769b6c43-34bc-434e-a4fd-ce69addd1ba5) |
| Render time (at higher spp)| 9.03sec | 8.79sec | 8.96sec |

I'm not sure if I got the `light->normalized` handling right, since I don't really know what the expectation from Hydra is here.

Co-authored-by: Weizhen Huang <weizhen@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/108996
2023-07-07 17:20:19 +02:00
Weizhen Huang
9fe87646d5 Cycles: replace spot light disk sampling with sphere sampling
The spotlight is now treated as a sphere instead of a view-aligned disk.
The implementation remains almost identical to that of a point light,
except for the spotlight attenuation and spot blend. There is no
attenuation inside the sphere. Ref #108505

Other changes include:
## Sampling
Instead of sampling the disk area, the new implementation samples either
the cone of the visible portion on the sphere or the spread cone, based
on which cone has a smaller solid angle. This reduces noise when the
spotlight has a large radius and a small spread angle.
| Before | After  |
|   --   |   --   |
|![spot_size_before.png](/attachments/04ea864a-6bf9-40fe-b11b-61c838ae70cf)|![spot_size_after.png](/attachments/7077eaf9-b7a8-41b1-a8b6-aabf1eadb4f4)
## Texture
Spot light can now project texture using UV coordinates.
<video src="/attachments/6db989d2-7a3c-4b41-9340-f5690d48c4fb"
title="spot_light_texture.mp4" controls></video>
## Normalization
Previously, the normalization factor for the spotlight was \(\pi r^2\),
the area of a disk. This factor has been adjusted to \(4\pi r^2\) to
account for the surface area of a sphere. This change also affects point
light since they share the same kernel type.
## Versioning
Some pipeline uses the `Normal` socket of the Texture Coordinate node for
projection, because `ls->Ng` was set to the incoming direction at the
current shading point. Now that `ls->Ng` corresponds to the normal
direction of a point on the sphere (except when the radius is zero),
we replace these nodes with a combination of the Geometry shader node
and the Vector Transform node, which gives the same result as before.
![versioning.png](/attachments/5bbfcacc-26c5-4f7f-8360-c42bcd851f68)
Example file see https://archive.blender.org/developer/T93676

Pull Request: https://projects.blender.org/blender/blender/pulls/109329
2023-07-07 17:15:18 +02:00
Weizhen Huang
482211b7e0 Fix wrong conversion from power to radiance of area lights
The correct conversion factor should be 1 / (pi * area), see #108505

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/109153
2023-07-07 17:03:02 +02:00
Ray Molenkamp
f0ee4c3ffe Cleanup: Cmake: use alias target for bf_intern_atomic
This introduces an alias target `bf::intern::atomic` for
`bf_intern_atomic`. This has the following benefits:

- Any target name with `::` in it will be recognized as an actual
target by cmake, rather than a library name it may not know about.
and will be validated by cmake to exist. Which means if you make
a typo in the LIB section, CMake will error out telling you it
doesn't know about this specific target rather than passing it on
to the build system, where you'll either get build or linker errors
because of said typo.

- Given there is quite a cleanup still to do in the build system,
it won't always be obvious which targets have been updated to
modern targets and which still need to be done. Having a namespaced
target name is a good indicator there.

Pull Request: https://projects.blender.org/blender/blender/pulls/109784
2023-07-07 15:37:02 +02:00
Campbell Barton
d7cfa51e49 Cleanup: declare const variables 2023-07-07 16:00:50 +10:00
Campbell Barton
23acedd432 Cleanup: code-comments 2023-07-07 15:11:19 +10:00
Ray Molenkamp
235c564aa0 Cycles: re-Fixed oneAPI build on Windows
fixes one uint missed in a0846a60c9a1
2023-07-06 14:47:35 -06:00
Stefan Werner
a0846a60c9 Cycles: Fixed oneAPI build on Windows
Turns out uint wasn't defined this early in our kernels on Windows.
Using unsigned int instead should fix this.
2023-07-06 21:50:03 +02:00
Hoshinova
c9fbbea261 Cleanup: Assign corresponding expressions to variable params.max_distance
Pull Request: https://projects.blender.org/blender/blender/pulls/109328
2023-07-06 18:13:22 +02:00
Werner, Stefan
7befc40386 Cycles: Use sycl::bitcast in oneAPI backend
Using sycl::bitcast instead of union hack
2023-07-06 15:06:33 +02:00
Werner, Stefan
d7794f3540 Cycles: Fixed SYCL build with newer compilers 2023-07-06 15:06:33 +02:00
Jeroen Bakker
4731beec99 Cleanup: Remove unused code in GHOST_ContextCGL
GHOST_ContextCGL used an incorrect compiler directive. When reading
the comment we could also remove it. In order to do the right thing
(fixing directive vs removing code) we opened this pull request to
ask feedback.

Pull Request: https://projects.blender.org/blender/blender/pulls/109686
2023-07-06 13:04:18 +02:00
Brecht Van Lommel
b96c15172b Cycles: remove Point Density Texture support for surfaces
This is only intended for volumes, and including volume features in the
surface kernels negatively impacts GPU rendering performance.

Pull Request: https://projects.blender.org/blender/blender/pulls/109712
2023-07-05 18:05:25 +02:00
Xavier Hallade
d55cdb1b7a Cycles: improve oneAPI requirements text in the UI
Pull Request: https://projects.blender.org/blender/blender/pulls/109644
2023-07-05 12:16:04 +02:00
Sergey Sharybin
bad41885db Cleanup: Mark unused function arguments as such
A lot of such cases got discovered since recent change to CLang's
compiler flags for C++.

Pull Request: https://projects.blender.org/blender/blender/pulls/109732
2023-07-05 12:02:06 +02:00
Campbell Barton
785bd13b9a Cleanup: spelling in comments 2023-07-05 14:09:33 +10:00
Campbell Barton
39cafb43d3 Cleanup: remove unnecessary use of strncpy 2023-07-05 13:58:02 +10:00
Campbell Barton
093a948322 Cleanup: remove_cc_flag use in CMake
- Pass multiple arguments at once.
- Move comments above each argument.
- Quote the arguments (for consistency).
2023-07-05 13:27:21 +10:00
Ray Molenkamp
fac69131ab Cleanup: make format 2023-07-04 08:26:24 -06:00
Michael Jones
24ebf489d6 Cycles: Make use of maximum concurrent compilations on Metal
This patch queries the MTLDevice `maximumConcurrentCompilationTaskCount` property (macOS >= 13.3) to spawn more compilation threads if available.

Pull Request: https://projects.blender.org/blender/blender/pulls/109689
2023-07-04 15:01:48 +02:00
Nikita Sirgienko
7c4108567b Cycles: Embree: Resolve padding-related issue during buffer creations 2023-07-04 13:41:45 +02:00
Nikita Sirgienko
e73bb628ee Cycles: Fix Out-Of-Bounds issues during Embree BVH building 2023-07-04 13:41:25 +02:00
Brecht Van Lommel
f4da74ed29 Revert "Cycles: Make use of maximum concurrent compilations on Metal"
This reverts commit 63d3fc2dcbe481ec85dfae517cf6a1318971913c, because it
causes a build error on the buildbot.

Ref #109655
2023-07-03 20:30:22 +02:00
Michael Jones
63d3fc2dcb Cycles: Make use of maximum concurrent compilations on Metal
This patch queries the MTLDevice `maximumConcurrentCompilationTaskCount` property (macOS >= 13.3) to spawn more compilation threads if available.

Pull Request: https://projects.blender.org/blender/blender/pulls/109655
2023-07-03 18:09:13 +02:00
Sergey Sharybin
4e165c9d6f Update Eigen to version 3.4.0
Reportedly, it helps moving the Windows Arm libraries forward.

Pull Request: https://projects.blender.org/blender/blender/pulls/109378
2023-07-03 15:09:20 +02:00
Nikita Sirgienko
7977247995 Cycles: Avoid printing capabilities when there are no devices
Pull Request: https://projects.blender.org/blender/blender/pulls/109511
2023-07-03 13:09:41 +02:00
Campbell Barton
69aee8ba6b Cleanup: remove redundant (void) for functions with no args in C++ 2023-07-02 19:54:27 +10:00