Commit Graph

12358 Commits

Author SHA1 Message Date
Aaron Carlisle
4701421dbe UI: Remove unused light object panel (Correction)
This panel showed a duplication of options that were in the main light panel and only mistakenly shows up in the workbench engine where lights should have no options.

This panel was also used by the POV-Ray add-on but that was removed recently.
2022-12-23 19:06:29 -05:00
Lukas Stockner
4c295276f0 Cycles: Fix Metal kernel compilation 2022-12-21 04:24:22 +01:00
Germano Cavalcante
1a986f7eba Revert "Fix erratic mouse wrapping movement on Windows (2)"
This reverts commit a3a9459050a96e75138b3441c069898f211f179c.

And fixes T103337.

a3a9459050a9 has some flaws and it needs to go through review (See D16803).

Conflicts:
	intern/ghost/intern/GHOST_SystemWin32.cpp
2022-12-19 10:41:05 -03:00
Campbell Barton
0cc573c8c4 Cleanup: white space around comment blocks 2022-12-17 15:58:30 +11:00
Campbell Barton
2ac6e26c25 Cleanup: cmake formatting 2022-12-17 13:33:27 +11:00
Campbell Barton
6797de4e10 Cleanup: spelling in comments 2022-12-17 13:15:33 +11:00
Lukas Stockner
347c82be6d Fix T98951: Shadow catcher objects are double-counting data passes
Differential Revision: https://developer.blender.org/D16627
2022-12-17 01:45:07 +01:00
Lukas Stockner
7c85f11c42 Cycles: Change bake jittering to avoid issues with skinny triangles
Partially addresses T72011.

The problem here is that the previous barycentric clamping did not deal well
with skinny triangles and would end up generating "sub-pixel jittering"
locations that were actually >20 pixels away.

Differential Revision: https://developer.blender.org/D16727
2022-12-17 01:16:14 +01:00
Charlie Jolly
bea5fe6505 Nodes: Add Exclusion color mix mode
Expands Color Mix nodes with new Exclusion mode.

Similar to Difference but produces less contrast.

Requested by Pierre Schiller @3D_director and
@OmarSquircleArt on twitter.

Differential Revision: https://developer.blender.org/D16543
2022-12-16 15:42:41 +00:00
Patrick Mours
a8530d31c2 Fix T103258: Deleting a shader with OptiX OSL results in an illegal address error
Materials without connections to the output node would crash with OSL
in OptiX, since the Cycles `OSLCompiler` generates an empty shader
group reference for them, which resulted in the OptiX device
implementation setting an empty SBT entry for the corresponding direct
callables, which then crashed when calling those direct callables was
attempted in `osl_eval_nodes`. This fixes that by setting the SBT entries
for empty shader groups to a dummy direct callable that does nothing.
2022-12-16 15:41:21 +01:00
Patrick Mours
c9eb583460 Fix T103257: Enabling or disabling viewport denoising while using OptiX OSL results in an error
Switching viewport denoising causes kernels to be reloaded with a new
feature mask, which would destroy the existing OptiX pipelines. But OSL
kernels were not reloaded as well, leaving the shading pipeline
uninitialized and therefore causing an error when it is later attempted to
execute it. This fixes that by ensuring OSL kernels are always reloaded
when the normal kernels are too.
2022-12-16 14:04:03 +01:00
Campbell Barton
79a34758f5 Fix T103253: Infinite drag of number buttons is broken on WIN32
Recent reverting of changes to cursor grabbing intended to match
Blender 3.3 release. This is the case for 3.4x branch, however there is
an additional change to grabbing on WIN32 by Germano [0] which is a
significant improvement on old grabbing logic for Windows.
So instead of matching 3.3x behavior, restore logic that keeps
the cursor centered while grabbing & hidden.

This re-introduces T102792 issue displaying the paint-brush while
dragging buttons, this will have to be solved separately.

Re-apply [1] & [2], revert [3] & [4].

[4]: a3a9459050a96e75138b3441c069898f211f179c
[0]: 9fd6dae7939a65b67045749a0eadeb6864ded183
[1]: 4cac8025f00798938813f52dcb117be83db97f22
[2]: 230744d6fd96dcf5afe66a8f9b9f6f8bbe1f41bb
[3]: 0240b895994aa58258db6897ae0d6478da7fce5f
2022-12-16 18:38:22 +11:00
Campbell Barton
2c22795dfd Build: upgrade pre-built libraries for Linux
Replace ../lib/linux_centos7_x86_64 with ../lib/linux_x86_64_glibc_228,
built with Rocky8 Linux, compatible with the VFX platform CY2023,
see: T99618.

