Commit Graph

10484 Commits

Author SHA1 Message Date
Peter Kim
cb12fb78ca XR Controller Support Step 1: Internal Abstractions for OpenXR Actions
Adds internal API for creating and managing OpenXR actions at the
GHOST and WM layers. Does not bring about any changes for users since
XR action functionality is not yet exposed in the Python API (will be
added in a subsequent patch).

OpenXR actions are a means to communicate with XR input devices and
can be used to retrieve button/pose states or apply haptic feedback.
Actions are bound to device inputs via a semantic path binding
(https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-interaction-profiles),
which serves as an XR version of keymaps.

Main features:

- Abstraction of OpenXR action management functions to GHOST-XR,
  WM-XR APIs.
- New "xr_session_start_pre" callback for creating actions at
  appropriate point in the XR session.
- Creation of name-identifiable action sets/actions.
- Binding of actions to controller inputs.
- Acquisition of controller button states.
- Acquisition of controller poses.
- Application of controller haptic feedback.
- Carefully designed error handling and useful error reporting
  (e.g. action set/action name included in error message).

Reviewed By: Julian Eisel

Differential Revision: http://developer.blender.org/D10942
2021-05-16 03:36:31 +09:00
Bastien Montagne
8c80267352 CLOG: Fix memleak in own recent improvement to CLOG filter.
Mistake in rBef5782e29744.
2021-05-14 17:50:55 +02:00
Germano Cavalcante
b11499939c Python GPU: Replace part of the code that uses 'bgl' with 'gpu'
This is part of the process described in T80730.

The aim is to deprecate the bgl module.

Reviewed By: fclem, brecht, campbellbarton

Revision: D11147
2021-05-14 12:26:40 -03:00
Campbell Barton
a156843112 Cleanup: spelling, rename metas to meta-strips / meta-balls 2021-05-14 17:38:16 +10:00
Campbell Barton
c1c0b661c0 Cleanup: clang-format 2021-05-14 17:35:08 +10:00
Kévin Dietrich
01718ad952 Merge branch 'blender-v2.93-release' 2021-05-14 02:42:19 +02:00
Kévin Dietrich
fce795415a Fix T87929: Cycles, missing update when visibility is modified
This issue originates from a missing BVH packing for visibility data
when it is modified.

To fix this, this adds update flags to the managers to carry the
modified visibility information from the Objects' modified flag to the
GeometryManager.

Another set of flags is added to determine which data need to be packed:
geometry, vertices, or visibility. Those flags are then used when
packing the primivites.

Reviewed By: brecht

Maniphest Tasks: T87929

Differential Revision: https://developer.blender.org/D11219
2021-05-14 02:40:43 +02:00
Sergey Sharybin
2e750a42a1 Merge branch 'blender-v2.93-release' 2021-05-12 10:16:01 +02:00
Sergey Sharybin
7e823969b5 Fix non-finite tangent in Cycles with missing UV map
Was causing calculation issues later on in the kernel.

This change catches the most obvious case: missing attribute. The old
code was trying to set tangent to 0, but because it was transformed as
a normal it got converted to non-finite value. This change makes it so
that no transform is involved and 0 is written directly to the SVM
stack.

To cover all cases it will require using safe_normalize() in this node
and in the normal transform function. This is more involved change from
performance point of view, would be nice to verify whether we really want
to go this route.

I've left asserts in the BSDF allocation functions. Don't have strong
connection to them, but think they are handy and are not different from
having an assert in the path radiance checks.

Differential Revision: https://developer.blender.org/D11235
2021-05-12 10:06:11 +02:00
Sergey Sharybin
93b7c9595b Merge branch 'blender-v2.93-release' 2021-05-12 10:01:14 +02:00
Sergey Sharybin
7f34363633 Cycles X: Fix possible use of uninitialized ShaderClosure
It is possible that BSDF allocation will advance pointer in the
allocation "pool" but will return null pointer if the weight is
too small.

One artist-measurable issue this change fixes is random issues
with denoising: normal pass for denoising could have accessed
non-initialized normal of a closure.

Differential Revision: https://developer.blender.org/D11230
2021-05-12 09:41:02 +02:00
Ankit Meel
193425ce1d Cycles: fix inconsistent-missing-override warnings
LLVM Clang 13, macOS.

