Commit Graph

1282 Commits

Author SHA1 Message Date
Sebastián Barschkis
4a6f715421 Fix T73552: Mantaflow - liquid particles show up in organized unrealistic structure
Issue was being caused by a particle offset which was random but the same for every particle.
2020-04-08 18:29:26 +02:00
Sebastián Barschkis
a1ddb63329 Fluid: Update Mantaflow source files
Update includes new grid helper functions and some cleanups.
2020-04-08 13:25:16 +02:00
Sebastián Barschkis
7cafdc57e0 Fluid: Manta clang-format update
Do not use sort-includes in Manta source files for now when applying clang-format. Too many conflicts.
2020-04-08 13:20:18 +02:00
Aaron Carlisle
899bfdc412 Audaspace: Update From Upstream (For API Docs)
No functional changes:

- Cleanup Spelling, Line Length
- Use proper class method styling for py docs
- Fix Broken Links

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

Fixes T75191
2020-03-30 17:47:40 -04:00
Sebastián Barschkis
7f3e84deb5 Fluid: Updated manta pp files
Includes only a rename. The name PyInit_Main was a bit confusing as it just belongs to Manta.
2020-03-17 11:57:04 +01:00
Sebastián Barschkis
35a29befb3 Fluid: Updated Manta pp files
Includes additional minmax check for Windows
2020-03-16 11:52:18 +01:00
Campbell Barton
74855969e7 Cleanup: use term suppress instead of repress
Also check MSVC instead of WIN32, for setting MSVC flags.
2020-03-12 12:13:41 +11:00
Ray Molenkamp
72461c09b4 Windows: Clean-up warnings originating from bullet
Bullet currently generates the majority of the warnings
on windows all of them are silly. This patch disables
all warns from bullet for now.

We should revisit this if/when we update bullet
to a newer version.

Reviewed By: sergey brecht

Differential Revision: https://developer.blender.org/D7118
2020-03-11 14:11:19 -06:00
Ray Molenkamp
372dcacbe4 Windows: Cleanup warning about non returning dtor
`google::LogMessageFatal::~LogMessageFatal` calls `abort`
which MSVC correctly identifies as 'not returning'
and warns about a potential memory leak.

Given this is intended behaviour and glog is not overly
concerned with shutting down the process nicely, we
can safely ignore this warning.
2020-03-11 14:07:47 -06:00
Sebastián Barschkis
5539b68009 Fluid: Optimization for smoke simulation (multigrid)
The solver will now automatically detect static scenes (no moving obstacles) and use a slightly faster pressure solve in those cases.
2020-03-07 19:57:06 +01:00
Phillip Thomas
6a6ccb26ec Build: show draco library under extern folder in Visual Studio
And other code tweaks to make this library more consistent with others.

Differential Revision: https://developer.blender.org/D6864
2020-03-01 16:19:37 +01:00
Sebastián Barschkis
21bdeb5cc0 Fluid: Updated Manta pp files
Updates include:
- std::move() cleanup in rcmatrix.h
- Enabled parallelization for fluid guiding (fairly noticeable speed improvement).
- More flexible flags setter function with control over boundary width.
2020-02-28 16:20:13 +01:00
Brecht Van Lommel
9085b7e847 Fix OpenVDB link error on Windows after recent changes 2020-02-26 19:24:20 +01:00
Brecht Van Lommel
78391def6e Cleanup: deduplicate OpenVDB library definitions/include/libs logic
This will more important when we start using OpenVDB in more modules.
2020-02-26 18:13:14 +01:00
Sergey Sharybin
3e77765362 Audaspace: Various fixes
- Fixed uninitialized result used in DynamicMusic::seek().

  The comment to this function says false is returned if the handle
  is invalid, while in practice non-initialized value will be returned.

- Spelling typos in comment.

- Silence -Wdelete-non-abstract-non-virtual-dtor warning.

