Commit Graph

1299 Commits

Author SHA1 Message Date
Campbell Barton 2418daede5 Curve Fitting: Add alternate 'refit' method
This is an alternative method for fitting a curve which incrementally simplifies the curve, then re-fits.

Generally gives better results, also improves corner detection.
2016-07-25 14:55:08 +10:00
Sergey Sharybin 5fae2503bf Revert "OpenJPEG: update to 2.1 from 1.5"
This reverts commit f12204196f.

Campbell, sorry. have to revert this for the time being.

We've missed some very important bits, such as:

- FFmpeg is usually linked against OpenJPEG
- OIIO needs OpenJPEG as well.

For FFmpeg issues we can either disable OpenJPEG there (since
we don't really use it), or bump FFmpeg to version 3.1.1 which
can use either of OpenJPEG 1.5 or 2.1.

For OIIO we do need OpenJPEG support (otherwise Cycles will
not be able to use j2k/j2c textures) and currently there is
NO solution to make OIIO working with OpenJPEG 2.1.

According to Matthias Fauconneau (aka mfv) Larry is working
on the patch to get OIIO work with OpenJPEG 2.1, but it'll
take some time still.

I've tried to look into support of some sort of build system
flag and do ifdefs, but it all becomes quite nasty, especially
with bundled OpenJPEG bumped to 2.1.

Surely such an update is something we'll have to apply to
but at this exact moment it causes quite some pain for all
developers.

Suggest to wait for until OIIO supports OpenJPEG 2.1 and then
go with the updates for real.
2016-07-12 17:38:26 +02:00
Campbell Barton f12204196f OpenJPEG: update to 2.1 from 1.5
Stream handling has changed so this required changes to how files & memory are accessed.
2016-07-12 23:13:30 +10:00
Campbell Barton e41abdb907 CMake: suppressing indentation warning for extern 2016-07-11 17:16:35 +10:00
Campbell Barton abb9d0b0ad Curve Fitting: add high-quality flag
When this flag is set - even when the curve error is under the threshold,
keep attempting a better fit.

Enable this for freehand drawing, since it gives nicer results and isn't noticeably slower.
2016-06-14 02:27:32 +10:00
Campbell Barton 2033f47e55 Curve Fitting: offset based fallback to calculate cubics
Add a new fallback method that uses offset distance from the curve to the line between both points,
for freehand drawing it typically only fives minor improvements (1-3% fewer points),
for curve dissolve the improvements are more noticeable.
2016-06-12 22:25:43 +10:00
Campbell Barton cd768a8df1 Add upstream information to wcwidth library 2016-06-03 02:43:24 +10:00
Campbell Barton 108b36f1ce Add upstream information to libraries 2016-05-27 20:03:27 +10:00
Sergey Sharybin c3eb7c4e9d Add some more information about extern libraries 2016-05-27 09:27:44 +02:00
Campbell Barton cb2b776332 dd upstream information to libraries 2016-05-25 22:27:53 +10:00
Sergey Sharybin 0b588f0905 Forgot this in previous commit 2016-05-24 11:48:19 +02:00
Sergey Sharybin 8f04a228f7 Add upstream information to libraries 2016-05-24 11:46:53 +02:00
Campbell Barton 89df6720be CMake: use signed char for recastnavigation
External libraries may need char to be signed.
2016-05-19 07:36:32 +10:00
Campbell Barton 20678138f7 Cleanup: CMake indentation
Also remove outdated comment
2016-05-19 07:12:14 +10:00
Sergey Sharybin 6988061bf1 Cuda wrangler: Fix very nasty bug with multiple scalar type qualifiers 2016-05-18 18:01:37 +02:00
Campbell Barton 2b02e03973 Cleanup: simplify checks calculating tangents 2016-05-17 02:18:11 +10:00
Campbell Barton a1a640f614 Curve Fitting: correct circular tangent length calculation
Method for scaling is still not perfect but quite close.
2016-05-16 07:45:50 +10:00
Joshua Leung d4ed5c398e A "better" (?) fix for msvc silliness - used in one other place in all of Blender 2016-05-09 01:46:18 +12:00
Joshua Leung e43ee5563b Fix compiling on MSVC - M_PI undefined 2016-05-09 01:31:13 +12:00
Campbell Barton e5b4e6b0a3 Clamp dot-product to avoid precision error
Would only happen in degenerate cases.
2016-05-08 00:04:05 +10:00
Campbell Barton a3b42d638b Cleanup: whicespace 2016-05-07 23:58:04 +10:00
Campbell Barton 68e856da03 Curve Fitting: better fallback when least-square solution fails
Take curvature into account when calculating handle length.

Gives significantly better results for curve dissolve and 10-20% more efficient freehand drawing.
2016-05-07 21:48:00 +10:00
Campbell Barton d2296cd5ec Fix error copying cubic data 2016-05-07 21:38:48 +10:00
Campbell Barton 9b8bf57361 Curve Fitting: avoid clamping fallback handles. 2016-05-05 20:31:13 +10:00
Campbell Barton 122496dda1 Correct header (can't use uint here) 2016-05-02 21:08:02 +10:00
Campbell Barton ec9cb57b01 Curve Fitting: expose function for fitting a single curve 2016-05-02 18:50:04 +10:00
Campbell Barton b1f6cd5a6a Slight adjustment to curve fitting tangents
Don't let the point spacing give bias to a side.
2016-04-30 16:27:43 +10:00
Sergey Sharybin 87dcee0c0c Silence some annoying warnings when doing full build with strict flags
This mainly touches extern libraries and few debug-only places in intern.

Some summary:

- External libraries are not strict at all about missing declarations,
  so we can rather safely remove such warning together with other strict
  flags.

- Bullet has some static functions which are not used.
  Those were commented out.

- Carve now has some unused debug-only functions commented out as well.
  While we're on the way of getting rid of Carve, it makes sense to make
  things a bit cleaner for the time being.

- In LZMA we have some parts disabled which gives some set but unused
  variables which is rather correct.

- Elbeem had quite some variables set and never used because their usage
  is inside of debug-only code which is commented out.

Note about patching upstream libraries: surely one might say that we
have to make local patchset against this, but own experience says it
only gives extra work trying to merge such tweaks to a new upstream
version and usually it's just faster to re-apply such fixes again after
bundling new upstream library.
2016-04-22 10:59:15 +02:00
Sergey Sharybin 75c9fe428f Update bundled openjpeg from 1.5.0 to 1.5.2
Solves following issues:

- Quite reasonable amount of paranoid warnings were solved by an upstream
- Upstream seems to have all fixes needed for FreeBSD and OSX already
- Brings all fixes and such from upstream
2016-04-20 10:36:58 +02:00
Campbell Barton 2ca4d21976 Cleanup: rename cos-angle to match BLI_math 2016-04-20 07:50:48 +10:00
Campbell Barton 8ac662c77a New freehand curve drawing tool
- Access with Shift-LMB or from the 'Create' toolbar tab.
- Uses curve fitting for bezier curves, with error and corner angle options.
- Optional tablet pressure to curve radius mapping.
- Depth can use the cursor or optionally draw onto the surface,
  for the entire stroke or using the stroke start.
- Stroke plane can optionally be perpendicular to, or aligned to the surface normal.
- Optional radius tapering and for start/end points.
- Supports operator redo and calling from Python.
2016-04-15 20:36:38 +10:00
Campbell Barton e56e7bd1ec Add lib for n-dimensional cubic curve fitting
This will be used for calculating bezier curves from freehand drawing,
may be used for other areas too.

Original code from GraphicsGems, 1990 (FitCurve.c),
with updates from OpenToonz, under 3 clause BSD license.
with own minor modifications for integration with Blender:
- support adding extra custom-data.
- improved handle clamping.
2016-04-15 20:33:58 +10:00
Sergey Sharybin dc7d6643e1 Remove any wrangler utility scripts 2016-04-12 11:07:23 +02:00
Campbell Barton 4fae162bce CMake: ignore header 2016-04-12 18:50:08 +10:00
Sergey Sharybin b1ef786a73 CMake: Partially revert recent missing headers commit
The header which was put to the CMake project is not by any means used
during compilation, it is only used when manually updating CUDA wrangler
from CUDA headers.
2016-04-12 08:54:34 +02:00
Campbell Barton a2db16ba58 CMake: add missing headers 2016-04-12 11:22:30 +10:00
Reinier de Blois 176538f613 Update Recast version to 1.5.0
The version of Recast that Blender ships with is from 2009.  This patch updates the Recast version to the latest version, 1.5.0.  The Detour version remains untouched.

Reviewers: campbellbarton, moguri

Reviewed By: moguri

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1747
2016-04-05 21:38:52 +02:00
Brecht Van Lommel e14324daa7 Fix T47758: rigidbody bug with constraint breaking and disable collisions.
This is a regression in Bullet, reverted the problematic change for now with
a custom patch.
2016-03-27 01:32:28 +01:00
Sergey Sharybin 12ca20e6c3 Attempt to fix GLog compilaton on FreeBSD
Copied some config variables from an original config file.
2016-02-21 13:40:22 +01:00
Sergey Sharybin d9bf6b2d33 Carve: Silence 32/64 bit shit warning
There's no need to mix ints and size_t here at all
because all the values fits into integer.

It's unlikely we'll be re-bundling Carve, so didn't
bother with the patchset.
2016-02-20 14:06:10 +05:00
Sergey Sharybin aff60520bd Fix some warnings in GLog/GFlags when buildingwith MSVC2013
Those warnings were only addressed for MSVC2015 so far.
2016-02-20 14:06:05 +05:00
Sergey Sharybin d81dd2da0f Fix/workaround static object initialization in gflags 2016-02-17 15:01:40 +01:00
Campbell Barton 9ab7482657 Imbuf: remove libredcode
D1751, remove this library since its quite a specific - only supports an older version of this codec.

Also ffmpeg has added support for recent versions of the codec.
2016-02-03 18:39:37 +11:00
Brecht Van Lommel deef941208 Fix build error on OS X in previous commit, this define should stay. 2016-02-02 00:41:32 +01:00
Brecht Van Lommel fae710a213 Fix T47293: game engine crashes since Bullet upgrade.
This restores a modification that was there before.
2016-02-02 00:19:09 +01:00
Brecht Van Lommel b64d5809e7 Upgrade Bullet to version 2.83.
I tried to carefully preserve all patches since the last upgrade.

Improves T47195, cloth collision detection bug.

Differential Revision: https://developer.blender.org/D1739
2016-01-25 22:14:46 +01:00
Joshua Leung 445f7910e8 Hacky compile fix for mingw compile issue reported by bat3a on bf-committers
I've been using this fix in another branch locally, so it seems to work fine.
The other #ifdef checks should be checked on too, as __MINGW32__ and __MINGW64__
do NOT seem to be defined when compiling that file
2016-01-22 13:59:54 +13:00
Sergey Sharybin 5feb3688fb Carve: Remove empty implementation files 2016-01-19 22:56:37 +01:00
Sergey Sharybin 90e827ba66 CMake: De-duplicate checks around unordered maps and shared pointer
Previously several areas were calling TEST_SHARED_PTR_SUPPORT and
TEST_UNORDERED_MAP_SUPPORT which isn't that bad on it's own but
was causing some quite verbose output with same information line
printed multiple times. additionally, what's more worse, define flags
for Ceres were duplicated in main CMakeLists and Ceres's CMakeLists.

Now we've got a single place where checks for those classes are
happening and other areas are simply checking for variables set by
those check macros, keeping CMake output clean and nice.
2016-01-14 12:38:46 +05:00
Sergey Sharybin 2af7637f20 Cycles: Add option to directly link against CUDA libraries
The main purpose of such linking is to make Blender compatible with
NVidia's debuggers and profilers which are doing some LD_PRELOAD
magic to intercept some function calls. Such magic conflicts with
our CUDA wrangler magic and causes segmentation faults.

The option is disabled by default, so there's no affect on any of
artists.

In order to make Blender linked directly against CUDA library use
the WITH_CUDA_DYNLOAD CMake option (it's marked as advanced).
2016-01-14 12:27:22 +05:00
Martijn Berger 425a4b23fd MSVC 2015 do not redefine snprintf 2016-01-09 08:55:58 +01:00
Sergey Sharybin c35ad8d4a3 GTest: Fix some strict compiler warnings
Those changes are to be backported to the upstream actually, for until then
it should be good enough to have it locally.
2016-01-04 23:54:02 +05:00
Sergey Sharybin ba432299cd Move Libmv from extern/ to intern/
Logically it is intern library since being mainly developed by 1.5 blender guys.
2016-01-04 19:39:13 +05:00
Sergey Sharybin 6fb6a08bf8 Move Ceres to extern/
Even tho it's currently only used by Libmv we might use it for something
else in the future. Plus, it's actually where it logically belongs to.
2016-01-04 19:39:13 +05:00
Sergey Sharybin 0b856dd97e Move GLog/GFlags to extern/
This is where the libraries belongs to actually, they are not only used by
Libmv now, but also by tests and Cycles.
2016-01-04 19:39:13 +05:00
Sergey Sharybin 69f4080839 Re-organize structure of GLog/GFlags CMake libraries
The idea is to split them into two separate targets and have dedicated include
directories list for each of them in order to avoid some annoying include header
modifications in comparison with upstream.

Reviewers: campbellbarton, juicyfruit

Differential Revision: https://developer.blender.org/D1706
2016-01-04 19:39:13 +05:00
Sergey Sharybin 5d99cde822 Remove SCons building system
While SCons building system was serving us really good for ages it's no longer
having much attention by the developers and started to become quite a difficult
task to maintain.

What's even worse -- there started to be quite serious divergence between SCons
and CMake which was only accumulating over the releases now. The fact that none
of the active developers are really using SCons and that our main studio is also
using CMake spotting bugs in the SCons builds became quite a difficult task and
we aren't always spotting them in time.

Meanwhile CMake became really mature building system which is available on every
platform we support and arguably it's also easier and more robust to use.

This commit includes:

- Removal of actual SCons building system
- Removal of SCons git submodule
- Removal of documentation which is stored in the sources and covers SCons
- Tweaks to the buildbot master to stop using SCons submodule
  (this change requires deploying to the server)
- Tweaks to the install dependencies script to skip installing or mentioning
  SCons building system
- Tweaks to various helper scripts to avoid mention of SCons folders/files
  as well

Reviewers: mont29, dingto, dfelinto, lukastoenne, lukasstockner97, brecht, Severin, merwin, aligorith, psy-fi, campbellbarton, juicyfruit

Reviewed By: campbellbarton, juicyfruit

Differential Revision: https://developer.blender.org/D1680
2016-01-04 14:20:48 +05:00
Sergey Sharybin 66bea2d77e Fix compilation error on Windows 2016-01-02 13:17:39 +05:00
Sergey Sharybin 619946253e Libmv: Yet again update to the latest version
Again brings some fixes for MSVC-2015 and keeps it easier to backport
the fixes into upstream.
2015-12-31 17:56:57 +05:00
Sergey Sharybin 8e1fae3e38 Libmv: Update to latest upstream version
Brings some extra fixes for MSVC-2015
2015-12-31 16:16:52 +05:00
Sergey Sharybin 6046a86522 Update CUDA wrangler to latest upstream
Brings support of NVRTC bindings and also makes it easier to tweak
libraries paths and use multiple alternative names for libraries.
2015-12-31 16:02:24 +05:00
Martijn Berger b6697b4d2a MSVC 2015 fix: do not redefine snprintf, even MS is getting standards complient 2015-12-31 08:53:06 +01:00
Brecht Van Lommel d9bb4a200c Fix OS X (with 10.11 SDK) glog build errors due to using deprecated code.
Some values are now restored to the ones from before the upgrade today.
2015-12-30 19:52:25 +01:00
Sergey Sharybin 4145a4d08c GLog: Solve some compilation warnings
Those are actually sent to a pull-request, see

  https://github.com/google/glog/pull/81
2015-12-30 17:25:54 +05:00
Sergey Sharybin 6b7ead4fe8 Libmv: Update to the latest upstream version
Main reason is to bring up new Glog which should have MSVC 2015
support.
2015-12-30 17:01:28 +05:00
Martijn Berger 5e974a350f Make cycles compile with MSVC 2015 2015-12-29 18:59:23 +01:00
Sergey Sharybin bb53c28704 Ceres: Remove suitesparse related files
It's quite small chance we'll be supporting suitesparse for Blender due to all
the complexity of 3rd party libraries, so removing implementation files which
are only needed when suitesparse is enabled.
2015-12-28 16:37:48 +05:00
Martijn Berger e9825ad9f3 MSVC 2015 fix hack around internal compiler crash on openmp atomic
Eigen3 bug report: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1131
2015-12-10 15:00:30 +01:00
Martijn Berger 9ad13d70fa Update Eigen to version 3.2.7
The main purpose of this is to get MSVC 2015 fixes
2015-12-10 12:37:46 +01:00
Brecht Van Lommel f9047c3f8c Eigen: fold remaining OpenNL code into intern/eigen.
Differential Revision: https://developer.blender.org/D1662
2015-12-10 01:58:10 +01:00
Brecht Van Lommel 858b680a50 Eigen: move C API into intern/eigen. 2015-12-10 01:58:06 +01:00
Campbell Barton fc9505c9c5 Cleanup: warnings & spelling 2015-12-02 13:15:52 +11:00
Sergey Sharybin d2a822fe07 CUEW: Update to latest version
It is now updated against CUDA Toolkit 7.5. Currently should be no functional
changes, just begin some ground work for the future.
2015-11-25 23:30:46 +05:00
Campbell Barton ae8e4d3718 Cleanup: redundant 'break', minor edits 2015-11-19 22:52:13 +11:00
Sergey Sharybin 6005bb5846 OpenCL wrangler: Update to latest version to fix issues with -1001 error code 2015-10-29 20:37:38 +05:00
Sergey Sharybin ced1c34f74 Ceres: Update to the latest version
It brings all the performance improvements, bug fixes and stability improvements
which were done in the last year of Ceres development.
2015-10-28 19:20:50 +05:00
Campbell Barton 93bc81f495 Upgrade glew to v1.13 2015-10-11 12:53:41 +11:00
Brecht Van Lommel b098609186 Fix various compiler warnings. 2015-10-10 17:35:30 +02:00
Brecht Van Lommel 64e4f9967f Fix T46403: motion tracking not workig with Xcode 7 on OS X.
Caused by use of the uninitialized shape_ variable in Resize().
2015-10-10 04:09:37 +02:00
Bastien Montagne 8159718faf BLI: add SVD solver for mat3 (using eigen3). 2015-10-09 21:26:33 +02:00
Sergey Sharybin 9744c8ca58 CMake: Another attempt to solve compilation error on Windows 2015-09-17 14:29:56 +05:00
Sergey Sharybin a712459603 CMake: Attempt to fix compilation error on Windows after recent changes 2015-09-17 14:17:00 +05:00
Sergey Sharybin 0b959458ff CMake: Don't modify global CFlags when enabling/disabling OpenJpeg 2015-09-16 19:10:41 +05:00
Sergey Sharybin 42e15b9dd3 Fix T46051: Loading certain Jpeg causes system alert sound (Win32)
The issue was caused by RedCode library printing binary string to the terminal.
2015-09-09 16:18:37 +05:00
Sergey Sharybin dfc672f8bb SCons: Fix for really nasty bug with polluting configuration environment
The issue was caused by the following construction:

  def = env['SOMETHING']
  defs.append('SOMETHING_MORE')

Since first assignment was actually referencing environment option it was totally
polluted hawing weird and wonderful side effects on all other areas of Blender.
2015-08-04 18:06:28 +02:00
Sergey Sharybin 3d36489672 OpenSubdiv: Commit of OpenSubdiv integration into Blender
This commit contains all the remained parts needed for initial integration of
OpenSubdiv into Blender's subdivision surface code. Includes both GPU and CPU
backends which works in the following way:

- When SubSurf modifier is the last in the modifiers stack then GPU pipeline
  of OpenSubdiv is used, making viewport performance as fast as possible.

  This also requires graphscard with GLSL 1.5 support. If this requirement is
  not met, then no GPU pipeline is used at all.

- If SubSurf is not a last modifier or if DerivesMesh is being evaluated for
  rendering then CPU limit evaluation API from OpenSubdiv is used. This only
  replaces the legacy evaluation code from CCGSubSurf_legacy, but keeps CCG
  structures exactly the same as they used to be for ages now.

This integration is fully covered with ifdef and not enabled by default
because there are several TODOs to be solved first:

- Face varying data interpolation is not really cleanly implemented for GPU
  in OpenSubdiv 3.0. It is also not implemented for limit evaluation API.

  This basically means we'll have really hard time supporting UVs.

- Limit evaluation only works with adaptivly subdivided meshes so far, which
  basically means all the points of CCG are pushed to the limit. This gives
  different result from old code.

- There are some serious optimizations possible on the topology refiner
  creation, which would speed up initial OpenSubdiv mesh creation.

- There are some hardcoded asumptions in the GPU and DerivedMesh areas which
  could be generalized.

  That's something where Antony and Campbell can help, making it so the code
  is structured in a way which is reusable by all planned viewport projects.

- There are also some workarounds in the dependency graph to make sure OpenGL
  buffers are only freed from the main thread.

Those who'll be wanting to make experiments with this code should grab dev
branch (NOT master) from

  https://github.com/Nazg-Gul/OpenSubdiv/tree/dev

There are some patches applied in there which we're working on on getting
into upstream.
2015-07-20 22:29:26 +02:00
Sergey Sharybin bbed6af857 CMake: Disable Werror in extern/libmv for now
It gives issues with Glog compiled in release mode.

Need to revisit the directory layout here and compiler flag, because technically
libmv is now more an intern/ library and i'll actually prefer it to be covered
with strict flags as well. But it's a bit tricky because of libraries which we
don't maintain are in the libmv subfolder.
2015-07-18 11:16:25 +02:00
Sergey Sharybin 2199a3e38b CMake: Add option to enable -Werror cflag in some areas
It is rather annoying attitude nowadays to use const qualifier all over the
place, including using it for multi-dimensional arrays. This isn't really
supported in GCC prior to version 5.0 because it considers such an arrays
to be a "pointer to a const pointer" which gives implicit casting errors.

It's not possible to disable this particular type of warnings treated as
errors in any GCC version prior to 5.0 as well, meaning currently usage of
-Werror globally in Blender code is not possible at all.

This commit makes it possible to use -Werror in areas which are complaint
with older GCC versions. New advanced CMake options are:

- WITH_COMPOSITOR_WERROR
- WITH_LIBMV_WERROR
- WITH_CYCLES_WERROR
2015-07-18 10:49:51 +02:00
Bastien Montagne 582e7a6347 Add a skeleton of C API for Eigen3.
Title says pretty much everything. For now, only thing available is a solver of eigen
values/vectors for self-adjoint matrices.

We can easily add more when needed.

Thanks to Sergey and Campbell for quick review.
2015-07-13 18:05:38 +02:00
Campbell Barton cd7853be22 CMake: quiet warnings in GTest 2015-06-23 14:34:52 +10:00
Campbell Barton 36d47ce203 Fix leak in BMesh convex hull operator 2015-05-30 16:17:04 +10:00
Campbell Barton 5d30c23c35 doxygen: corrections/updates
Also add depsgraph & physics
2015-05-20 14:12:22 +10:00
Sergey Sharybin 650fbd09f7 OpenCL wrangler: Add some of the extension defines 2015-05-15 13:22:47 +05:00
Campbell Barton 6f0f1dc3be Cleanup: warnings 2015-04-19 22:03:42 +10:00
Campbell Barton 15d3d8560d Cleanup: remove unused face normals
also use const
2015-04-17 23:50:23 +10:00
Sergey Sharybin 917b8754f9 Tracking: Fix one frame memory leak when tracking last frame 2015-03-25 13:20:37 +05:00
Sergey Sharybin 0f0e080a26 Fix T44110: Plane track doesn't work when built with scons
For some reason recent change in avoiding non-aligned eigen vectors
was behaving differently for cmake and scons. Made it a bit different
now by storing scalars. This is more robust approach anyway, because
it's not really guaranteed Mat.col() gives a pointer inside data,
depending on column-major vs. row-major storage.

This is to be backported to 2.74 branch.
2015-03-24 14:05:49 +05:00
Campbell Barton 4b88541d59 CMake: unbundle eigen3
Optionally use systems eigen3 library.

T41989 by @hasufell with edits
2015-03-19 15:41:41 +11:00
Campbell Barton 2df4444def CMake: exclude Colamd when OpenNL's disabled 2015-03-19 14:48:52 +11:00
Campbell Barton bb825d02f8 CMake: unbundle LZO library
Patch T41989 by @hasufell
2015-03-13 22:36:01 +11:00
Sergey Sharybin 3f572fe7d2 Fix T43905: Crash happens when press Create Plane Track
It was only happening on 32bit platforms because of alignment
differences when allocating class.

Now got rid of copy of eigen matricies stored by value in the
residual block which solves aligment issues and should also
give some unmeasurable speedup.
2015-03-06 14:58:16 +05:00
Campbell Barton d17e6c10df Cleanup: quiet minilzo warnings 2015-03-06 17:47:23 +11:00
Ines Almeida b7033e3d4e BGE physics: adding links to bullet documentation 2015-02-19 11:20:18 +00:00
Campbell Barton 65574b0b03 cleanup: shebang lines
D888 by @sambler
2015-01-29 15:56:23 +11:00
Sergey Sharybin 653c6f2edd SDL wrangler: Support loading SDL2 libraries of different names
Seems different distros might have different naming rules, so need
to adopt our code for that.
2015-01-14 00:26:43 +05:00
Campbell Barton 72ca952641 correct permissions 2015-01-08 23:01:15 +11:00
Sergey Sharybin 59742167ce Just another attempt to make MSVC happy
No idea why standalone libmv remo was all fine with the code..
2014-12-31 19:04:29 +05:00
Sergey Sharybin bca434de78 Hopefully fix compilation error after recent update 2014-12-31 16:42:40 +05:00
Sergey Sharybin caa2306d16 Libmv: Update to latest upstream version
Main purpose of this is to bring new gflags library which is more likely
to have a fix for undefined order of static variables initialization and
also to bring new glog where some compilation error are fixed (which are
only visible with more strict checks with clang and c++11 enabled).
2014-12-31 16:02:04 +05:00
Sergey Sharybin 2617d37034 Libmv: Reshuffle CMake and SCons configuration files
The main idea is to share as much code between cases when feature-full built
is done and only logging is needed, so all the defines and include directories
are guaranteed to be the same.

This would hopefully make it so MinGW compilation is all happy about Cycles
logging for both CMake and SCons.
2014-12-11 11:58:03 +05:00
Sergey Sharybin 8600dc6365 Fix T42800: Blender suddenly closes after pressing solve camera motion
Couple of issues:

- Fist/last frame calculation was wrong

- Keyframe selection might silently fail leading to unpredictable math
  errors all over the place. Now if keyframe selection fails solver wouldn't
  run.
2014-12-04 20:02:05 +05:00
Sergey Sharybin 627f27502f Cycles: Support logging when building with SCons
Basically, title says ti all, the option is called WITH_BF_CYCLES_LOGGING
2014-12-03 22:46:56 +05:00
Sergey Sharybin 80d1d624d3 Support dynamic loading of SDL libraries
This is mainly to address old issue when one need to have SDL library installed
in order to use our official builds. Some hip distros already installs SDL,
but it's not quite the same across all the variety of the distros.

We also now switching to SDL-2.0, most of the distros have it in repositories
already, so it shouldn't be huge deal to install it if needed.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D878
2014-11-17 17:43:18 +05:00
Sergey Sharybin fa6c45b092 Cycles: Fix compilation error with enabled looging but disabled libmv 2014-11-15 04:01:31 +05:00
Sergey Sharybin f82f1513e0 Booleans: Boost is no longer a dependency for Carve
SCons is currently broken on my laptop, so can't test if it works for sure,
so please do tests of that.
2014-11-13 18:26:21 +05:00
Sybren A. Stüvel 53297e62eb Fixed warning about redefining the __SSE__ macro in VS2013 2014-11-05 21:55:17 +05:00
Sergey Sharybin aa91a36864 Libmv: Code cleanup, avoid C11 feature with structure re-definition 2014-11-01 03:18:40 +05:00
Sergey Sharybin 26e440838f Libmv: Code cleanup, mixed class/struct in declaration/definition 2014-11-01 02:57:05 +05:00
Sergey Sharybin f312f890f1 Libmv: Support disabled color channels in tracking settings
This was never ported to a new tracking pipeline and now it's done using
FrameAccessor::Transform routines. Quite striaghtforward, but i've changed
order of grayscale conversion in blender side with call of transform callback.

This way it's much easier to perform rescaling in libmv side.
2014-10-30 23:29:53 +05:00
Sergey Sharybin 606329d0f8 Libmv: Replace region tracker with autotracker in Blender
The title actually tells it all, this commit switches Blender to use the new
autotrack API from Libmv.

From the user point of view it means that prediction model is now used when
tracking which gives really nice results.

All the other changes are not really visible for users, those are just frame
accessors, caches and so for the new API.
2014-10-30 23:12:19 +05:00
Sergey Sharybin 7013d55580 Libmv: Add autotrack API to the C-API
Pretty much straightforward changes, nothing to be mentioned specially.
2014-10-30 23:07:46 +05:00
Keir Mierle b15a056230 Libmv: Initial commit of unfinished AutoTrack API
This starts the creating the new AutoTrack API. The new API will
make it possible for libmv to do full autotracking, including
predictive tracking and also support multiple motion models (3D
planes etc).

The first goal (not in this patch) is to convert Blender to use
the new API without adding any new functionality.

This API currently contanins:

- Frame accessor to access frames which are stored in Blender side.
- New Tracks implementation
- New Reconstruction implementation

Currently this API only tested on doing the same frame-to-frame
tracking as the old API allowed to do. But it also supports now
predictive tracking which is based on the Kalman filter.
2014-10-30 23:03:34 +05:00
Jens Verwiebe c8d10d115c OSX/CLEW: silence hundreds of warnings: 'weak_import' attribute only applies to variables and functions 2014-10-24 14:25:02 +02:00
Jason Wilkins 88fe896243 Checked each of my (jwilkins) XXX notes.
The ones in extern/glew-es have been changed to NOTE instead of XXX

GHOST_ContextEGL.cpp: It really does seem that it is not possible to query the swap interval using EGL

GHOST_WidnowCocoa.h: The comment referring to Carbon is clearly out of date, so I removed it.

math_geom.c: The node about not using tmax again is correct, but the code is kept for a future maintainer who will need to know how to compute it if they modify that code.

paint_image_proj.c (2698): The question about integer truncation does not appear to have been resolved.  It still seems to be an incorrectly implementation of rounding (I'd suggest using the round function instead of this hack).
2014-10-22 20:03:25 -05:00
Sergey Sharybin ad4980ce5e Code cleanup: Mostly whitespace 2014-10-10 02:17:46 +06:00
Sergey Sharybin c1004b1b77 Libmv: Update Ceres to latest upstream
just to be sure we're dealing with the latest git version when troubleshooting
one annoying OSX issue..
2014-10-09 11:30:59 +02:00
Jason Wilkins 8d084e8c8f Ghost Context Refactor
https://developer.blender.org/D643
Separates graphics context creation from window code in Ghost so that they can vary separately.
2014-10-07 15:47:32 -05:00
Campbell Barton a8705e99ee Sculpt: minor speedup for dyntopo
Add retake to range-tree to avoid double lookup.
2014-10-07 21:02:08 +02:00
Campbell Barton 37474e50ce Cleanup: use bool 2014-10-07 20:40:11 +02:00
Sergey Sharybin db62a80869 Libmv: Remove old workaround for 10.5 hash tables
We on'don't really support 10.5 anymore for my knowledge and in any case
the defined symbol was never checked in the sources, so this workaround
was basically doing nothing for quite some time now.
2014-10-02 13:01:34 +06:00
Sergey Sharybin 178f8400ee Libmv: Add an option to disable schur specializations build-time
This way folks with few ram or those who wants to hack into Ceres
code might compile Blender much faster.
2014-10-02 13:01:34 +06:00
Sergey Sharybin 5ab4c6b7aa Libmv: Silence some warnings about C11 usage
This makes headers a bit less clean (with the anonymous structs
mainly and headers inclusion from another header.

Makes compilation with clang a bit less noisy.
2014-10-02 13:01:34 +06:00
Sergey Sharybin ff53b046f2 Libmv: update ceres to latest upstream version
This brings faster BlockRandomAccessSparseMatrix::SymmetricRightMultiply.
2014-09-30 14:50:05 +06:00
Sergey Sharybin 56a5f17846 Libmv: Enable explicit Schur complement matrix by default
Gives up to 2x speed up of camera solving process in average scene.
In the really huge one it might be slower, but that we need to investigate.
2014-09-30 00:43:04 +06:00
Sergey Sharybin b16e924251 Libmv: Update Ceres to the latest upstream version
Mainly to let ITERATIVE_SCHUR use an explicit Schur Complement matrix.
2014-09-30 00:39:45 +06:00
Kévin Dietrich e1afaa02bf Fix T41974: blender ships vulnerable minilzo version
Update lzo library due to security issue

Update lzo to latest version. This fixes a security issue (reported in T41974)

This also fixes some (false-positive) valgrind warnings.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D803
2014-09-28 01:35:12 +06:00
Sergey Sharybin e237424046 Tracking: Make sure INC_SYS is always fine 2014-09-27 15:41:46 +06:00
Sergey Sharybin 84dfec76eb Tracking: Cleanup of the bundler script 2014-09-27 00:50:41 +06:00
Sergey Sharybin 58a9569628 SCons: Don't compile libmv stub when libmv is actually enabled
Really weird linux and windows didn't have duplicated symbols error.
2014-09-26 14:28:04 +06:00
Sergey Sharybin 13d8671a1a Cycles: Add support of Glog logging
This commit makes it possible to use Glog library for the debug logging.
For now only possible when using CMake and in order to use the logging
the WITH_CYCLES_LOGGING configuration variable is to be enabled.

When this option is not enabled or when using Scons there's no difference
in Cycles behavior at all, when using logging and no output to the console
impact is gonna to be minimal.

This is done in order to make it possible to have debug logging persistent
in code (without need to add it when troubleshooting some bug and removing
it afterwards).

For now actual logging is not placed yet, only all the functions needed for
the logging are written and so.
2014-09-25 17:08:32 +06:00
Sergey Sharybin 058e3f087e Tracking: Decouple C-API module into more granular files
This way maintaining the C-API is a bit less tedious job
and makes code cleaner to follow.

Should be no functional changes.
2014-09-25 17:04:56 +06:00
Sergey Sharybin 42abfe4853 Update Ceres to latest upstream version
As usual brings fixes and speed improvements.
2014-09-25 13:04:17 +06:00
Sergey Sharybin 181e7f98b2 Tracking: Enable Schur specializations
This would give some performance boost when solving huge scenes,
amount of boost depends on particular scene.

For now enable all of the specializations, in the future we might
add some local patches and restrict only unneeded ones.
2014-09-25 13:04:16 +06:00
Sergey Sharybin 0fe70b5e28 Fix T41360: Crash on Boolean Modifier
The issue was caused by the wrong attributes maps in certain
circumstances after union intersections.

Namely issue might have happen when more than one iteration of
union was happening and it was caused by the fact that new faces
might be allocated on the same address as freed face from the
old mesh.

Didn't find a nicer fix for this apart from correcting the whole
attributes map after each union step.

We could try removing attributes for the meshes which are getting
deleted, but in asymptotic it's gonna to give exactly the same
complexity as the current approach.
2014-08-11 20:55:52 +06:00
Benoit Bolsee 3a53ed8d1b Remove an assert in Bullet for the Character physics.
This assert happens all the time for character physics in debug mode.
In release mode, the assert is skipped but the code is still incorrect
although it does not cause any crash strangely.
2014-08-10 00:39:22 +02:00
Nicholas Bishop e123434397 Fix a few typos in carve-capi.h
The typos didn't cause any bug, but the mis-ordered parameter names in CarveExporter_InitGeomArrays were confusing.

Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D709
2014-08-05 10:36:45 -04:00
Jens Verwiebe 5efa7fa534 Fix possible harmful warning: the value of the size argument in 'strncat' is too large, change the argument to be the free space in the destination buffer minus the terminating null byte 2014-08-05 12:03:31 +02:00
Sergey Sharybin b9c8572d71 Fix wrong assert happening in the CUEW 2014-08-05 15:28:59 +06:00
Sergey Sharybin 77b7e1fe9a Deduplicate CUDA and OpenCL wranglers
For now it was mainly about OpenCL wrangler being duplicated
between Cycles and Compositor, but with OpenSubdiv work those
wranglers were gonna to be duplicated just once again.

This commit makes it so Cycles and Compositor uses wranglers
from this repositories:

  - https://github.com/CudaWrangler/cuew
  - https://github.com/OpenCLWrangler/clew

This repositories are based on the wranglers we used before
and they'll be likely continued maintaining by us plus some
more players in the market.

Pretty much straightforward change with some tricks in the
CMake/SCons to make this libs being passed to the linker
after all other libraries in order to make OpenSubdiv linked
against those wranglers in the future.

For those who're worrying about Cycles being less standalone,
it's not truth, it's rather more flexible now and in the future
different wranglers might be used in Cycles. For now it'll
just mean those libs would need to be put into Cycles repository
together with some other libs from Blender such as mikkspace.

This is mainly platform maintenance commit, should not be any
changes to the user space.

Reviewers: juicyfruit, dingto, campbellbarton

Reviewed By: juicyfruit, dingto, campbellbarton

Differential Revision: https://developer.blender.org/D707
2014-08-05 13:57:50 +06:00
Campbell Barton d5b471eec1 CMake: add header 2014-08-02 19:16:00 +10:00
Sergey Sharybin 895f0f3dff Fix crash in cases when first BA step happens with all zero-weighted tracks 2014-07-23 00:46:26 +06:00
Jens Verwiebe 2440b3e158 OSX/scons: Try to get rid of buildproblems with openjpeg enabled in certain build environments and prepend SDK_FLAGS to CFLAGS always 2014-07-06 14:10:41 +02:00
Sergej Reich 81c3fc9726 cloth: Speed up collision detection
Noticed this while looking into something else.
The change is trivial, but gives a rather nice preformance improvement,
so why not.
Theres's actually a lot one can do to improve collision performance if
one wanted to, the triangle-triangle check alone has a lot of room for
improvement.
2014-07-03 21:40:04 +02:00
Campbell Barton 2e840e56cf CMake: correct include dirs 2014-07-01 09:36:28 +10:00
Sergey Sharybin c73505fb43 Get rid of usage of non-existing module 2014-06-27 17:30:17 +06:00
Sergey Sharybin cba3498629 Update Carve to latest upstream version
This brings new copyright header which supports GPL2 and 3.

It wasn't really an issue before because we had agreement with
Tobias, but now it's all documented in sources.
2014-06-27 15:56:50 +06:00
Sergey Sharybin 72ac596e19 Update Ceres to latest upstream version
Brings new bounds limiting and also prepares build system
for the changes in the upstream.

Namely shared_ptr header and namespace is now being detected
by a build system rather than by hacks in the code.

This commit includes some changes to auto-detection flags
in SCons, presumably adding more consistency there. This
is main changes which are suppoed to be reviewed here.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D581
2014-06-27 14:08:27 +06:00
Campbell Barton 4baa2fdcfe Correction to GTest commit (WITH_GTEST=OFF works now) 2014-06-19 04:35:15 +10:00
Sergey Sharybin 72b607ab74 Some WITH_TESTS weer not renamed to WITH_GTEST 2014-06-18 22:28:27 +06:00
Sergey Sharybin 306cbb82ec GTest unit testing framework
Currently covers only small set of functionality.
2014-06-19 02:09:16 +10:00
Sergey Sharybin e53c00a2db Add patchset to recent Carve changes
In the future i'd rather have this reported to an
upstream instead of adding local changes. It's really
easy to override this changes if patchset is not added
and this is to be fixed in upstream. Also the function
was never used so it was rather totally harmless warning
for us.
2014-06-11 13:13:36 +06:00
Jens Verwiebe a6a38de4d6 Fix a warning in carve by initializing var 2014-06-10 20:15:50 +02:00
Sergey Sharybin 05fa464a25 Fix T40551: Boolean Modifier distorts UVs
Mapping to original face was never working 100% reliably actually,
now use more robust method for this.
2014-06-10 19:27:09 +06:00
Sergey Sharybin 8bf7172384 Fix compilation on OSX after previous commit
EXPECT_EQ wasn't defined in the scope.
2014-04-23 19:19:38 +06:00
Sergey Sharybin c605711c6b Libmv cleanup: move aligned malloc implementation into own file
It was rather stupid having it in brute region tracker,
now it is in own file in base library.
2014-04-23 16:03:44 +06:00
Sergey Sharybin 0ff06a9ba5 Libmv: optimization of PearsonProductMomentCorrelation
Pass the arrays by reference rather than by value,
should give some percent of speedup.

Also don't pass the dimensions to the function but
get them from the images themselves.

Hopefully this will give some %% of tracker speedup.
2014-04-21 14:26:37 +06:00
Jens Verwiebe 9c93c0bf08 Bullet: making bullet friction workaround more furureproof by using the __apple_build_version__ macro, TODO: check if problem persists with newer clang 2014-04-19 14:10:49 +02:00
Sergey Sharybin fe3eb82520 Re-bundle Libmv to be sure it's all fine 2014-04-17 23:31:57 +06:00
Sergey Sharybin 5bf7d988ac Fix for 771a9dd: libmv build files are automatically generated
This means if one makes change to either SConscript or CMakeLists.txt
there he MUST update bundle.sh.

Also made it so *.cc files from intern/libmv are matching which would
make it easier to add more .cc files there if needed.

And one more thing is removing 'simple_pipeline/distortion_models.cc'
which doesn't match any of the files.
2014-04-17 22:38:31 +06:00
Jens Verwiebe 771a9dd335 Lbmv: fix scons compile after ed2ddc9 2014-04-17 17:00:29 +02:00
Antony Riakiotakis 87b86eee62 Fix compilation issue. 2014-04-17 15:53:34 +03:00
Sergey Sharybin c4a9ec88c8 Fix crash when enabling undistorted display in MCE 2014-04-17 18:01:45 +06:00
Sergey Sharybin ed2ddc9f70 Support multiple distortion models, including a new division model
This commit makes it so CameraIntrinsics is no longer hardcoded
to use the traditional polynomial radial distortion model. Currently
the distortion code has generic logic which is shared between
different distortion models, but had no other models until now.

This moves everything specific to the polynomial radial distortion
to a subclass PolynomialDistortionCameraIntrinsics(), and adds a
new division distortion model suitable for cameras such as the
GoPro which have much stronger distortion due to their fisheye lens.

This also cleans up the internal API of CameraIntrinsics to make
it easier to understand and reduces old C-style code.

New distortion model is available in the Lens panel of MCE.

- Polynomial is the old well-known model
- Division is the new one which s intended to deal better with huge
  distortion.

Coefficients of this model works independent from each other
and for division model one probably want to have positive values
to have a barrel distortion.
2014-04-17 17:28:41 +06:00
Jens Verwiebe 8a4210074c Bullet: better workaround for failing friction with clang 3.4, remove the obsolete compileflag magic 2014-04-17 00:25:25 +02:00
Campbell Barton b3972aeea0 Math Lib: optimize axis_dominant_v3_to_m3, approx 6x speedup
build the matrix directly rather then calculating with axis/angle

also remove unused function calc_poly_plane
2014-04-16 21:07:28 +10:00
Antony Riakiotakis 7bf62f0c60 ...and linking, sorry for that! 2014-04-10 22:00:54 +03:00
Antony Riakiotakis c0a9397a06 Fix compilation 2014-04-10 21:59:03 +03:00
Sergey Sharybin df63e8fd93 Speedup track preview widget for byte images
This gives a huge speedup gain for cases when you've got
rather huge markers on a byte images.

Done by skipping IMB_float_from_rect()/IMB_rect_from_float()
for such cases. We can sample the buffers without color space
conversion.
2014-04-10 21:14:36 +06:00
Sergey Sharybin ccf9afddba Fix T39608: Blender 2.70 crashes when performing union
This was a nasty bug which was caused by specific of how face-edge
attributes are stored in Carve.

Face pointer is used in the map key which works just fine in all
cases except for the cases when some face is getting freed after
it was stored in the map.

This might give real issues when new face is allocating because
it's possible new face would have the same address as the freed
one.

Such cases used to happen when union of separate manifolds is
needed for the operands AND jemalloc is enabled.

Solved by dropping attributes for the freed faces from the map.
Maybe not the fastest ever approach, but not sure how to make
it faster actually. Should work just fine. It only happens for
complex setups with intersecting manifolds in the operands.
2014-04-09 14:27:34 +06:00
Sergej Reich 6ffabfae85 Fix T39646: Rigid Body Constraints non functional on release builds
-ffast-math is evil, not sure why it was enabled...
I seems to work better on OSX but it's still not a good idea.

The SConscript for bullet is a mess, I don't understand why
we use different flags for different platforms in the first place.
Seems to be a historical artifact but I don't know enough about scons
to try and clean it up.
2014-04-09 01:48:44 +02:00
Campbell Barton 9bbb30bf03 Fix T39245: Crash when dynamic topology is enabled
Redundant decrement was crashing for systems which didnt optimize it out.
2014-04-03 17:13:31 +11:00
Sergey Sharybin f0106d2985 Unbreak carve build for clang
Based on D420
2014-03-28 14:41:04 +06:00
Sergey Sharybin af16d462e3 Fix T39419: Crash when solving camera motion
Stupid vector initialization error.

Should be in 'a'.
2014-03-26 17:47:13 +06:00
Sergey Sharybin cf148edb26 Followup to Ceres changes -- need to update bundling script 2014-03-25 15:08:22 +06:00
Lukas Tönne ddc959691a Fix for own commit: mixed up ceres build defines when replacing cmake
check with a generalized macro.

rBbbfcb0b1e44636b73b8c46f1cb800fa53dda5277
2014-03-25 09:49:39 +01:00
Lukas Tönne bbfcb0b1e4 Build file macro for testing unordered_map C++ container support.
Using unordered_map and unordered_set C++ container types currently
requires careful testing or usage of boost, due to the various confusing
C++ version differences in include paths and namespaces.

Libmv defines tests for these cases in cmake and scons, such that ceres
can use any available implementation, or fall back too std::map/std::set
if none can be found.

This patch generalizes this buildfile code by providing a Blender macro.
* cmake: defines both the variables used by libmv at them moment as well
as 2 variables UNORDERED_MAP_INCLUDE_PREFIX and UNORDERED_MAP_NAMESPACE,
which can later be used in other C++ parts for convenience.
* scons: adds a tool script returning the include prefix and namespace.
Libmv checks these to define the appropriate definitions for ceres.

Differential Revision: https://developer.blender.org/D425
2014-03-25 09:25:00 +01:00
Jens Verwiebe 877706b8eb Cleanup: Restrict the debug -gline-tables-only to cxx_debug in cycles and spelling 2014-03-22 11:33:32 +01:00
Sergey Sharybin 356ec42bda Attempt to fix compilation error with msvc2013 2014-03-21 16:06:30 +06:00
Sergey Sharybin 3411146984 Update Eigen to version 3.2.1
Main purpose of this is to have SparseLU solver which
we can use now as a replacement to opennl library.
2014-03-21 16:04:53 +06:00
Sergey Sharybin dfa5ced30e Follow up to the previous commit
Just update to the changelog
2014-03-20 23:45:29 +06:00
Sergey Sharybin 6ba5c0c268 Update Libmv to latest upstream
This is mainly a maintaince commit which syncs changes
between Blender and Libmv upstream also bringing new
GLog version.

This GLog version is presumably have better support of
MinGW from "the box".

This commit is also aimed to make further 3d part libs
update easier.
2014-03-20 23:26:25 +06:00
Jens Verwiebe 3f89b92823 Ups, forgot to remove something i just placed temporary … 2014-03-19 11:26:41 +01:00
Jens Verwiebe 67f0290382 OSX/bullet/scons: a better workaround for clang 3.4 issues with actual bullet, according cmake ( less speed penalty ) 2014-03-19 11:21:36 +01:00
Jens Verwiebe 5ff0500593 OSX/cmake/bullet: fix ambigoius compiler ID and make deoptimize fix a bit stricter to reduce speed penalty 2014-03-18 12:18:03 +01:00
Sergey Sharybin 94379277dd Fix T39151: Boolean modifier freeze
This re-applied patch from 25cbd13 which was lost at some point
since missing patchset in series.

This revision is to be back-ported to the final release.
2014-03-13 15:40:55 +06:00
Sergey Sharybin 2e128baefd Fix T39111: Boolean assert failure on widows
In fact we had this change a while ago, not sue what happened.
2014-03-12 23:12:34 +06:00
Jens Verwiebe d0ad48fdc9 OSX/bullet: i have to use -O0 again, else weird bullet behaviour comes back.
I overlooked in cmake my fix same time changed the optimization level to 0,
so not use optimization is the real fix ( postponed for after 2.70 ).
I appears we should investigate scons anyway: compileflags does not apply to c and c++ same time as expected.
2014-03-12 13:04:31 +01:00
Sergey Sharybin de86b7097f Fix T39104: 2 clothes on a collision object cause crash
This was caused by static variables used in plNearestPoints().

For now solved by making the solvers allocated in the stack,
seems no noticeable affect on the simulation speed so far.
2014-03-12 14:48:47 +06:00
Jens Verwiebe 09b2531bb3 OSX/bullet: add -O2 to bt_cxx_flags, in cmake thats default, in scons CXXFLAGS start empty also in “Release” 2014-03-11 18:32:22 +01:00
Campbell Barton 6e9ee13de0 CMake: add fastmath for gcc release flags (OSX had already) 2014-03-12 03:39:12 +11:00
Jens Verwiebe 4e3f27032e OSX/bullet: do a last fix for scons. Now in both buildsystems the used flags are in sync for OSX 2014-03-11 17:34:31 +01:00
Jens Verwiebe ce37400c0b OSX/cmake: tentative fix for T38746, conflictting flags somewhere 2014-03-11 15:56:50 +01:00
Jens Verwiebe 558fa43ffd OSX/bullet: Truely fix T38746 now, compile flags where not propagated right,
also remove gcc 4.6 workaround, i don’t think its needed any longer.
!!! pls check if this would be right thing todo for othere OS too !!!
2014-03-11 13:27:06 +01:00
Jens Verwiebe ac0cdec90f OSX/clang3.4: tentative fix for T38746, strange bullet behaviour 2014-03-10 18:09:53 +01:00
Sergey Sharybin a659d73b1d Added back code which was commented out for debug reasons
Also added a patchset for Carve's memory leak fix.
2014-03-05 14:52:00 +06:00
Sergey Sharybin ef40e889ca Fix compilation error windows 2014-03-04 20:37:19 +06:00
Sergey Sharybin 34c7fd1a11 Fix T38918: Boolean modifier crashes when using specific topology
There were loads of issues in the code still which are mow likely fixed:

- Hole resolver hook had memory leak -- it didn't free face with holes
  when triangulating it.

- Original edge mapping didn't work correct. old code related on the fact
  that loop order is not changing when constructing the MeshSet class, but
  in fact it does change.

  Currently used edge map for this because it was easiest way to do it now,
  but after the release we're to change it. Main reason is that face mapping
  is not correct as well (and it was never correct actually). So we'll need
  to construct Mesh structures by our own to be sure we're using correct
  original index mapping.

- Carve might produce faces with ears, which is forbidden in Blender.
  it wasn't an issue in old integration because triangulation will remove
  the ears. So for now simply added ears removing back as a hook.

  But actual reason of the ears is to be investigated really.

  This hook will only work for NGons, quads are assumed not be able to
  have ears. So this additional hook shouldn't slow down things much.

- Carve's hole resolver produces duplicated faces in some cases. Still not
  sure what is the reason of this. Code here is not so much straightforward,
  this is to be investigated later.

  For now solved the issue as own hole resolver which checks for duplicated
  faces after the hole resolving.

  The additional checks here will only run if the mesh actually have hole
  and wouldn't introduce slowdown for faces which doesn't have holes.

- Made it so if edge user triangulation gets a split (for example, in cases
  when this edge intersects with the second operand) it wouldn't be dissolved.

  This prevents cases of crappy topology after dissolving in several cases.

- Edge dissolver didn't check for whether edge is a non-manifold. We couldn't
  really dissolve open manifold edges.

  The bad thing about this is that mesh triangulation might produce non-manifold
  edges and they wouldn't be dissolved. Not worst case in the world, but would
  be nice to have it solved somehow.

- Exporting mesh form Carve to Blender might have produced duplicated edges
  in cases when several non-manifold faces shared the edge. This is also fixed
  now.

- Mesh triangulation might have produced duplicated faces, which is really bad.
  Fixed by keeping a track on which faces we've created and skipping adding new
  triangle if we already have one.

This all might introduce some slowdown, but we're too close to the release now,
so would rather have it slower but robust. After the release we might look into
ways to speed things up.
2014-03-04 20:18:16 +06:00
Sergey Sharybin 6e970e1a33 Update patch for mesh_simplifier 2014-02-28 19:09:22 +06:00
Sergey Sharybin 8badec14f9 Implement separate BA step for tracks which have constant zero weight
This is needed to minimize their reprojection error over the footage.
Without this extra step positions of such tracks were calculated by
algebraic intersection code only, which doesn't give best precision.
2014-02-27 16:14:35 +06:00
Sergey Sharybin 00acb98436 Fix T38844: Crash if weight track = 0
Avoid zero-sized problem when doing euclidean intersection

Zero-sized problem might occur when intersecting track with
constant zero weight. For such tracks we'll just use result
of algebraic intersection.

TODO: We probably need to have a separate BA step to adjust
positions of tracks with constant zero weight.
2014-02-27 14:31:09 +06:00
Sergey Sharybin 8a5221750e Ignore zero weighted markers in keyframe selection
It doesn't make sense to use zero-weighted tracks as a correspondences
in keyframe selection.

Such tracks are not guaranteed to be tracked accurately because their
purpose is to add reference points in 3D space without affecting the
solution.
2014-02-26 17:56:10 +06:00
Sergey Sharybin dbf653acb7 Disable eager-refinement step of region tracking
This gives much worse results on mango footage (see 04_2e)
so disabling for now for until proper prediction model is landed.

The thing is, currently blender sends input coordinates as the guess to
region tracker and in case of fast motion such an early out ruins the track.
2014-02-25 16:55:24 +06:00
Tamito Kajiyama 036d35dd24 Fix for MSVC 2008 compiler errors. 2014-02-25 01:16:52 +09:00
Sergey Sharybin cefa733803 Followup for 90a86fe: libmv/ceres cmake/scons files are automatically generated
So don't forget to update generator scripts as well.
2014-02-24 20:13:33 +06:00
Sergey Sharybin 9643b2e5b5 Preserve non-flat faces in boolean modifier
This commit implements dissolving of edges which were used
to triangulate non-flat faces. This slows things down a bit
(around 5% on heave mesh with all faces triangulated).

We could improve speed of dissolve a bit here (so not a bell
to add an option for triangulation yet).

Also fixed wrong edge origindex mapping.
2014-02-24 18:10:33 +06:00
Brecht Van Lommel 90a86fecee Fix T38684: cmake OS X build problem when changing deployment target.
Don't cache these variables as they are not cleared on such changes.
2014-02-18 19:38:43 +01:00
Sergey Sharybin 97b90d89f4 Fix T38637: Boolean produces faces with holes which isn't supported by BMesh
Simple fix -- use CarveHoleResolver hook for CSG which will split faces
containing holes.
2014-02-18 11:53:04 +06:00
Sergey Sharybin 7fb7ce789f Fix T38631: Blender crashes when selection faces after new boolean modifier
Own mistake in edges carve->blender export, didn't count them correct.
2014-02-14 14:26:26 +06:00
Jens Verwiebe 9185ab5d9c Fix scons compiling after carve changes 2014-02-13 23:21:13 +01:00
Sergey Sharybin 6a65161966 fixed an for loop variable type and delete operator in cave-utils.cc
Patch by wutzi (Benedikt Bergenthal), thanks!

Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D314
2014-02-13 20:09:51 +06:00
Sergey Sharybin 83617d24d5 Rework carve integration into boolean modifier
Goal of this commit is to support NGons for boolean modifier
(currently mesh is being tessellated before performing boolean
operation) and also solve the limitation of loosing edge custom
data layers after boolean operation is performed.

Main idea is to make it so boolean modifier uses Carve library
directly via it's C-API, avoiding BSP intermediate level which
was doubling amount of memory needed for the operation and which
also used quite reasonable amount of overhead time.

Perhaps memory usage and CPU usage are the same after all the
features are implemented but we've got support now:

- ORIGINDEX for all the geometry
- Interpolation of edge custom data (seams, crease)
- NGons support

Triangulation rule is changed now as well, so now non-flat
polygons are not being merged back after Carve work. This is
so because it's not so trivial to support for NGons and
having different behavior for quads and NGons is even more
creepy.

Reviewers: lukastoenne, campbellbarton

Differential Revision: https://developer.blender.org/D274
2014-02-13 17:16:53 +06:00
Sergey Sharybin 5cbddd4ca4 Bye-bye FAST!
FAST detector has been replaced with fancier Harris,
so no need to keep FAST library in the sources now.
2014-02-06 18:13:12 +06:00
Sergey Sharybin 9896508e14 Fix compilation error with msvc2012 and 2013 as well 2014-01-31 15:33:48 +06:00
Sergey Sharybin df471369e2 Bundle latest Libmv from upstream
Currently no functional changes, but we might want
to have scoped_array in the future.
2014-01-28 18:36:32 +06:00
Sergey Sharybin be6643b5ec Followup to the previous commit
Need to take weight into account when drawing per-frame track
reprojection curve and when computing per-track average error.
2014-01-28 18:02:22 +06:00
Sergey Sharybin 59d1387c41 Improvements to weighted tracks behavior
First thing changed by this commit is making it so
Euclidean intersection takes track weight into account
when solving minimization problem. This behaves the
same exact way as it is for BA step.

Second thing is related on how average reprojection error
is being calculated. It didn't take track weight into
account which could confuse users. Now average reprojection
error will give the same result as intersection/BA uses
during minimization which gives much more predictable
behavior.

Differential Revision: https://developer.blender.org/D265
2014-01-28 17:25:47 +06:00
Sergey Sharybin 1c0cdc385f Fixes for keyframe selection
Using tracks with constant zero weight used to crash
keyframe selection since it was trying to use missing
parameter blocks for Jacobian evaluation,

Also fixed possible issues with wrong camera block being
marked as variable. This could technically happen when
having zero weighted tracks. Made it so all camera blocks
are marked as variable for now.
2014-01-28 16:54:50 +06:00
Sergey Sharybin 9178dc9d38 Rework detector API and implement Harris detector
Switch the detector API to a single function which accepts
a float image and detector options. This makes usage of
feature detection more unified across different algorithms.

Options structure is pretty much straightforward and contains
detector to be used and all the detector-specific settings.

Also implemented Harris feature detection algorithm which
is not as fast as FAST one but is expected to detect more
robust feature points. It is also likely that less features
are detected, but better quality than quantity.

Blender will now use Harris detector by default, later we'll
remove FAST detector.
2014-01-28 15:37:19 +06:00
Sergey Sharybin 3d408e10a4 Correct typo in the patch file as well 2014-01-28 02:16:44 +06:00
Thomas Dinges 8870556def Fix compilation on Windows, syntax error. 2014-01-27 20:53:42 +01:00
Sergey Sharybin efaadc3104 Attempt to fix compilation error with MSVC-2008 2014-01-28 01:37:41 +06:00
Sergey Sharybin 31d679b667 Update Carve to latest update
Fixes some issues with NaN vertices in special cases.
Also adds edge interpolation routines which are currently
unused but which are requires to implement edge CD interpolation.
2014-01-27 17:04:06 +06:00
Sergey Sharybin ef67b9eec4 Ceres: more warnings cleanup 2014-01-14 01:18:09 +06:00
Sergey Sharybin a6ceb4a498 Re-bundle new Ceres library
- Fixes some harmless issues (in cases blender doesn't use Ceres yet)
- Fixes some compilation warnings
2014-01-13 19:17:28 +06:00
Sergey Sharybin 113ff51476 Compilation error fix for NetBSD
Based on the patch from Joerg Sonnenberger.
2014-01-09 16:15:24 +06:00
Sergey Sharybin 2d8545f87e Fix compilation error on NetBSD
Original patch is by Jeorg Sonnenberger, thanks!
2014-01-09 16:03:02 +06:00
Sergey Sharybin f9353b8e8d Code cleanup: remove patch series from libmv
Since we're using own libmv branch from git.blender.org
we don't need to have local patches for libmv in blender
source tree.
2014-01-02 15:24:46 +06:00
Sergey Sharybin f9e0ac4ced Code and style cleanup
Mainly fixed some style warnings reported by cpplint.

Also changed how camera (un)distortion happens internally
by replacing number of channels as a template argument
with number as channels passing as function argument.
Makes code easier to follow by eliminating loads checks
how much channels are used and which argument to pass to
the template.
2014-01-02 15:24:46 +06:00
Sergey Sharybin 5d701c6d25 Re-bundle libmv from new upstream repository
No functional changes, just to make sure all the patches
are ported nicely and that update scripts works fine.
2014-01-01 22:32:48 +06:00
Sergey Sharybin 5933b2455c Update Ceres to the latest upstream
Summary:
This brings up much easier termination type usage,
which for us means we might use:

  ceres::Summary::IsSolutionUsable()

instead of doing manual funky enum values check.

Reviewers: keir

Differential Revision: https://developer.blender.org/D153
2014-01-01 22:32:47 +06:00
Sergej Reich 05eebf49d3 Bullet: Update to svn r2719
Fixes part of T37905, fixed constraint didn't work correctly.
2013-12-26 12:45:57 +01:00
Campbell Barton a7ac6481ef CMake: report messages as status (else ccmake treats like an error) 2013-12-10 13:18:46 +11:00
Alexandr Kuznetsov e2429d6492 Woo Hoo. First git commit.
Changes for VC2013

Now, I can build Blender with VC2013 with Cycles, Collada, OpenExr,OpenImageIO disabled. Also, you need VC2008 sp1 installed to make old libs compatible.
2013-11-29 15:13:12 -05:00
Sergey Sharybin 28a2d5e264 Code cleanup: spelling fixes and verbosity prints 2013-11-29 01:46:08 +06:00
Sergey Sharybin b7bca8663a Made collections port compatible with MSVC2008
The issue was caused by the fact that in this version
of MSVC unordered_map class is defined in <unordered_map>
header file, but this file declares the class int std::tr1
namespace.

This confused existing assumption that if there's an
existing <unordered_map> file then class is declared
in std namespace.

Added an extra check to CMake which detects whether
it's std or std::tr1 which actually contains class
of unordered_map.

This might be changed/cleaned in the future, for
now committing to our repository to solve compilation
error on windows.

Details of the patch in upstream can be found there:

  https://ceres-solver-review.googlesource.com/#/c/4371/
2013-11-28 23:28:11 +06:00
Sergey Sharybin de6c1c9287 Update Ceres to latest upstream version
- A richer Problem API.
- DynamicNumericDiffCostFunction.
- Faster ITERATIVE_SCHUR solver.
- Faster SCHUR_JACOBI preconditioner.
- Faster Jacobian evaluation.
- Faster visibility based preconditioning using single linkage clustering.

Also re-wrote rules for unordered collections detection,
should work on all platforms and compilers now :)
2013-11-28 19:46:23 +06:00
Sergey Sharybin dc71cb5f6e Fix Carve compilation on FreeBSD
Based on the patch from Marcus von Appen, thanks!
2013-11-28 14:00:10 +06:00
Sergey Sharybin a628ca9ebe Update Carve to upstream version be054bc7ed86 2013-11-28 14:00:10 +06:00
Sergey Sharybin 1c14ead46f Carve bundler script cleanup
- random.hpp was only removed from actual include
  directory, but not from patches/files.

- Files list generator didn't ignore config.h file
  which in fact is not needed.
2013-11-28 14:00:10 +06:00
Sergey Sharybin 1de23f6c0d Tweaks and improvements to fundamental/homography estimation
- A bit more reasonable name for the estimation option
  structure and estimation functions.

- Get rid of unclear function and parameter tolerance,
  it wasn't clear at all in which units they are.

  Now we've got expected_average_symmetric_distance as
  an early output check and as soon as average symmetric
  error goes below this threshold refining finishes.

  This distance is measured in the same units as input
  points are.

  It is arguable whether we need callback for this or not,
  but seems Ceres doesn't have some kind of absolute
  threshold for function value and function_tolerance
  behaves different from logic behind expected symmetric
  error.

- Added option to normalize correspondences before
  estimating the homography in order to increase estimation
  stability. See

    R. Hartley and A. Zisserman. Multiple View Geometry in Computer
    Vision. Cambridge University Press, second edition, 2003.

    https://www.cs.ubc.ca/grads/resources/thesis/May09/Dubrofsky_Elan.pdf
2013-11-20 15:30:28 +06:00