Reviewed By: brecht
Differential Revision: https://developer.blender.org/D11207
2021-05-12 10:27:37 +05:30
Brecht Van Lommel
96bcd80c5a Merge branch 'blender-v2.93-release' 2021-05-11 23:05:57 +02:00
Chris Eveleigh
e637149166 Fix T72791: Cycles wrong results when mixing multiple random walk BSSRDFs
Take into account the closure sample weight for the throughput.

Differential Revision: https://developer.blender.org/D10936
2021-05-11 22:24:51 +02:00
Brecht Van Lommel
0830458bcc Fix T88093: persistent data and particle object instancing not working 2021-05-11 22:19:44 +02:00
Brecht Van Lommel
15b180b240 Fix T88099: error with persistent data and motion blur 2021-05-11 14:24:36 +02:00
Campbell Barton
1151adf62d Cleanup: unnecessary extra lines for doxy sections 2021-05-11 16:04:03 +10:00
Sebastian Parborg
c2b6dc7e53 Cleanup: Fix deinterlace code block style 2021-05-07 17:22:12 +02:00
Sebastian Parborg
8d6264ea12 Cleanup: Remove deprecated variables and functions calls from our ffmpeg code
There need to be more cleanup for ffmpeg 4.5 (ffmpeg master branch).

However this now compiles on ffmpeg 4.4 without and deprication
warnings.

Reviewed By: Sergey, Richard Antalik

Differential Revision: http://developer.blender.org/D10338
2021-05-07 17:12:25 +02:00
Campbell Barton
efc6f4675d Cleanup: spelling 2021-05-06 08:09:05 +10:00
Campbell Barton
832f7170dc Cleanup: link directly to stackexchange URL 2021-05-06 08:08:12 +10:00
Sergey Sharybin
632c3304bc Merge branch 'blender-v2.93-release' 2021-05-05 15:09:41 +02:00
Sergey Sharybin
d9d7169837 Fix kernel loading time accounted twice in render progress
The render session is keeping track of the scene update, which includes
kernel loading time.

This fixes negative render times reported when CUDA kernels are compiled
at runtime.

A bit fragile logic, can be re-implemented using some user-counted
scope utility classes, so that only outer-most time skip is applied.
2021-05-05 14:50:03 +02:00
Kévin Dietrich
87ee8ddfe3 Fix compile error without Alembic
Thanks to @Severin for noticing and providing a little patch.
2021-05-04 17:30:49 +02:00
Germano Cavalcante
e6bf272abd Merge branch 'blender-v2.93-release' 2021-05-03 20:07:03 -03:00
Brecht Van Lommel
874c70d088 Fix errors in Cycles comments 2021-05-03 22:45:58 +02:00
Brecht Van Lommel
7149ccee57 Fix T85287: Cycles deadlock loading Blender images in some cases 2021-05-03 22:10:26 +02:00
Brecht Van Lommel
472765d44d Fix T88001: persistent data render wrong when changing camera border 2021-05-03 22:10:26 +02:00
Stefan Werner
042df5fd6a Cycles standalone: Fixed macOS dependencies.
Added IOKit and Accerelate as linked frameworks where necessary.
2021-05-03 22:07:09 +02:00
Campbell Barton
888a697e24 Cleanup: spelling 2021-05-04 00:44:53 +10:00
Kévin Dietrich
9f1e20e74f Alembic Procedural: precompute vertex normals
This precomputes vertex normals in the procedural and caches them in case none
are found in the archive. This only applies to polygon meshes, as subdivision
meshes are yet to be subdivided, so it is useless to do this computation.

The goal here is to speed up data updates between frames, as computing normals
shows up in profiles even for large objects. This saves around 16% of update time
for a production file.
2021-05-03 16:20:06 +02:00
Kévin Dietrich
e2c671e34c Alembic Procedural: refactor data reading
This splits the data reading logic from the AlembicObject class and moves it to
separate files to better enforce a separation of concern. The goal was to simplify
and improve the logic to read data from an Alembic archive.

Since the procedural loads data for the entire animation, this requires looping
over the frame range and looking up data for each frame. Previously those loops
would be duplicated over the entire code causing divergences in how we might
skip or deduplicate data across frames (if only some data change over time and
not other on the same object, e.g. vertices and triangles might not have the
same animation times), and therefore, bugs.

Now, we only use a single function with callback to loop over the geometry data
for each requested frame, and another one to loop over attributes. Given how
attributes are accessed it is a bit tricky to simplify further and only use a
ingle function, however, this is left as a further improvement as it is not
impossible.

