Commit Graph

956 Commits

Author SHA1 Message Date
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