Commit Graph

2509 Commits

Author SHA1 Message Date
Campbell Barton
30dab51c29 Cleanup: use bool and const args 2014-10-09 22:44:03 +02:00
Antony Riakiotakis
5f6e47e767 Minor cleanup.
* Use pie direction, not draw type for pie item collision
* Strict function definitions.
* Initialize random array with system time
2014-10-09 17:12:32 +02:00
Antony Riakiotakis
016e75ad64 Fix T42139, vertical noise stripe patterns in noise texture.
Two fixes here (only the second one is strictly needed to fix the issue,
but both make the system better).

First is introduction of a random generator array for use with threaded
systems where each thread needs to access its own number generator.
The random texture now uses this so it should not be influenced by other
random generator reseedings of the main random generator like it did
before.

Second, I reshuffled the texture code to resample the upper bits of the
random number first. According to Numerical Recipes, this is where the
most variance can be found, so by sampling those we avoid correlation
issues. Also, multiplying here is not ideal because if a pair of bits
are zero, then the whole result will also be zero.

Overall this is much more random (tm) than before, however result will
also be brighter, since we now have less black spots. Tweaking the
brightness/contrast should somewhat fix that, generally having the same
result as before is not possible anyway if we are to really fix this.

Also, seems like exposing procedural depth might be nice here since it
influences the precision of the texture lookup.
2014-10-09 15:48:52 +02:00
Campbell Barton
15af15eb56 BLI_buffer: simplify buffer resize 2014-10-05 10:33:02 +02:00
Kévin Dietrich
570313d519 Blend modes: fix array length being too short
Reviewers: psy-fi

Differential Revision: https://developer.blender.org/D799
2014-09-30 10:48:57 +02:00
Campbell Barton
fa1e6c5442 Fix T41986: polyfill fails with axis aligned verts 2014-09-28 21:11:16 +10:00
Campbell Barton
4a92620d3e Comments: clarify math lib 2014-09-28 15:08:55 +10:00
Campbell Barton
a4c3b92294 BLI_Stack add BLI_stack_peek, BLI_stack_discard
also remove own incorrect assert
2014-09-28 15:08:54 +10:00
Bastien Montagne
a2386b3e20 Fix previous commit rB34abb614f1344a6, which broke addons translations.
Ghash comp callbacks must return false in case a & b are equal!

Also slightly cleaned up gash code using those comp func,
since those return booleans now, let's compare tham against booleans!
2014-09-25 14:33:19 +02:00
Campbell Barton
6f2f80887b GHash: use bool for comparison (simplify compare) 2014-09-25 06:16:37 +10:00
Campbell Barton
059e0dafb4 Cleanup: const correctness for BLI_sortlist 2014-09-24 14:55:02 +10:00
Campbell Barton
3a40aed3d5 Cleanup: use float versions of functions when in/output are floats 2014-09-24 14:55:02 +10:00
Campbell Barton
e7f495d8a0 Cleanup: bool 2014-09-24 14:55:01 +10:00
Campbell Barton
f6db580041 Fix T41891: Alt+S can't save image
win32 BLI_path_abs expanded empty strings into "C:\\",
which made BLI_exists succeed (quite confusing).

Now match behavior on *nix.
2014-09-22 14:46:03 +10:00
Campbell Barton
aba5fc29d5 Math Lib: use higher precision for vector printing
Only use for debugging, where precision is often important.
2014-09-17 00:33:38 +10:00
Campbell Barton
775a54485b Math Lib: add mul_v3_project_m4_v3 2014-09-16 15:41:17 +10:00
Campbell Barton
106ea0b20b Cleanup: sync map_to_sphere, UNLIKELY xy zero case 2014-09-16 12:41:16 +10:00
Campbell Barton
a319469260 Correct last commit 2014-09-14 17:42:33 +10:00
Campbell Barton
432d274990 Cleanup & typo in assignment 2014-09-14 17:27:31 +10:00
Campbell Barton
bae66459df Fix crash in BLI_kdtree_range_search
Called memcpy with a NULL pointer,
causing the following NULL check to get optimized away.
2014-09-11 12:47:52 +10:00
Campbell Barton
671f75a12a Math Lib: Add copy_m2_m2, unit_m2, zero_m2 2014-09-06 11:29:27 +10:00
Campbell Barton
15d39eaac1 Write Compressed blend files directly
Writing compressed files would write the uncompressed blend, then re-compress on-disk.

