Commit Graph

10018 Commits

Author SHA1 Message Date
Brecht Van Lommel
8b806c86e1 Fix T82027, T81718: Cycles crash with volume animation playback 2020-10-30 17:36:41 +01:00
Brecht Van Lommel
a1d8559a42 Fix Cycles map range node missing clamp socket
No effect on the Blender integration yet, but needs to be solved for the
upcoming change to encapsulate sockets.
2020-10-30 14:58:34 +01:00
Brecht Van Lommel
9e85812acc Fix macOS mouse positions inaccuracy
Don't use the current mouse position at the time the event is handled, but
rather the position at the time of the event. This should make e.g. brush
stroke paths more accurate.

In addition, this may solve issues with other software that does mouse
position smoothing. Ref T82143.

Use of the current mouse position was added in 12b642062c6f as part of a
large commit that also made continuous grab work. But it appears to still
work getting the mouse position from the event.
2020-10-29 22:28:28 +01:00
Dalai Felinto
4a8146eb8f Cycles: silence unused variable warning 2020-10-29 18:33:29 +01:00
Kévin Dietrich
8c3d42bd0f Fix T82129: Cycles "Persistent Images" incorrectly retains scene data
The issue stems from the fact that scene arrays are not cleared when rendering is done. This was not really an issue before the introduction of the ownership system (rB429afe0c626a) as the id_map would recreate scene data arrays based on their new content. However, now that the id_maps do not have access to the scene data anymore the arrays are never created.

Another related issue is that the BlenderSync instance is never freed when the persistent data option is activated.

To fix this, we delete nodes created by the id_maps in their destructors, and delete the BlenderSync instance before creating a new one, so the id_maps destructors are actually called.

Reviewed By: brecht

Maniphest Tasks: T82129

Differential Revision: https://developer.blender.org/D9378
2020-10-29 17:39:21 +01:00
Philipp Oeser
f76f48c3d3 Fix T69911: Adaptive subdivision offscreen dicing does not work correctly if the camera is shifted
Code was assuming frustrum planes are symmetrical which is not the case
for shifting. This lead to a shrinking region if shift was negative (and
a growing region if shift was positive)

So instead of only keeping track of plane on one side (and mirroring
over in code) get the actual planes after shifting and use these
instead.

This code corrects this for ortho and perspective cameras, it does not
touch panoramic cameras.

Reviewed By: brecht

Maniphest Tasks: T69911

Differential Revision: https://developer.blender.org/D9342
2020-10-26 12:52:25 +01:00
Brecht Van Lommel
ae5fd92228 Fix T81893: Cycles viewport crash changing mesh to smoke domain
Now that volume is a dedicated geometry type in Cycles, we need to re-allocate
the geometry when a mesh changes into a volume.
2020-10-26 12:31:01 +01:00
Clément Foucault
8442d6ca8a CLOG: Add getter to know if output supports coloring 2020-10-23 19:33:51 +02:00
Brecht Van Lommel
23eaf3117c Fix Cycles unnecessary overhead cancelling finished task pool 2020-10-23 19:07:34 +02:00
Brecht Van Lommel
6d8e03ddd9 Fix T81102: Cycles crashes in interactive 3D viewport rendering after Embree
Don't allocate a new buffer for refitting meshes, but update the existing one.
It's not clear from the API docs if this is required, but it appears to solve
the issue and should be more efficient.
2020-10-23 18:32:22 +02:00
Sebastián Barschkis
22ceb4a752 Fluid: Fix in addition to new obstacle distance parameter
The obstacle distance value should only be used when using second order boundaries.
2020-10-21 10:52:30 +02:00
Sebastián Barschkis
7167a57197 Fluid: Added obstacle fluid distance parameter
Being able to adjust the distance between fluid and obstacles comes in handy when trying to achieve a fluid motion over inclined obstacles.

Depending on the slope of such obstacles, already small adjustments of this value can help when particles stick to obstacle surfaces (i.e. make particles not stick to obstacles).
2020-10-20 23:07:53 +02:00
Sergey Sharybin
360282cf1f Libmv: Refactor camera intrinsics parameter block
Use the newly introduced packed intrinsics, which allows to remove
code which was initializing parameters block based on distortion
model type.

