Commit Graph

10079 Commits

Author SHA1 Message Date
Brecht Van Lommel
0767683496 Cycles: refactor to make attribute lookup slightly more efficient
Ref D2057
2020-10-28 12:43:42 +01:00
Alexander Gavrilov
d58b55b55a Cycles: internal support for float4 geometry attributes
Previously only float3 and byte4 was supported.

Ref D2057
2020-10-28 12:43:42 +01:00
Brecht Van Lommel
ee6b989f8e Cycles: refactor to split surface and volume attribute lookup more
This avoids OpenCL inlining heavy volume interpolation code once for every
data type, which could cause a performance regression when we add a float4
data type in the next commit.

Ref D2057
2020-10-28 12:43:42 +01:00
Sergey Sharybin
0269f0c574 Tracking: Simplify configuration of intrinsics to refine
Previously, only predefined and limited set of intrinsics combinations
could have been refined. This was caused by a bundle adjustment library
used in the early days of the solver.

Now it is possible to fully customize which intrinsics are to be refined
during camera solving. Internally solver supports per-parameter settings
but in the interface they are grouped as following:

* Focal length
* Optical center
* Radial distortion coefficients (which includes k1, k2, k3, k4)
* Tangential distortion coefficients (which includes p1, p2)

Differential Revision: https://developer.blender.org/D9294
2020-10-28 10:21:07 +01:00
Sergey Sharybin
1b1f46a98c Libmv: Fix typo in packed intrinsics
Was using doing an implicit cast of floating point value to boolean.
Was not noticed before because the boolean value was never never used.
2020-10-28 10:13:08 +01:00
Campbell Barton
4b188bb08c Cleanup: use over-line for doxy comments
Follow our code style for doxygen sections.
2020-10-27 21:45:55 +11:00
Brecht Van Lommel
30f626fe4c Revert "Cycles API: encapsulate Node socket members"
This reverts commit 527f8b32b32187f754e5b176db6377736f9cb8ff. It is causing
motion blur test failures and crashes in some renders, reverting until this is
fixed.
2020-10-27 11:40:42 +01:00
Kévin Dietrich
527f8b32b3 Cycles API: encapsulate Node socket members
This encapsulates Node socket members behind a set of specific methods;
as such it is no longer possible to directly access Node class members
from exporters and parts of Cycles.

The methods are defined via the NODE_SOCKET_API macros in `graph/
node.h`, and are for getting or setting a specific socket's value, as
well as querying or modifying the state of its update flag.

The setters will check whether the value has changed and tag the socket
as modified appropriately. This will let us know how a Node has changed
and what to update, which is the first concrete step toward a more
granular scene update system.

Since the setters will tag the Node sockets as modified when passed
different data, this patch also removes the various `modified` methods
on Nodes in favor of `Node::is_modified` which checks the sockets'
update flags status.

Reviewed By: brecht

Maniphest Tasks: T79174

Differential Revision: https://developer.blender.org/D8544
2020-10-26 23:11:14 +01:00
Patrick Mours
841eaebfa4 Cycles: Add support for OptiX 7.2 SDK 2020-10-26 15:43:55 +01:00
Philipp Oeser
4d5e0a8520 Merge branch 'blender-v2.91-release' 2020-10-26 13:07:00 +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
Yevgeny Makarov
622b30225a UI: Capitalization Corrections
Approximately 141 changes of capitalization to conform to MLA title style.

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

Reviewed by Julian Eisel
2020-10-24 11:42:17 -07:00
Clément Foucault
e856443c99 CLOG: Add getter to know if output supports coloring 2020-10-24 14:07:05 -04:00
Brecht Van Lommel
b37c40a575 Fix Cycles unnecessary overhead cancelling finished task pool 2020-10-24 14:07:05 -04: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
390b28e338 Merge branch 'blender-v2.91-release' 2020-10-23 18:37:22 +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
Olivier Maury
559e87ad08 Fix T81976: Cycles crash after recent geometry sync multithreading change
Avoid accessing mesh emitter and hair at the same time. This is not ideal for
performance, but once we have a dedicated hair object this will resolve itself.

Differential Revision: https://developer.blender.org/D9322
2020-10-23 17:45:11 +02:00
Jagannadhan Ravi
bb49aa0d69 Cycles: multithreaded export of geometry
This improves performance in scene synchronization when there are many
mesh, hair and volume objects. Sync time speedups in benchmarks:

barbershop   5.2x
bmw          1.3x
fishycat     1.5x
koro         1.0x
sponza       3.0x
victor       1.4x
wdas_cloud   0.9x

Implementation by Nicolas Lelong, and Jagannadhan Ravi (AMD).