Differential Revision: https://developer.blender.org/D6896
2020-02-21 18:31:56 +01:00
Sebastián Barschkis
b8af5e1062 Fluid: Updated manta pp files
Updates include:
- A fix from Jacques that changed the loop order in the mesh creation function (the fix speeds up the function significantly due to fewer cache misses).
- Some of the grid copy helper functions are now multithreaded.
- A fix for Windows file IO. Now it possible to load files with non ASCII characters on Windows too.
2020-02-21 15:29:32 +01:00
Sebastián Barschkis
bda8076d35 Fluid: Temporary fix for gzopen on windows
Needs more consideration. This fixes compilation for now.
2020-02-19 19:34:23 +01:00
Sebastián Barschkis
888d180164 Fluid: Updated manta pp files
Updates in the files include:
- New manta files now use an platform independent gzopen function
- Adjusted argument name for vorticity
2020-02-19 18:58:48 +01:00
Sebastián Barschkis
04b7f052e1 Fluid: Updated Manta updater script
Minor adjustments for the build directory location.
2020-02-19 18:58:48 +01:00
Patrick Mours
2278aa0da9 Cycles: Add support for adaptive kernel compilation to OptiX device
This modifies the common CUDA implementation for adaptive kernel compilation slightly to support both CUBIN and PTX output (the latter which is then used in the OptiX device). It also fixes adaptive kernel compilation on Windows.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D6851
2020-02-17 14:27:44 +01:00
Ray Molenkamp
75a5ea01c1 Cleanup/MSVC: Enable C++ conformance mode on compiler versions that support it.
MSVC has a conformance mode (/permissive-) where the C++ standard is more strictly
enforced. This mode is available on MSVC 15.5+ [1]

This patch enables this mode on compilers that support it and cleans up the few violations it threw up in the process.

- Mantaflow was using M_PI without requesting them using the _USE_MATH_DEFINES define to opt in to non default behaviour.
- Collada did not include the right header for std::cerr, this seemingly was fixed for other platforms already but put inside a platform guard.
- Ghost had some scoping issues regarding uninitialized variables and goto behaviour

Second landing of this patch, earlier commit was reverted due to some compiler configurations having slipped though testing

[1] https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance

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

Reviewed By: brecht
2020-02-13 17:13:07 -07:00
Ray Molenkamp
6022cd015f Revert "Cleanup/MSVC: Enable C++ conformance mode on compiler versions that support it."
It is breaking compilation on some configurations, revert for now while
i see what is wrong.

This reverts commit 9fe469c110940af5d2525158305d5d365bd15276.
2020-02-13 07:04:30 -07:00
Ray Molenkamp
9fe469c110 Cleanup/MSVC: Enable C++ conformance mode on compiler versions that support it.
MSVC has a conformance mode (/permissive-) where the C++ standard is more strictly
enforced. This mode is available on MSVC 15.5+ [1]

This patch enables this mode on compilers that support it and cleans up the few violations it threw up in the process.

- Mantaflow was using M_PI without requesting them using the _USE_MATH_DEFINES define to opt in to non default behaviour.
- Collada did not include the right header for std::cerr, this seemingly was fixed for other platforms already but put inside a platform guard.
- Ghost had some scoping issues regarding uninitialized variables and goto behaviour

[1] https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance

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

Reviewed By: brecht
2020-02-12 12:49:34 -07:00
Sebastián Barschkis
f780057d52 Merge branch 'blender-v2.82-release' 2020-02-09 17:27:15 +01:00
Sebastián Barschkis
4a08eb0707 Fluid: Updated manta pp files
Includes the OpenVDB read/write functions for int grids. This essential for the resume bake functionality in modular fluid caches.
2020-02-09 17:09:00 +01:00
Ray Molenkamp
f2df4e0076 Build optimization: Compile glew for size rather than speed with msvc.
Glew.obj is one of the more expensive targets we have to build clocking in
at 34.907 seconds.

The root cause [1] is the msvc inliner is not super thrilled with the
glewIsSupported supported function, this patch changes the buildflags
of extern_glew to optimize for size rather than speed.

Given glew is only in play at initalization time there will be no
performance impact.

Time to build glew.obj

Before: 34.907s
After :  1.961s

[1] https://developercommunity.visualstudio.com/content/problem/732941/slow-compilation-of-glewc-for-visual-studio-2019-x.html

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