Now such initialization is done by a particular implementation of
a distortion model.

Differential Revision: https://developer.blender.org/D9192
2020-10-20 15:02:50 +02:00
Sergey Sharybin
549841bbc0 Libmv: Add generic class for packed intrinsics
This is a common class which can be used in all sort of minimization
problems which needs camera intrinsics as a parameter block.

Currently unused, but will replace a lot of hard-coded logic in the
bundle adjustment code.
2020-10-20 15:02:50 +02:00
Sergey Sharybin
151173fefe Libmv: Add array<type, size> to libmv namespace 2020-10-20 15:02:50 +02:00
Sebastian Parborg
711b55b527 Fix libmv test on windows
There is no point in testing std::vector capacity as it can differ
between std implementations.
2020-10-20 14:46:48 +02:00
Harley Acheson
84ef3b80de Spelling: Miscellaneous
Corrects 34 miscellaneous misspelled words.

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

Reviewed by Campbell Barton
2020-10-19 09:11:00 -07:00
Brecht Van Lommel
a9f2641cb6 Fix build error with WITH_CYCLES_NATIVE_ONLY and AVX tests on macOS
Only build avx/avx2 unit tests if supported by the compiler and
WITH_CYCLES_NATIVE_ONLY is off, otherwise the appropriate compiler flags
are not available.
2020-10-19 17:55:00 +02:00
Harley Acheson
d1eefc4215 Spelling: Then Versus Than
Corrects incorrect usages of the words 'then' and 'than'.

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

Reviewed by Campbell Barton
2020-10-19 08:43:08 -07:00
Harley Acheson
3a7fd309fc Spelling: It's Versus Its
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required.

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

Reviewed by Campbell Barton
2020-10-19 08:12:33 -07:00
Campbell Barton
4d9f357bf6 Fix T81806: Cycles error when GPU device_type is NONE
Own regression in 4bea4702d5d5a
2020-10-20 00:09:51 +11:00
Sebastian Parborg
e3c76f7937 Fix libmv eigen alignment issues when compiling with AVX support
There would be eigen alignment issues with the custom libmv vector
class when compiling with AVX optimizations. This would lead to
segfaults.

Simply use the std::vector base class as suggested by the old TODO in
the class header.

Reviewed By: Sergey

Differential Revision: http://developer.blender.org/D8968
2020-10-19 13:06:38 +02:00
Sebastián Barschkis
663e047102 Fluid: Fix for issues with external forces
A general refactor / fix commit that should clear out the issues that have been reported on external forces and moving effectors (e.g. T79537, T81660, T80088).
2020-10-18 20:35:02 +02:00
Philipp Oeser
9c7fda6de3 Fix T81729: Cycles object color not updating for instancers
Caused by rBe65c78cd43aa.

Since above commit, only geometry and lights received the update,
previous to this check an instancer would receive that is well (in case
of 'is_updated_shading').

Now check for an instancer (checking OB_DUPLI via ob.is_instancer()) and
do an update then as well.

Reviewers: brecht

Maniphest Tasks: T81729

Differential Revision: https://developer.blender.org/D9222
2020-10-18 10:42:17 +02:00
Bastien Montagne
d6fd03616e Fix part of T74918: 3D Viewport: Jump, when mouse crosses a window corner.
We need a separate time stamp for each axis, and we have to add a few
milliseconds of padding to those, to ensure wrapping on both axes get
properly performed when it happens almost simultaneously, and avoid
extra wrapping caused by very close events sometimes.

This only addresses the Linux (X11 backend) case.

Differential Revision: https://developer.blender.org/D9209
2020-10-15 13:55:09 +02:00
Campbell Barton
1001adb500 Fix T81520: Crash setting the Cycles device from Python 2020-10-15 16:53:38 +11:00
Campbell Barton
4bea4702d5 PyAPI: throw exception when cycles is given an invalid device name 2020-10-15 16:35:41 +11:00
Campbell Barton
c0dde8be84 Cleanup: defer importing '_cycles' in properties.py
This was imported already in nearly all usage.