To read the data, we now use a set of structures to hold which data to read.
Those structures might seem redundant with the Alembic schemas as they are
somewhat a copy of the schemas' structures, however they will allow us in the
long run to treat the data of one object type as the data of another object
type (e.g. to ignore subdivision, or only loading the vertices as point clouds).

For attributes, this new system allows us to read arbitrary attributes, although
with some limitations still:
* only subdivision and polygon meshes are supported due to lack of examples for
  curve data;
* some data types might be missing: we support float, float2, float3, booleans,
  normals, uvs, rgb, and rbga at the moment, other types can be trivially added
* some attribute scopes (or domains) are not handled, again, due to lack of example
  files
* color types are always interpreted as vertex colors
2021-05-03 16:19:50 +02:00
Campbell Barton
3e4863376e Cleanup: use boolean for has_event variable & return value 2021-05-04 00:17:45 +10:00
Kévin Dietrich
8884385afb Cleanup: format 2021-05-03 04:42:39 +02:00
Kévin Dietrich
3bc44233c0 Cycles: use reference count to detect used shaders
Shaders are only compiled if they are used by some other Node (Geometry, Light, etc.).
This usage detection is done before updating the Scene, however it fails at detecting
Shaders used by Procedurals not known to Cycles (e.g. ones defined by third party
applications), as Procedurals are only updated after the shaders are compiled.

To remedy this, we now use the Node reference counting mechanism to detect whether a
Shader is used and therefore should be compiled.

This removes `ShaderManager::update_shaders_used` as it is not needed anymore, however,
since it would also update the Shader ids, this is now performed in
`ShaderManager::device_update`, and a new virtual `device_update_specific` method was
added to handle device updates for SVM and OSL.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10965
2021-05-03 01:21:12 +02:00
Kévin Dietrich
5a964664d6 Cycles: add reference counting to Nodes
This adds a reference count to Nodes which is incremented or decremented
whenever they are added to or removed from a socket, which will help us
track used Nodes throughout the scene graph generically without having to
add an explicit count or flag on specific Node types. This is especially
useful to track Nodes defined through Procedurals out of Cycles' control.

This also modifies the order in which nodes are deleted to ensure that
upon deletion, a Node does not attempt to decrement the reference
count of another Node which was already freed or deleted.

This is not currently used, but will be in the next commit.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10965
2021-05-03 01:20:33 +02:00
Sebastian Parborg
436529d4f6 Merge branch 'blender-v2.93-release' 2021-04-30 18:04:56 +02:00
Sebastian Parborg
aadfa31cf0 Fix "use after free" issue in clog
Keep track of clog_refs so we can null the pointers when calling
CLG_exit. Otherwise we will run into issues where the code will try to
access freed data.
2021-04-30 18:01:47 +02:00
Campbell Barton
093ab05bcd Merge branch 'blender-v2.93-release' 2021-04-30 15:14:36 +10:00
Campbell Barton
3be50c849a Merge branch 'blender-v2.93-release' 2021-04-30 15:14:32 +10:00
Brecht Van Lommel
39226cd437 Fix T87317: Cycles XML parsing broken after bugfix for initialization order 2021-04-29 19:14:57 +02:00
Brecht Van Lommel
f0eda57392 Fix error in Python UI script 2021-04-29 19:14:57 +02:00
Campbell Barton
738a890025 Merge branch 'blender-v2.93-release' 2021-04-30 00:25:35 +10:00
Brecht Van Lommel
dcf2c6e225 Fix build error after recent changes to CPU name detection 2021-04-29 16:22:53 +02:00
Brecht Van Lommel
734c8f9a77 Merge branch 'blender-v2.93-release' 2021-04-29 16:00:05 +02:00
Christian Baars
87ba01dba9 Fix missing Cycles CPU name on macOS Arm
Differential Revision: https://developer.blender.org/D11061
2021-04-29 15:58:51 +02:00
Patrick Mours
ffa70e7690 Fix missing Cycles CPU name for Arm processors 2021-04-29 15:58:51 +02:00
Brecht Van Lommel
cd05a05bca Fix T87686: Cycles persistent data not updating correctly with hair 2021-04-29 15:58:51 +02:00
Matteo Falduto
8b9b87aee8 Cleanup: removed unnecessary multiplications in area light importance sampling
Differential Revision: https://developer.blender.org/D11114
2021-04-29 15:58:51 +02:00
Brecht Van Lommel
a5fdff26b1 Fix ASAN warnings with Cycles OSL 2021-04-29 15:58:51 +02:00