Reviewers: brecht, sergey, fclem
2020-02-07 07:35:17 -07:00
Sebastián Barschkis
5a570be9f5 Fluid: Updated Manta pp files
Includes latest changes from the upstream manta repository.
2020-01-30 11:27:54 +01:00
3788901107 Cleanup: fix compiler warnings 2020-01-27 12:19:49 +01:00
Sebastián Barschkis
39ae4804a8 Fix T72789: Mantaflow cache doesn't work with non-latin cache directory
Root of the problem was that Manta's Python API was converting to and from Latin1 instead of UTF8.
2020-01-23 17:15:45 +01:00
Sergey Sharybin
517870a4a1 CMake: Refactor external dependencies handling
This is a more correct fix to the issue Brecht was fixing in D6600.

While the fix in that patch worked fine for linking it broke ASAN
runtime under some circumstances.
For example, `make full debug developer` would compile, but trying
to start blender will cause assert failure in ASAN (related on check
that ASAN is not running already).

Top-level idea: leave it to CMake to keep track of dependency graph.

The root of the issue comes to the fact that target like "blender" is
configured to use a lot of static libraries coming from Blender sources
and to use external static libraries. There is nothing which ensures
order between blender's and external libraries. Only order of blender
libraries is guaranteed.

It was possible that due to a cycle or other circumstances some of
blender libraries would have been passed to linker after libraries
it uses, causing linker errors.

For example, this order will likely fail:

  libbf_blenfont.a libfreetype6.a libbf_blenfont.a

This change makes it so blender libraries are explicitly provided
their dependencies to an external libraries, which allows CMake to
ensure they are always linked against them.

General rule here: if bf_foo depends on an external library it is
to be provided to LIBS for bf_foo.
For example, if bf_blenkernel depends on opensubdiv then LIBS in
blenkernel's CMakeLists.txt is to include OPENSUBDIB_LIBRARIES.

The change is made based on searching for used include folders
such as OPENSUBDIV_INCLUDE_DIRS and adding corresponding libraries
to LIBS ion that CMakeLists.txt. Transitive dependencies are not
simplified by this approach, but I am not aware of any downside of
this: CMake should be smart enough to simplify them on its side.
And even if not, this shouldn't affect linking time.

Benefit of not relying on transitive dependencies is that build
system is more robust towards future changes. For example, if
bf_intern_opensubiv is no longer depends on OPENSUBDIV_LIBRARIES
and all such code is moved to bf_blenkernel this will not break
linking.

The not-so-trivial part is change to blender_add_lib (and its
version in Cycles). The complexity is caused by libraries being
provided as a single list argument which doesn't allow to use
different release and debug libraries on Windows. The idea is:

- Have every library prefixed as "optimized" or "debug" if
  separation is needed (non-prefixed libraries will be considered
  "generic").

- Loop through libraries passed to function and do simple parsing
  which will look for "optimized" and "debug" words and specify
  following library to corresponding category.

This isn't something particularly great. Alternative would be to
use target_link_libraries() directly, which sounds like more code
but which is more explicit and allows to have more flexibility
and control comparing to wrapper approach.

Tested the following configurations on Linux, macOS and Windows:

- make full debug developer
- make full release developer
- make lite debug developer
- make lite release developer

NOTE: Linux libraries needs to be compiled with D6641 applied,
otherwise, depending on configuration, it's possible to run into
duplicated zlib symbols error.

Differential Revision: https://developer.blender.org/D6642
2020-01-23 16:59:18 +01:00
Ray Molenkamp
8e7faf0e67 Fix failing cycles_render_graph_finalize_test when building with clang
The gflags library was not fully configured to be built as a static
library, only one of two files was changed.

Differential Revision: https://developer.blender.org/D6611
2020-01-20 14:16:05 +01:00
Brecht Van Lommel
02f6722350 Build: upgrade to OpenEXR 2.4.0, OpenVDB 7.0.0 and Boost 1.70.0
This aligns with the VFX reference platform 2020 along with the decision
to stick to Python 3.7, see T68774.

Blosc was downgraded to 1.5 as recommended by the OpenVDB documentation.

IlmBase and OpenEXR are now built together with CMake rather separately
using autoconf.