Also use static-set for string comparison.
2020-10-15 16:25:26 +11:00
Sebastián Barschkis
2cc7be3e49 Fluid: Removed fluid levelset argument from pressure solve
It seems that this was causing the instabilities at slanted obstacles (with secondary boundary (fractional) collisions enabled) ...
2020-10-14 00:29:43 +02:00
Sebastián Barschkis
3d1b5e35bd Fluid: Enabled OpenVDB precision argument
This way particles can be saved with the custom OpenVDB precision options that were introduced in the latest Mantaflow update.
2020-10-14 00:29:43 +02:00
Kévin Dietrich
c82d167d81 Cycles: fix missing ShaderNode ownership in render_graph_finalize_test 2020-10-13 15:38:57 +02:00
Patrick Mours
3bb3b26c8f Cycles: Add CUDA 11 build support
With this patch the build system checks whether the "CUDA10_NVCC_EXECUTABLE" CMake
variable is set and if so will use that to build sm_30 kernels. Similarily for sm_8x kernels it
checks "CUDA11_NVCC_EXECUTABLE". All other kernels are built using the default CUDA
toolkit. This makes it possible to use either the CUDA 10 or CUDA 11 toolkit by default and
only selectively use the other for the kernels where its a hard requirement.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D9179
2020-10-13 15:15:44 +02:00
Brecht Van Lommel
0d3e192660 Fix T81551: Cycles crash updating volume with modifiers
The volume bounds mesh was being rebuilt too often, it should only be done
when rebuilding the BVH as well, otherwise they can go out of sync.
2020-10-12 16:56:41 +02:00
Ankit Meel
f56c5245d2 Cleanup: CMake: Remove arguments from endif(..)
No functional change. Added in {rB1f6b7387ad01}
2020-10-12 18:51:48 +05:30
Sergey Sharybin
c4c8d855c6 Libmv: Remove array access from camera intrinsics
That was a suboptimal decision from back in the days, which ended up
being problematic. It is no longer used, so remove it from API making
it so new code does not depend on this weak concept.
2020-10-12 15:12:17 +02:00
Sergey Sharybin
ff5e3d6834 Libmv: Fix wrong packing order of intrinsics for BA step
The order got broken when Brown distortion model has been added.
Made it so the indexing of parameters is strictly defined in the
parameter block, matching how parameters are used in the cost
function.

There is some duplication going on accessing parameters. This can
be refactored in the future, by either moving common parts packing
and cost function to an utility function in bundle.cc.
Alternatively, can introduce a public PackedIntrinsics class which
will contain a continuous block of parameters, and each of the
camera models will have API to be initialized from packed form and
to create this packed form.

The benefit of this approach over alternative solutions previously
made in the master branch or suggested in D9116 is that the specific
implementation of BA does not dictate the way how public classes need
to be organized. It is API which needs to define how implementation
goes, not the other way around.

Thanks Bastien and Ivan for the investigation!
2020-10-12 15:12:17 +02:00
Sergey Sharybin
86138d88f6 Revert "Fix critical lens distortion bug in libmv after rB3a7d62cd1f5e."
This reverts commit 7e836bde11ce6521953c9f246cacd442a3ef6c0e.

Reverting the incomplete workaround, due to the following reasoning:

- There should be no dependency between CameraIntrinsics and the bundler
  code. This violates intended abstraction of the intrinsics class.

- The fix was not complete, or wrong. Even in the world where there is
  a requirement to the parameters storage size this should have applied
  to all distortion models, including Divisions, Nuke.

Proper fix will be committed next.
2020-10-12 15:12:17 +02:00
Sergey Sharybin
df5b65811e Libmv: Fix memory leak in modal solver
The leak was happening when problem did not have any parameters blocks
defined. This happens, for example, if there are no 3D points at all,
or when all markers are set to 0 weight.

Was noticeable in libmv_modal_solver_test when building with LSAN
enabled.
2020-10-12 15:12:17 +02:00
Sergey Sharybin
590220e451 Libmv: Cleanup, spelling in function name
Is a local function, not affecting API.
2020-10-12 15:12:17 +02:00
Campbell Barton
2abfcebb0e Cleanup: use C comments for descriptive text
Follow our code style guide by using C-comments for text descriptions.
2020-10-10 22:04:51 +11:00
Ankit Meel
1f6b7387ad CMake/macOS: Remove _LIBPATH, avoid link_directories.
After tests were bundled in a single executable and cycles and libmv
created their own tests, the warnings on macOS have gone over 800.
The reason is setting `*_LIBRARIES` to names of the libraries
and later using `link_directories` to link them properly.