- Update build-bot configuration.
- Remove unnecessary check for Blosc, this is part of OpenVDB lib now.
- Remove WITH_CXX11_ABI, always use new C++11 ABI now
- Replace centos7 by glibc_228 everywhere

Note that existing builds with cached paths pointing to
"../lib/linux_centos7_x86_64" will need to be updated.

Includes contributions by Brecht.
2022-12-16 10:42:40 +11:00
Brecht Van Lommel
3d29bbcc38 Fix T103049: Cycles specular light leak regression
The logic here is not ideal but was unintentionally changed in refactoring
for path guiding, now restore it back to 3.3 behavior again.
2022-12-15 21:49:59 +01:00
Brecht Van Lommel
62f8d0d8c8 Fix T103170: missing Cycles viewport light threshold update after exposure edit 2022-12-15 19:13:55 +01:00
Thomas Dinges
ba347d7c9e Fix Cycles UI for Scrambling Distance, only works with Tabulated Sobol.
Thanks to Alaska for finding this.
2022-12-15 10:44:56 +01:00
Thomas Dinges
69d1ddd4c6 Fix Cycles Light Tree UI after recent changes. 2022-12-15 10:25:06 +01:00
Campbell Barton
7571222a69 Cleanup: add trailing commas for multi-line collections
Avoid accidentally missing commas between strings, see: T101020.
Also use single quotes for enum identifiers.
2022-12-15 17:34:09 +11:00
Campbell Barton
18cc1b1108 Fix cursor warping display under Wayland
Under Wayland the transform cursor wasn't displaying the warped cursor.

This worked on other platforms because cursor motion is warped where as
Wayland simulates cursor warping, so it's necessary to apply warping
when requesting the cursor location too.
2022-12-15 15:22:52 +11:00
Campbell Barton
d715573aea Cleanup: declare GHOST_Window::getCursorGrabBounds as const
Needed so it the method can be called on a cosnt GHOST_Window.
2022-12-15 15:10:51 +11:00
Campbell Barton
b147af2b7e Cleanup: remove duplicate doc-strings 2022-12-15 14:56:58 +11:00
Campbell Barton
230744d6fd Revert "Fix T102346: Mouse escapes window during walk navigation"
This reverts commits
9fd6dae7939a65b67045749a0eadeb6864ded183,
4cac8025f00798938813f52dcb117be83db97f22 (minor cleanup).

Re-introducing T102346, which will be fixed in isolation.

Unfortunately even when the cursor is hidden & grabbed,
the underlying cursor coordinates are still shown in some cases.

This caused bug where dragging a button in the sculpt-context popup
would draw the brush at unexpected locations because internally
the cursor was warping in the middle of the window, reported as T102792.

Resolving this issue with the paint cursor is possible but tend towards
over-complicated solutions.

Revert this change in favor of a more localized workaround for walk-mode
(as was done prior [0] to fix T99021).

[0]: 4c4e8cc926a672ac60692b3fb8c20249f9cae679
2022-12-15 12:15:23 +11:00
Germano Cavalcante
a3a9459050 Fix erratic mouse wrapping movement on Windows (2)
This is a solution in response to the issues mentioned in comments on
rBe4f1d719080a and T103088.

Apparently the workaround of checking if the mouse is already inside
the area on the next event doesn't work for some tablets.

