Commit Graph

10666 Commits

Author SHA1 Message Date
Brecht Van Lommel
ca64bd0aac Render: move Cycles visibility, holdout and shadow catcher properties to Blender
The immediate reason for this is that we want to be able to initialize them
to different defaults for light objects, which is hard with Python properties.
But in general it is useful to be able to share these with other renderers.

As a side effect, Eevee now supports a per-object holdout instead of only
per-collection.

Differential Revision: https://developer.blender.org/D12133
2021-08-05 17:22:38 +02:00
Peter Kim
e844e9e8f3 XR Controller Support Step 2: Action Maps
Addresses the remaining portions of T77137 (Python API for Controller
Interaction), which was partially completed by D10942.

Adds an XR "action maps" system for loading XR action data from a
Python script. Action maps are accessible via the Python API, and are used
to pass default actions to the VR session during the
xr_session_start_pre() callback.

Since action maps are stored only as runtime data, they will be
cleaned up with the rest of the VR runtime data on file read or exit.

Reviewed By: Julian Eisel, Hans Goudey

Differential Revision: https://developer.blender.org/D10943
2021-08-05 23:40:17 +09:00
Campbell Barton
f5acfd9c04 Cleanup: remove redundant parenthesis 2021-08-05 16:54:34 +10:00
Peter Kim
d3d4be1db3 XR: Action Binding Improvements
Provides several important improvements to the runtime action
bindings operation and internal API.

Moves input-specific action data (input thresholds, input regions,
pose offsets/spaces) from actions to more granular action bindings.
This allows a single action to be mapped to a variety of inputs,
without having to share a single input threshold, region, or space.

Also removes the need for action space creation API, as spaces for
pose actions will be automatically created with the bindings.

The correct action data for the current inputs is set by calling
xrGetCurrentInteractionProfile() to get the current profile and then
retrieving the corresponding mapped data.

Does not bring about any changes for users since only internal
runtime functionality is currently affected.

Reviewed By: Julian Eisel

Differential Revision: http://developer.blender.org/D12077
2021-08-05 13:14:26 +09:00
Harley Acheson
07b702f828 Win32 IME: Rename SetInputLanguage()
GHOST_ImeWin32::SetInputLanguage() has a confusing name because it does
not set the input language. It actually retrieves the current input
locale from the OS and caches the value of the current input language
ID. Therefore this patch renames it to "UpdateInputLanguage"

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

Reviewed by Ray Molenkamp
2021-08-04 14:30:16 -07:00
Harley Acheson
1d1020b79f Win32 IME: Remove ime_status_
This removes one member of GHOST_ImeWin32 that is not used and cannot
be used in the future. It is holding the result of ImmIsIME, which is
whether an input language supports IME. It does not indicate that one
is in use, turned on, composing, in English mode, etc.

see D12131 for more information.

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

Reviewed by Ray Molenkamp
2021-08-04 13:20:45 -07:00
Brecht Van Lommel
49acc52e02 Cycles: make object Fast GI Approximation panel a subpanel of Shading 2021-08-04 20:52:29 +02:00
Romain Toumi
10b9621079 Fix Cycles material slots list being too short
Bring it in line with Eevee.

Differential Revision: https://developer.blender.org/D11982
2021-08-04 18:43:39 +02:00
Sergey Sharybin
c18d91918f Cycles: More flexible GI Approximation AO distance control
The goal: allow to easily use AO approximation in scenes which combines
both small and large scale objects.