Differential Revision: https://developer.blender.org/D9258
2020-10-21 18:54:12 +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
Lukas Stockner
cfa101c228 Cycles: Add command line option for overriding the compute device
The current way of setting the compute device makes sense for local
use, but for headless rendering it it a massive pain to get Cycles
to use the correct device, usually involving entire Python scripts.

Therefore, this patch adds a simple command-line option to Blender
for specifying the type of device that should be used. If the option
is present, the settings in the user preferences and the scene are
ignored, and instead all devices matching the specified type are used.

Differential Revision: https://developer.blender.org/D9086
2020-10-02 19:26:35 +02:00
Campbell Barton
41d2d6da0c Cleanup: pep8 (indentation, spacing, long lines) 2020-10-02 11:59:16 +10:00
Campbell Barton
bab9de2a52 Cleanup: pep8, blank lines 2020-10-02 11:59:16 +10:00
Kévin Dietrich
edd1164575 Cycles: add time statistics to scene update
Gathers information for time spent in the various managers or object (Film, Camera, etc.) being updated in Scene::device_update.

The stats include the total time spent in the device_update methods as well as time spent in subroutines (e.g. bvh build, displacement, etc.).

This does not qualify as a full blown profiler, but is useful to identify potential bottleneck areas.

The stats can be enabled and printed by passing `--cycles-print-stats` on the command line to Cycles, or `-- --cycles-print-stats` to Blender.

Reviewed By: brecht

Maniphest Tasks: T79174

Differential Revision: https://developer.blender.org/D8596
2020-10-01 23:21:11 +02:00
Ray Molenkamp
84e122e38a Cycles: Fix broken 32 bit shift.
1ul << n will still be a 32 bit integer regardless
of the value of n, given the target here is 64 bits
the upper 32 bits will always be zero. Using 1ull
will yield the expected result.
2020-10-01 10:19:50 -06:00
Jacques Lucke
365bf103d1 Volumes: support lower resolution in viewport
The adds a new option to simplify volumes in the viewport.
The setting can be found in the Simplify panel in the render properties.

Volume objects use OpenVDB grids, which are sparse. For rendering,
we have to convert sparse grids to dense grids (for now). Those require
significantly more memory. Therefore, it's often a good idea to reduce
the resolution of volumes in the viewport.

Reviewers: brecht

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

Ref T73201.
2020-10-01 17:59:04 +02:00
Martijn Versteegh
f117966c4e Fix T80395: Cycles baking crash when Surfaces are disabled in the view layer
Always enable surfaces for baking, otherwise there is nothing to bake to.

Differential Revision: https://developer.blender.org/D9015
2020-10-01 14:37:59 +02:00
Brecht Van Lommel
2caa6dd7f8 Cleanup: clang-format 2020-10-01 14:29:45 +02:00
Nicholas Rishel
f187256624 Windows: workaround to make Windows Ink tablet API work
Now Wintab is not initialized when starting Blender with the tablet API
preference set to native, since that disables Windows Ink.

Note that changing the tablet API requires restarting Blender for changes
to take effect. This serves as a stopgap to allow use of Windows Ink until
runtime API switching is merged.

Differential Revision: https://developer.blender.org/D9051
2020-10-01 12:05:36 +02:00
Yevgeny Makarov
bcc6baec24 macOS: support for key repeat events in keymaps
Differential Revision: https://developer.blender.org/D8882
2020-10-01 11:53:22 +02:00
Ankit Meel
99fb853734 Cleanup: avoid member access within null pointer
While harmless, UBSan warns about this.
Prefer offsetof where possible since it's more readable.
2020-10-01 14:49:44 +10:00
Brecht Van Lommel
60e5ebdd62 Fix Cycles CUDA kernels for Ampere not building with CUDA 11
Running Blender on Ampere cards was already possible with ptx, this fix is
needed to support building CUDA binaries.

Note the CUDA version used for official Blender builds is still 10, this is
merely the change to make it possible for those using CUDA 11 and specifying
the sm_8x kernels to be compiled.

Found by Milan Jaros.
2020-09-30 18:29:42 +02:00
Piotr Ostrowski
53f20b940a Subdivision Surfaces: add option disable using the limit surface
This makes subdivision surfaces compatible with the old subdivision
surface modifier and other applications that do not use the limit surface.

This option is available on the Subdivision Surface modifier.

Differential Revision: https://developer.blender.org/D8413
2020-09-30 16:39:02 +02:00
Sergey Sharybin
ecdfb465cc Cycles: Fix usage of memory barriers in split kernel
On user level this fixes dead-lock of OpenCL render on Intel Iris GPUs.
Note that this patch does not include change in the logic which allows
or disallows OpenCL platforms to be used, that will happen after the
kernel fix is known to be fine for the currently officially supported
platforms.