Use a wrapper for open/write/close commands
2014-09-04 21:54:24 +10:00
Sergey Sharybin
cb7d430c19 Fix for blender.exe -r being registering blender-app.exe 2014-08-29 17:36:59 +06:00
Campbell Barton
167182613d Remove redundant casts 2014-08-29 16:16:28 +10:00
Campbell Barton
8a215669e8 Cleanup 2014-08-29 15:35:19 +10:00
Antony Riakiotakis
7d5c16c085 Add a reusable dial mechanism to get rotations around a center and an
initial position. The system supports arbitrarily big angles.
2014-08-27 17:29:15 +02:00
Campbell Barton
e71f2fc3ba Cleanup 2014-08-27 09:52:24 +10:00
Campbell Barton
1987548a33 BLI_kdopbvh: ifdef unused 'skip' member
Saves memory and speeds up balance
2014-08-25 11:28:50 +10:00
Campbell Barton
151800662f Smallhash: BLI_smallhash_calc_quality
Also add inline hashing function to measure different methods.
2014-08-23 21:18:11 +10:00
Campbell Barton
4b4ae8374f Cleanup: style 2014-08-20 08:47:32 +10:00
Sergey Sharybin
afa3469288 De-duplicate EWA filter code between renderer and compositor
The title says it all, move the EWA filter to BLI (currently it's
math_interp.c) and use the function from both BI renderer and the
compositor.

This makes more central place of the algorithm, allowing to have
fixes and optimizaitons synchronized across the two usages.

This also fixes T41440: Displacement in compositing creates holes

Reviewers: campbellbarton, lukastoenne

Reviewed By: lukastoenne

Maniphest Tasks: T41440

Differential Revision: https://developer.blender.org/D748
2014-08-18 19:38:15 +06:00
Campbell Barton
ed26d9dd90 BLI_array: utility function for searching an array 2014-08-17 16:02:20 +10:00
Campbell Barton
1dd17bed4a Knife tool: simplify hit-depth calculation 2014-08-17 12:50:48 +10:00
Campbell Barton
bba80ed7af Cleanup 2014-08-17 12:18:40 +10:00
Campbell Barton
f789d0b606 Math Lib: replace epsilon with check against zero
line-tri intersection depended on scale, The check made small triangles & lines fail.
So just check for divide by zero as ray-cast currently does.
2014-08-17 08:42:08 +10:00
Campbell Barton
c47a01da11 Math Lib: add isect_line_line_epsilon_v3 2014-08-16 15:13:11 +10:00
Campbell Barton
36cbdb860a Cleanup: comment & var name 2014-08-15 14:22:34 +10:00
Campbell Barton
ff42afb6c5 Math Lib: rename barycentric_transform -> transform_point_by_tri_v3
also add transform_point_by_seg_v3
2014-08-13 14:55:45 +10:00
Campbell Barton
3529913629 Math Lib: name signed versions of dist_to_plane_v3 explicitly
also add unsigned versions
2014-08-13 14:34:58 +10:00
Campbell Barton
eadfddd02a Cleanup: magic numbers 2014-08-12 15:58:53 +10:00
Campbell Barton
6be4b39526 GHash: add flag get/set for gset 2014-08-12 13:29:40 +10:00
Campbell Barton
eedc3834fe Comments 2014-08-11 13:36:35 +10:00
Thomas Dinges
e3ed13cbd4 Cleanup: Remove special code for Visual Studio 2008.
Goodbye VC2008, it has been a pleasure (more or less) :D SCons / CMake cleaenup will follow.
Differential Revision: https://developer.blender.org/D715
2014-08-07 13:52:15 +02:00
Campbell Barton
0b6412607f Comments 2014-08-07 14:42:47 +10:00
Campbell Barton
1b6864752f GHash/EdgeHash: avoid NULL check on iterator init 2014-08-07 11:19:55 +10:00
Nicholas Bishop
1c8ac33970 Fix incorrect comments in listbase, add unit test to verify change
Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D708
2014-08-05 10:33:24 -04:00
Bastien Montagne
3c9e11df37 Cleanup: Move SpaceTransform helpers from BKE_shrinkwrap to BLI_math_matrix. 2014-08-01 16:31:06 +02:00
gaiaclary
0d1484e4ad Make function definition consistent with function declaration (as discussed with campbell) 2014-08-01 14:32:04 +02:00
Jens Verwiebe
a4c287ed7d OSX/scons: Change Blender bundle datastructures + referennces to match the upcoming codesigning needs
- i used deprecated rules up to now which will break in OSX > 10.9.5 and 10.10 > dp4
- todo: adapt cmake due it will break with this commit
2014-08-01 00:57:17 +02:00
Campbell Barton
099038a6f9 BLI_path_utils: rename BLI_clean -> BLI_path_native_slash 2014-07-31 01:40:47 +10:00