Differential Revision: https://developer.blender.org/D6593
2020-01-20 09:43:28 +01:00
Sebastián Barschkis
adcc9d014c Fluid: Moved grid reset loop for inner obstacle cells from blenkernel code into Mantaflow
Having this loop in directly Manta is faster and potentially fixes issues T72783 and T72894.
2020-01-15 16:28:56 +01:00
Sebastián Barschkis
542e0c67ba Fluid: Updated Mantaflow source files
The memory leak described in T72498 has been fixed in Mantaflow, the updated files should reflect this in Blender.
2020-01-15 16:27:55 +01:00
Sebastián Barschkis
7ae35a7369 Fluid: Fix broken motion blur for liquids
Added missing resize for vector that holds vert velocities
2020-01-09 01:15:40 +01:00
Campbell Barton
af2be110c3 Fix T72402: Decimate f-curves fails with co-linear key-frames 2019-12-24 12:20:34 +11:00
Ray Molenkamp
a2d6dfc026 Fix: Build error with clang on windows.
A bug in llvm < 9.0.1 causes the compiler to crash when
openmp is enabled. Since mantaflow uses tbb we can safely
disable this flag temporarily for this module.

Reviewed By: sebbas

Differential Revision: https://developer.blender.org/D6446
2019-12-20 10:50:40 -07:00
Sebastián Barschkis
d27ccf990c Mantaflow [Part 6]: Updates in /blender/source
A collection of smaller changes that are required in the /blender/source files. A lot of them are also due to variable renaming.

Reviewed By: sergey

Maniphest Tasks: T59995

Differential Revision: https://developer.blender.org/D3855
2019-12-16 16:37:01 +01:00
Sebastián Barschkis
4ff7c5eed6 Mantaflow [Part 1]: Added preprocessed Mantaflow source files
Includes preprocessed Mantaflow source files for both OpenMP and TBB (if OpenMP is not present, TBB files will be used instead).

These files come directly from the Mantaflow repository. Future updates to the core fluid solver will take place by updating the files.

Reviewed By: sergey, mont29

Maniphest Tasks: T59995

Differential Revision: https://developer.blender.org/D3850
2019-12-16 16:27:26 +01:00
Campbell Barton
5a97a74c69 Cleanup: whitespace 2019-12-16 13:49:11 +11:00
Jim Eckerlein
9febff7e14 glTF: upgrade Draco to version 1.3.5 and add mesh skinning support
This will fix exporting meshes with armatures using Draco compression, like:
https://github.com/KhronosGroup/glTF-Blender-IO/issues/617

Differential Revision: https://developer.blender.org/D6342
2019-12-05 19:12:10 +01:00
Campbell Barton
b2d940250c Cleanup: remove unused CMake WITH_MOD_CLOTH_ELTOPO option 2019-11-25 14:52:44 +11:00
mano-wii
177dfc6384 Fix T71273: Bad encoding of utf-8 for Text objects
`BLI_strncpy_wchar_from_utf8` internally assumes `wchar_t` is 32 bits
which is not the case on windows.

The solution is to replace `wchar_t` with `char32_t`.

Thanks to @robbott for compatibility on macOS.

Differential Revision: https://developer.blender.org/D6198
2019-11-22 12:27:34 -03:00
Joerg Mueller
e93aa9c0fc Fix T71621: VSE crashes when playing last frame of audio
Porting bug fix from audaspace upstream.
2019-11-22 10:34:01 +01:00
122ba774e0 Fix T71621: VSE crashes when playing last frame of audio
Due to some floating point errors the last frame of a VSE audio strip can
cause integer overflow and crash Blender. This overflow was caused by a
cast from `int64_t` to `int` without prior check. The crash is fixed by
keeping the variable as `int64_t` for as long as possible.
2019-11-21 10:01:12 +01:00
Ray Molenkamp
67fa8d2307 Fix: Build error with msvc
std::min requires the algorithm header
2019-11-17 09:09:58 -07:00
Jörg Müller
fb1cbbaf46 Fix T71322: Crash in Audaspace with some video file
Getting upstream audaspace fixes for audio files with more than 8
channels.
2019-11-17 09:02:18 +01:00
Jim Eckerlein
b85e93b24e Fix bug in Draco encoding for glTF, files are now smaller
Data was not quantified properly. It also lets the library choose the suitable
encoding method rather than forcing it to use the edgebreaker method.

Differential Revision: https://developer.blender.org/D6183
2019-11-05 15:38:02 +01:00
Campbell Barton
312075e688 CMake: add missing headers, use space before comments 2019-10-29 01:33:44 +11:00
Campbell Barton
41ec25d27b Cleanup: style 2019-10-21 15:05:56 +11:00