The dead-lock was caused by wrong usage of memory barriers: as per the
OpenCL specification the barrier is to be executed by the entire work
group. This means, that the following code is invalid:

  void foo() {
    if (some_condition) {
      return;
    }
    barrier(CLK_LOCAL_MEM_FENCE);
  }

  void bar() {
    foo();
  }

The Cycles code was mentioning this as an invalid code on CPU, while in
fact this is invalid as per specification. From the implementation side
this change removes the ifdefs around the CPU-only barrier logic, and
is implementing similar logic in the shader setup kernel.

Tested on NUC8i7HVK NUC.

The root cause of the dead-lock was identified by Max Dmitrichenko.

There is no measurable difference in performance of currently supported
OpenCL platforms.

Differential Revision: https://developer.blender.org/D9039
2020-09-30 16:10:35 +02:00
Ivan Perevala
3a7d62cd1f Tracking: Implement Brown-Conrady distortion model
Implemented Brown-Conrady lens distortion model with 4 radial and
2 tangential coefficients to improve compatibility with other software,
such as Agisoft Photoscan/Metashapes, 3DF Zephir, RealityCapture,
Bentley ContextCapture, Alisevision Meshroom(opensource).

Also older programs: Bundler, CPMVS.
In general terms, most photogrammetric software.

The new model is available under the distortion model menu in Lens
settings.