https://cmake.org/cmake/help/latest/command/link_directories.html

> Note This command is rarely necessary and should be avoided where
> there are other choices. Prefer to pass full absolute paths to
> libraries where possible, since this ensures the correct library
> will always be linked. The find_library() command provides the
> full path, which can generally be used directly in calls to
> target_link_libraries().

Warnings like the following popup for every target/executable,
for every library it links to.
```
ld: warning: directory not found for option
'-L/Users/me/blender-build/blender/../lib/darwin/jpeg/lib/Debug'
```

The patch completes a step towards removing `link_directories` as
mentioned in TODO at several places.
The patch uses absolute paths to link libraries and removes
all `*_LIBPATH`s except `PYTHON_LIBPATH` from
`platform_apple.cmake` file. (The corner case where it's used seems
like dead code. Python is no longer shipped with that file structure.)

Also, unused code for LLVM-3.4 has been removed.
Also, guards to avoid searching libraries in system directories have
been added.

`APPLE` platform now no longer needs `setup_libdirs`,
`cycles_link_directories`, and `link_directories`.
The number of warnings now is less than 100, most of them being
deprecation ones in dependencies.

This patch depended on {rBb746179d0add}, {rB2fdbe4d05011},
{rB402a4cadba49} and {rBd7f482f88ecb}.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8855
2020-10-09 19:41:58 +05:30
Campbell Barton
afc090f339 Cleanup: spelling 2020-10-09 12:12:29 +11:00
Kévin Dietrich
2d5e38d4ec Cycles: fix incorrect default value for node array socket type 2020-10-09 00:15:24 +02:00
Kévin Dietrich
70634ba438 Cycles: fix incorrect asserts in node socket set functions 2020-10-09 00:15:24 +02:00
Sebastián Barschkis
fdb2240e4d Fluid: Fix particle helper grid export
Only export helper levelset and velocity (belonging to previous state) at the beginning of an (adaptive) frame.
2020-10-08 10:25:32 +02:00
Kévin Dietrich
d37fccab26 Cycles: fix UpdateTimeStats::clear() not resetting total times to zero 2020-10-08 06:41:33 +02:00
Sebastián Barschkis
55fd7f55bd Fluid: Enable new flood-fill helper function
The flood-fill helper serves as a sanity check for scenes with complex obstacles. Similarly to the holes filler function it ensures that there are no holes in obstacles.

In addition, it ensures that there will be no holes resulting from multiple intersecting obstacles.

In general, this commit should improve stability.
2020-10-06 18:35:13 +02:00
Patrick Mours
3df90de6c2 Cycles: Add NanoVDB support for rendering volumes
NanoVDB is a platform-independent sparse volume data structure that makes it possible to
use OpenVDB volumes on the GPU. This patch uses it for volume rendering in Cycles,
replacing the previous usage of dense 3D textures.

Since it has a big impact on memory usage and performance and changes the OpenVDB
branch used for the rest of Blender as well, this is not enabled by default yet, which will
happen only after 2.82 was branched off. To enable it, build both dependencies and Blender
itself with the "WITH_NANOVDB" CMake option.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8794
2020-10-05 15:03:30 +02:00
Matt McClellan
1d985159ad Fix Cycles OpenCL failing when extension string is long
This can happen for Intel OpenCL, now support arbitrary string length.

Differential Revision: https://developer.blender.org/D9020
2020-10-05 14:04:06 +02:00
Bastien Montagne
7e836bde11 Fix critical lens distortion bug in libmv after rB3a7d62cd1f5e.
Current libmv_modal_solver_test fails since rB3a7d62cd1f5e.

It appears that the issue is caused by the insertion of the new OFFSET_K4 parameter,
as, if camera intrinsics are not required to implement/use all of those deform
parameters, they absolutely have to keep order (values) matching those defined
in bundle.cc, otherwise `PackIntrinisicsIntoArray` and `UnpackIntrinsicsFromArray`
will mangle them around.
2020-10-05 11:47:32 +02:00