The idea: use per-object AO distance which will allow to override world
settings. Instancer object will "propagate" its AO distance to all its
instances unless the instance defines own distance (this allows to
modify AO distance in the shot files, without requiring to modify props
used in the shots.

Available from the new Fats GI Approximation panel in object properties.

Differential Revision: https://developer.blender.org/D12112
2021-08-04 17:26:24 +02:00
Campbell Barton
cd92b2350f Cleanup: use C comments for descriptive text 2021-08-04 13:34:02 +10:00
Campbell Barton
c1a477b497 Cleanup: use C++ comments or 'if 0' for commented code 2021-08-03 15:27:20 +10:00
Hans Goudey
67d56eb71e Cleanup: Remove unused/unecessary OpenVDB C API
This commit uses OpenVDB more directly for the voxel remesher, without
the extra indirection of copying to a Blender API. This makes the code
simpler, shorter, and easier to understand (though I didn't observe any
performance improvement).

This also removes the rest of the unused and undocumented OpenVDB C API,
which was written when Blender's code didn't really use C++, and doesn't
serve a purpose anymore. Those features will be implemented as nodes in
the future anyway (see D12100).

Differential Revision: https://developer.blender.org/D12097
2021-08-02 12:26:28 -04:00
Campbell Barton
1cf45fe10f Cleanup: spelling 2021-08-02 15:22:54 +10:00
Takahiro Shizuki
836aeebf70 IME Win32: Fix Duplicated Initial Character
When entering characters using IME on Windows, Japanese and Chinese
will both usually result in the first keystroke being duplicated. The
problem is that we are informed too late, after the first key is
pressed, that we are IME composing. This patch ensures we are entering
non-English characters using ImmGetConversionStatus() and then deals
with editing keys (like arrows and backspace) on a per-language basis.

see D11929 for more details.

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

Reviewed by Brecht Van Lommel
2021-08-01 11:52:22 -07:00
Hans Goudey
35894dc700 Cleanup: Simplify logic, follow style guide for integer types
- Use `int` instead of `unsigned int` for mesh indices
- Use C++ types (Array, float3, IndexRange)
- Use range based for loops
2021-07-30 15:08:43 -04:00
Brecht Van Lommel
9ac782b823 Fix EGL version being printed on every startup
After the switch to enable EGL over GLX. No need to print this debugging
information always.
2021-07-30 18:44:26 +02:00
Brecht Van Lommel
3848507511 Cleanup: clarify license and origin of voronoi and dithering code 2021-07-30 18:44:26 +02:00
Campbell Barton
5aa45c43f2 Cleanup: missing leading '*' from comment blocks 2021-07-30 22:20:31 +10:00
Campbell Barton
88e774aa34 Cleanup: workaround for unstable formatting in clang-format
Running multiple times would re-indent differently.
2021-07-30 21:56:14 +10:00
Campbell Barton
93eb460dd0 Cleanup: clang-format (re-run after v12 version bump) 2021-07-30 16:19:19 +10:00
Campbell Barton
f81a6a2ff1 Cleanup: spelling in comments 2021-07-30 16:16:38 +10:00
Brecht Van Lommel
8f12457c25 Fix T90295: inconsistent render pass order between Cycles and Eevee 2021-07-29 17:59:03 +02:00
Sergey Sharybin
24ba931f40 Cleanup: Remove debug-only code 2021-07-29 14:46:54 +02:00
Sergey Sharybin
810c88b5f1 Fix building without Cycles logging
Ideally can use assert() checks instead of suppressing the check entirely,
but for now just fix compilation error quickly.
2021-07-29 14:32:10 +02:00
Sergey Sharybin
5116b7a4c2 Fix Cycles crash with fluid object motion blur disabled
Motion attributes expects mesh to have non-zero number of motion steps,
which was violated in the case when fluid mesh had motion blur disabled.

This is a bit of annoying fix, because of the order of updates. More
ideal solution would be to handle cached and fluid velocities in the
sync_mesh_motion() which ensures all the dependencies between settings.
2021-07-29 12:28:46 +02:00
Brecht Van Lommel
073bf8bf52 Cycles: remove WITH_CYCLES_DEBUG, add WITH_CYCLES_DEBUG_NAN
WITH_CYCLES_DEBUG was used for rendering BVH debugging passes. But since we
mainly use Embree an OptiX now, this information is no longer important.

WITH_CYCLES_DEBUG_NAN will enable additional checks for NaNs and invalid values
in the kernel, for Cycles developers. Previously these asserts where enabled in
all debug builds, but this is too likely to crash Blender in scenes that render
fine regardless of the NaNs. So this is behind a CMake option now.

Fixes T90240
2021-07-28 19:27:57 +02:00
Sergey Sharybin
b1a2abd6b2 Fix missing passes update on Use Denoising change
Makes it so Render Layers node in the compositor is updated as soon
as Use Denoising is changed for the final render.

Differential Revision: https://developer.blender.org/D12010
2021-07-27 11:48:14 +02:00
Brecht Van Lommel
cf74cd9367 Cycles: upgrade CUDA to 11.4
This fixes a performance regression on Ampere cards, on specific scenes like
classroom. For cycles-x there is little difference, but this is still helpful
for LTS releases, and we need to upgrade at some point anyway.
2021-07-26 19:46:51 +02:00
Nikhil Shringarpurey
6eb94d8df2 Cleanup: fix compiler warnings due to implicit cast
Differential Revision: https://developer.blender.org/D11950
2021-07-26 18:04:40 +02:00
c17a266e29 Revert "GHOST/wayland: use Wayland only when 'BLENDER_WAYLAND' is set"
This reverts commit c971c851d38ad52779fa5d75c86bbfb83abf660b.

This change was part of the still-under-review patch D11489, which
hasn't been accepted yet.
2021-07-26 12:16:42 +02:00
Stefan Werner
1a3cb90e4e Cycles: Fixed memory leak in ColorSpaceManager
Cached OCIO processors were not freed, instead the color spaces were freed twice.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D12011
2021-07-26 11:45:29 +02:00
Campbell Barton
501bca9f5b Cleanup: clang-format 2021-07-26 12:41:49 +10:00
Campbell Barton
828c66f393 Cleanup: spelling in comments 2021-07-26 12:32:42 +10:00
Christian Rauch
c971c851d3 GHOST/wayland: use Wayland only when 'BLENDER_WAYLAND' is set 2021-07-24 12:30:14 +01:00
Christian Rauch
1029577a51 GHOST/wayland: explicitly delete 'GHOST_SystemWayland' when fallback to X11 2021-07-24 12:30:13 +01:00
Ray Molenkamp
ede1ce6e9a GTest: Use INC/INC_SYS for Libmv/OSD tests
This change transitions libmv/osd tests to our
blender_add_test_executable macro that explicitly
takes the include directories as a parameter.

This is in preparation for future clean-up of
global include directories.

Differential Revision: https://developer.blender.org/D12012
Reviewed By: sergey
2021-07-23 16:50:13 -06:00
Peter Kim
c41b93bda5 XR: Fix for Viewport Denoising Artifacts
Addresses T76003. When using VR with Eevee and viewport denoising,
scene geometry could sometimes be occluded for one eye. Solution is
to use a separate GPUViewport/GPUOffscreen for each VR view instead
of reusing a single one for rendering.

Reviewed By: Julian Eisel, Clément Foucault

Differential Revision: http://developer.blender.org/D11858
2021-07-24 00:12:17 +09:00
Campbell Barton
ced94bc11c Cleanup: code comments punctuation / spacing 2021-07-23 17:03:51 +10:00
Peter Kim
36c0649d32 XR: Reference Space Improvements
Improves control over the XR reference space by using the stage ref
space (user-defined tracking bounds) instead of local ref space
(position at application launch), if available. Also adds an
"absolute tracking" session option to skip applying eye offsets that
are normally added for placing users exactly at landmarks.

By enabling absolute tracking, users can define the tracking origin
in a way that is not linked to the headset position. Instead, the
tracking values given by the XR runtime are left unadjusted and a
user can manually calibrate an "origin" landmark object to adjust to
their real world space.

Can be useful for applications that use external tracking systems
and those that primarily only need to use controllers and not the
headset (e.g. motion capture).

The absolute tracking option requires an update to the VR
Scene Inspection addon to be accessible by regular users.

Reviewed By: Julian Eisel

Differential Revision: http://developer.blender.org/D10946
2021-07-23 14:54:56 +09:00
Yuki Hashimoto
22bef356ae Cleanup: correct the comment in ghost
The same comments were written in clientToScreen and screenToClient in
GHOST. I corrected them.

Ref D11986
2021-07-21 23:14:03 +10:00
Campbell Barton
bbcc8330f7 Cleanup: spelling 2021-07-21 20:42:11 +10:00
Campbell Barton
265c3a4724 Cleanup: replace NB with NOTE in comments 2021-07-21 13:10:32 +10:00
Romain Toumi
14d5a45750 UI: Fix Cycles Materials menu Layout
Fix an incoherence between the Eevee Materials menu and the Cycles Materials menu :

Eevee :
{F10230448}

Cycles :
{F10230449}

Simply Fixed by replacing the Cycles UI code by the Eevee UI code.

Thanks to @Brainzman for helping me create this diff and translate

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D11979
2021-07-20 17:23:34 -04:00
Campbell Barton
77e927b58f Cleanup: reserve C++ comments for disabled code
Use C comments for plain text.
2021-07-20 15:01:05 +10:00
Campbell Barton
42017b006e Cleanup: sort struct declarations 2021-07-16 11:48:54 +10:00
Heinrich Schuchardt
468d59e496 Add support for RISC-V architecture
* On RISC-V GCC 10.3 does not define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n.
* Avoid a build error
  "Please add support for your platform in build_config.h"
  Cf: https://github.com/sergeyvfx/libNumaAPI/pull/3

Differential Revision: https://developer.blender.org/D11910
2021-07-15 14:22:35 +02:00
Christian Rauch
4e65b1ef6c GHOST/wayland: create mmap-ed file manually if memfd_create is unavailable 2021-07-14 23:15:00 +01:00
Brecht Van Lommel
765406cb51 Fix T88088: Cycles and Eevee Vector Rotate node inconsistent with zero axis
Pass along the unmodified vector in this case.
2021-07-14 13:54:52 +02:00
Campbell Barton
d31abfef2c Fix x/y mismatch in retract region tracker
Correct X/Y mismatch in RetrackRegionTracker.

NOTE: This isn't used at the moment.

Reviewed By: sergey

Ref D11895
2021-07-13 21:58:45 +10:00
Jesse Yurkovich
5098678308 Cleanup: Use correct _WIN32/64 defines for MSVC
Docs: https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros

Differential Revision: https://developer.blender.org/D11460
2021-07-12 21:01:18 -07:00