For tests and demos check the original patch.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9037
2020-09-30 15:54:24 +02:00
Valentin
5ac4778056 Cleanup: convert gforge task ID's to phabricator format
Cleanup old tracker task format to the new. e.g: [#34039] to T34039

Ref D8718
2020-09-30 20:11:06 +10:00
Campbell Barton
dbaa9291f2 Cleanup: spelling 2020-09-30 12:25:58 +10:00
Campbell Barton
0863316745 Cleanup: use angle-brackets for email addresses
This is already the most widely used convention.

Use this so `make check_spelling_c` will ignore all email addresses.
2020-09-30 12:05:56 +10:00
Ankit Meel
c1cdde04e2 Fix T81100: ccl::Node: ASan SEGV due to bad pointer
`SOCKET_OFFSETOF` was added in the initial commit {rBec51175f1fd6c91d5}
when `offsetof` [1] was not supported well enough. GCC and LLVM
support it since C++17.

Other two changes: type and size check can be done without creating
an invalid address too.

[1] https://cppreference.com/w/cpp/types/offsetof

Reviewed By: campbellbarton, brecht

Maniphest Tasks: T81100

Differential Revision: https://developer.blender.org/D9042
2020-09-30 01:16:02 +05:30
Ivan
4c19dd523e Libmv: Fix NukeCameraIntrinsics copy constructor
Copy the appropriate parameter

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D9014
2020-09-28 09:57:28 +02:00
Campbell Barton
4786719dbd Cleanup: spelling 2020-09-24 14:27:48 +10:00
Jacques Lucke
4e8d3123f0 Cleanup: remove dead code in point cache and openvdb wrapper
Reviewers: brecht

Differential Revision: https://developer.blender.org/D8988
2020-09-23 14:57:41 +02:00
Brecht Van Lommel
dab50ad718 Cleanup: use float3 instead of float4 for shadow, since w is never used
Contributed by pembem22.

Differential Revision: https://developer.blender.org/D8947
2020-09-22 16:36:43 +02:00
Brecht Van Lommel
b63e6ab8d2 Fix Cycles SSS incorrect rendering of zero radius in green channel
Thanks to pembem22 for finding the problem.

Ref D8949
2020-09-22 16:28:12 +02:00
Kévin Dietrich
626201683e Cycles: add update flags to Node and SocketType
Those flags are meant for detecting which socket has changed, so in the
future we can have more granular updates.

`Node` now stores an `update_flags` member which is modified every time
a socket is changed though `Node::set`. The flags are or-able bits
stored in `SocketType` instances. Each `SocketType` stores a unique bit
out of 64, for the 64 bits of an uint64_t; the bit
corresponds to the index of the socket in the `Node`'s sockets array +
1, so the socket at index 5 will have the 6th bit set as its flag. This
limits us to 64 sockets per Node, which should be plenty for the current
set of `Nodes` that we have.

This does not change the behavior of other parts of Cycles.

This is part of T79131.

Reviewed By: brecht

Maniphest Tasks: T79131

Differential Revision: https://developer.blender.org/D8644
2020-09-22 14:50:43 +02:00
Sebastián Barschkis
edd19c1df9 Fluid: Fix for script export (standalone mode)
The OpenVDB update added a load() function. This function clashes with a helper IO function (only used when exporting and running the simulation externally) that was also named load().
2020-09-22 14:02:53 +02:00
Sebastián Barschkis
97ec16d68f Fluid: Refactor for initial velocities
Removed invel MAC grid since it is sufficient to use the cell centered vec3 representation. When setting initial velocities these will be interpolated by the setter functions.
2020-09-22 14:02:53 +02:00
Campbell Barton
14b2a35c8b Cleanup: use parenthesis for if statements in macros 2020-09-19 16:28:17 +10:00
Campbell Barton
17a2820da8 Cleanup: consistent TODO/FIXME formatting for names
Following the most widely used convention for including todo's in
the code, that is: `TODO(name):`, `FIXME(name)` ... etc.
2020-09-19 14:34:32 +10:00
Ankit Meel
b746179d0a CMake/OpenSubdiv: Rename INCLUDE_DIR -> INCLUDE_DIRS.
Ref {D8855}

Unix and Apple platform files use find_package(OpenSubdiv) which sets
`OPENSUBDIV_INCLUDE_DIR` as an advanced variable, as well as
`OPENSUBDIV_INCLUDE_DIRS` which should be used usually.
Windows sets `OPENSUBDIV_INCLUDE_DIR` which is used by the rest
of the code.

This patch renames it to `_DIRS` everywhere, for it to be like other
similar variables.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8917
2020-09-18 19:12:26 +05:30
Sergey Sharybin
9a5663ff43 Cycles: Add time report for Blender data synchronization
Allows to more easily access time information about how long Cycles
did spend synchronizing objects from evaluated depsgraph on Blender
side to its own structures.

This timer does not include time spent evaluating render depsgraph.
2020-09-18 12:03:22 +02:00
Alex Strand
b248ec9776 Shaders: add emission strength input to Principled BSDF node
This impacts I/O add-ons. OBJ, FBX and Collada have been updated, glTF not yet.

Differential Revision: https://developer.blender.org/D4971
2020-09-17 18:54:04 +02:00
Brecht Van Lommel
3dbb231ed2 Fix OpenCL render error in large scenes
In scenes such as Cosmos Laundromat, there were memory allocations bigger than
2GB which would overflow.

Problem and solution found by AMD, thanks!
2020-09-17 13:07:28 +02:00
Brecht Van Lommel
532ac1163c Tests: bundle tests for some modules in their own executables
The ffmpeg, guardedalloc and blenlib are quite isolated and putting them in
their own executable separate from blender_test is faster for development than
linking the entire blender_tests executable.

For Cycles, this also bundles all the unit tests into one executable.

Ref T79958

Differential Revision: https://developer.blender.org/D8714
2020-09-17 12:29:19 +02:00
Brecht Van Lommel
f9fcb25d52 CMake: clean up setting of platform specific linker flags
Set flags directly on the target, and use common function for all cases.
This refactoring helps with the next commit for test executables.

Ref D8714
2020-09-17 12:29:19 +02:00
Bastien Montagne
be11603dc2 Fix (unreported) buffer overflow in Cycles' system_cpu_brand_string helper.
Since this buffer is used as an array of 12 32bits integers, and C++
`string` expect a NULL-terminated C-string, we need an extra char to
ensure last one is always NULL.

See D8906. Found while investigating T80657.
2020-09-16 14:39:13 +02:00
Sriharsha Kotcharlakot
f137022f99 Liquid Simulation Display Options (GSoC 2020)
All the changes made in the branch `soc-2020-fluid-tools` are included in this patch.

**Major changes:**

=== Viewport Display ===

- //Raw voxel display// or //closest (nearest-neighbor)// interpolation for displaying the underlying voxel data of the simulation grids more clearly.
- An option to display //gridlines// when the slicing method is //single//.

==== Grid Display ====

- Visualization for flags, pressure and level-set representation grids with a fixed color coding based on Manta GUI.

==== Vector Display ====

- //**M**arker **A**nd **C**ell// grid visualization options for vector grids like velocity or external forces.
- Made vector display options available for external forces.

==== Coloring options for //gridlines// ====

- Range highlighting and cell filtering options for displaying the simulation grid data more precisely.
- Color gridlines with flags.

- Also, made slicing and interpolation options available for Volume Object.

Reviewed By: JacquesLucke, sebbas

Differential Revision: https://developer.blender.org/D8705
2020-09-15 23:13:01 +05:30
Patrick Mours
9f12ea496a Fix T80477: Crash when rendering with Embree but denoising with OptiX
Commit 009971ba7adc9603b90e9bf99b6b6d53eeae6c3a changed it so Cycles creates a separate
Embree device for each Cycles device, but missed the multi-device case. A multi-device with
Embree BVH can occur when CPU rendering is used with OptiX denoising and BVH creation then
failed to get a valid pointer to the Embree device, which crashed. This fixes that by providing the
correct device pointer in the multi-device case as well.
2020-09-15 14:58:19 +02:00
Campbell Barton
dd25d47e8a Cleanup: add missing headers to CMake, formatting 2020-09-15 22:53:44 +10:00