Perhaps the order of events or some very small jitter is causing this
issue on tablets. (Couldn't confirm).

Whatever the cause, the solution of checking the timestamp of the event
and thus ignoring the outdated ones is theoretically safer.

It is the same solution seen in MacOS.

Also calling `SendInput` 3 times every warp ensures that at least one
event is dispatched.
2022-12-14 16:08:21 -03:00
Hallam Roberts
a501a2dbff Images: add mirror extension type
This adds a new mirror image extension type for shaders and
geometry nodes (next to the existing repeat, extend and clip
options).

See D16432 for a more detailed explanation of `wrap_mirror`.

This also adds a new sampler flag `GPU_SAMPLER_MIRROR_REPEAT`.
It acts as a modifier to `GPU_SAMPLER_REPEAT`, so any `REPEAT`
flag must be set for the `MIRROR` flag to have an effect.

Differential Revision: https://developer.blender.org/D16432
2022-12-14 19:27:29 +01:00
Brecht Van Lommel
8c14992db2 Fix syntax errors in Cycles float8 test 2022-12-14 19:01:42 +01:00
Brecht Van Lommel
77a4ab3ccf Fix wrong syntax in Cycles float8 test fix 2022-12-14 18:36:48 +01:00
Hans Goudey
9fd834fbb3 Fix T103143: Cycles can lose default color attribute
The `render_color_index` skips attributes with different types
and domains in order to give the proper order for the UI list.
That is a different than an index in the group of all attributes.

The most solid solution I could think of is exposing the name of
the default color attribute. It's "solid" because we always address
attributes by name internally. Doing something different is bound
to create problems. It's also aligned with the design in T98366 and
D15169.

Another option would be to change the way the "attribute index"
is incremented in Cycles. That would be a valid solution, but would
be more complex and annoying.

For consistency, I also exposed the name of the active color attribute
the same way, though it isn't necessary to fix this particular bug.

The properties aren't editable, that can come in 3.5 as part of D15169.

Differential Revision: https://developer.blender.org/D16769
2022-12-14 11:26:11 -06:00
Nathan Vegdahl
d9192aaa6d Cycles: limit the internal sample index of Sobol-Burley for performance
This is done based on the render sample count so that it doesn't impact
sampling quality. It's similar in spirit to the adaptive table size in D16561,
but in this case for performance rather than memory usage.

Differential Revision: https://developer.blender.org/D16726
2022-12-14 17:39:13 +01:00
Nathan Vegdahl
b0cc8e8dde Cycles: switch from pretabulated 2D PMJ02 to pretabulated 4D Sobol
The first two dimensions of scrambled, shuffled Sobol and shuffled PMJ02 are
equivalent, so this makes no real difference for the first two dimensions.
But Sobol allows us to naturally extend to more dimensions.

Pretabulated Sobol is now always used, and the sampling pattern settings is now
only available as a debug option.

This in turn allows the following two things (also implemented):

* Use proper 3D samples for combined lens + motion blur sampling. This
  notably reduces the noise on objects that are simultaneously out-of-focus
  and motion blurred.
* Use proper 3D samples for combined light selection + light sampling.
  Cycles was already doing something clever here with 2D samples, but using
  3D samples is more straightforward and avoids overloading one of the
  dimensions.

In the future this will also allow for proper sampling of e.g. volumetric
light sources and other things that may need three or four dimensions.

Differential Revision: https://developer.blender.org/D16443
2022-12-14 17:39:13 +01:00
Brecht Van Lommel
ecfcf1b97b Cycles: disable light tree for existing scenes, enable on new scenes
While it helps on many scenes, it can be disruptive for existing scenes and
for benchmarks the differences in timing can be confusing. So be a bit more
conservative and only it enable it for new scenes.
2022-12-14 17:39:13 +01:00
Brecht Van Lommel
2221cfc044 Cleanup: GCC compiler warnings in Cycles float8 test 2022-12-14 17:39:13 +01:00
Germano Cavalcante
fe3110a285 Fix FallbackCyclesBlitShader compilation error
Error: C0204: version directive must be first statement and may not be
repeated
2022-12-14 11:59:40 -03:00
Patrick Mours
c30fdb9cf5 Fix mismatching PTX function declarations for OSL intrinsics with string parameters
The use of a struct for device strings caused the CUDA compiler to
generate byte arrays as the argument type, whereas OSL generated
primitive integer types (for the hash). Fix that by using a typedef
instead so that the CUDA compiler too will use an integer type in the
PTX it generates.

Maniphest Tasks: T101222
2022-12-14 15:23:27 +01:00
Campbell Barton
fd36221930 GHOST/Wayland: fix memory leak when Wayland fails to start 2022-12-14 17:09:55 +11:00
Harley Acheson
93a629f147 Fix T103119: Allow Win32 Diacritical Composition
Allow keyboard layouts which include "dead keys" to enter diacritics
by calling MapVirtualKeyW even when not key_down.

See D16770 for more details.

Differential Revision: https://developer.blender.org/D16770

Reviewed by Campbell Barton
2022-12-13 18:30:20 -08:00
Hans Goudey
75ad8da1ea Refactor: Replace old Mesh edge split implementation
Recently a new geometry node for splitting edges was added in D16399.
However, there was already a similar implementation in mesh.cc that was
mainly used to fake auto smooth support in Cycles by splitting sharp
edges and edges around sharp faces.

While there are still possibilities for optimization in the new code,
the implementation is safer and simpler, multi-threaded, and aligns
better with development plans for caching topology on Mesh and other
recent developments with attributes.

This patch removes the old code and moves the node implementation to
the geometry module so it can be used in editors and RNA. The "free
loop normals" argument is deprecated now, since it was only an internal
optimization exposed for Cycles.

The new mesh `editors` function creates an `IndexMask` of edges to
split by reusing some of the code from the corner normal calculation.

This change will help to simplify the changes in D16530 and T102858.

Differential Revision: https://developer.blender.org/D16732
2022-12-13 18:40:06 -06:00
Jacques Lucke
b50c475cd2 Cleanup: move listbase.c to c++ 2022-12-13 18:13:10 +01:00
Weizhen Huang
f56488c20f Fix Cycles ellipse area light returns zero pdf in volume segment 2022-12-12 21:38:23 +01:00
Weizhen Huang
e378bd70ed Cleanup: remove code duplication in cycles light sampling
There has been an attempt to reorganize this part, however, it seems that didn't compile on HIP, and is reverted in
rBc2dc65dfa4ae60fa5d2c3b0cfe86f99dcb5bf16f. This is another attempt of refactoring. as I have no idea why some things don't work on HIP, it's
best to check whether this compiles on other platforms.
The main changes are creating a new struct named `MeshLight` that is shared between `KernelLightDistribution` and `KernelLightTreeEmitter`,
and a bit of renaming, so that light sampling with or without light tree could call the same function.
Also, I noticed a patch D16714 referring to HIP compilation error. Not sure if it's related, but browsing
https://builder.blender.org/admin/#/builders/30/builds/7826/steps/7/logs/stdio, it didn't work on gfx1102, not gfx9*.

Differential Revision: https://developer.blender.org/D16722
2022-12-12 21:25:09 +01:00
Brecht Van Lommel
e4f9c50928 Fix T102990: OpenVDB files load very slow from network drives
The OpenVDB delay loading of voxel leaf data using mmap works poorly on network
drives. It has a mechanism to make a temporary local file copy to avoid this,
but we disabled that as it leads to other problems.

Now disable delay loading entirely. It's not clear that this has much benefit
in Blender. For rendering we need to load the entire grid to convert to NanoVDB,
and for geometry nodes there also are no cases where we only need part of grids.
2022-12-12 18:28:09 +01:00
Brecht Van Lommel
95a792a633 Fix wrong Cycles standalone exposure default value, should be 1 2022-12-12 18:28:09 +01:00
Brecht Van Lommel
f53bd17836 Cycles: take into account film exposure for light sampling threshold
To avoid issues with lights being either skipped or sampled unnecessarily
when the exposure is set low or high.

Contributed by Alaska.

Differential Revision: https://developer.blender.org/D16703
2022-12-12 18:28:09 +01:00
Brecht Van Lommel
312e42708f Fix T103066: Cycles missing full constant foler for mix float and mix vector 2022-12-12 18:28:09 +01:00
Brecht Van Lommel
18abc2feaa Fix Cycles light tree not working with negative light strength
Use absolute value of emission as estimate to make this work.

Contributed by Alaska.

Differential Revision: https://developer.blender.org/D16718
2022-12-12 18:28:09 +01:00
Thomas Dinges
54aec4629e Cleanup: Remove unused code in Cycles
* preempt_attr was copied from CUDA, but not used in HIP.
* Remove shadowed variable before conditional in EnvironmentTextureNode code.

Differential Revision: https://developer.blender.org/D16741
2022-12-12 18:15:41 +01:00
Weizhen Huang
014ffc4615 Cycles: using concentric mapping when sampling disk 2022-12-12 17:15:55 +01:00
Weizhen Huang
d17858cb37 Fix Cycles rectangular area light in volume segment sampled by ellipse 2022-12-12 15:59:04 +01:00
Alaska
3e1152428d Cleanup: Code comments in tree.h
Differential Revision: https://developer.blender.org/D16751
2022-12-12 12:37:50 +01:00
Damien Picard
538d4cc998 UI: Fix and improve various labels and tooltips
Improve a few messages, but mostly fix typos in many areas of the UI.
See inline comments in the differential revisiion for the rationale
behind the various changes.

Differential Revision: https://developer.blender.org/D16716
2022-12-09 16:10:14 -06:00
Jason Fielder
2e61c446ac GPU: Explicit Texture Usage Flags for enabling GPU Backend optimizations.
Texture usage flags can now be provided during texture creation specifying
the ways in which a texture can be used. This allows the GPU backends to
perform contextual optimizations which were not previously possible. This
includes enablement of hardware lossless compression which can result in
a 15%+ performance uplift for bandwidth-limited scenes on hardware such
as Apple-Silicon using Metal.

GPU_TEXTURE_USAGE_GENERAL can be used by default if usage is not known
ahead of time. Patch will also be relevant for the Vulkan backend.

Authored by Apple: Michael Parkin-White

Ref T96261

Reviewed By: fclem
Differential Revision: https://developer.blender.org/D15967
2022-12-08 23:31:05 +01:00