Commit Graph

53 Commits

Author SHA1 Message Date
Harley Acheson 3a7fd309fc Spelling: It's Versus Its
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required.

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

Reviewed by Campbell Barton
2020-10-19 08:12:33 -07:00
Dalai Felinto 2d1cce8331 Cleanup: `make format` after SortedIncludes change 2020-03-19 09:33:58 +01:00
Brecht Van Lommel a075f45526 Fix more undefined behavior in tangent space computation
Ref D6677
2020-01-31 12:56:20 +01:00
Simon G c8103efbe3 Fix undefined behavior in tangent space computation
Use an improved implementation for circular shift.

Differential Revision: https://developer.blender.org/D6677
2020-01-27 18:00:34 +01:00
Campbell Barton 93e8c962fc Cleanup: unused structs, struct members 2019-10-03 07:39:45 +10:00
Campbell Barton 649e5fb955 Cleanup: comments (long lines) in mikktspace 2019-05-01 20:41:33 +10:00
Campbell Barton 108045faa0 ClangFormat: format '#if 0' code in intern/ 2019-04-17 08:17:13 +02:00
Campbell Barton e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
Campbell Barton 47adab4f99 CMake: prepare for BLENDER_SORTED_LIBS removal
No functional change, this adds LIB definition and args to cmake files.
Without this it's difficult to migrate away from 'BLENDER_SORTED_LIBS'
since there are many platforms/configurations that could break when
changing linking order.

Manually add and enable WITHOUT_SORTED_LIBS to try building
without sorted libs (currently fails since all variables are empty).
This check will eventually be removed.

See T46725.
2019-04-14 15:37:24 +02:00
Campbell Barton de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
Campbell Barton eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
Campbell Barton ab5e69e660 Cleanup: remove contributors for CMake files
Following removal from C source code.

See: 8c68ed6df1
2019-02-05 09:10:32 +11:00
Campbell Barton b372766816 Cleanup: trailing newlines 2018-06-29 09:23:51 +02:00
Campbell Barton e7a68ef843 Cleanup: trailing space in CMake files 2018-06-17 20:15:24 +02:00
Lukas Stockner 119846a6bb Mikktspace: Speed up the merging of identical vertices
Previously, Mikktspace just bucketed the vertices based on one spatial coordinate and then ran full pairwise comparisons inside each bucket.
However, since models are three-dimensional, the bucketing has a massive false-positive rate, and since pairwise comparison is O(n^2), the merging process is very slow.

But, since we only care about exactly identical vertices, there is a much more efficient approach - we can just hash all values belonging to each vertex and form buckets based on the hash.
Since the hash has 32 bits and considers all values, false-positives are very unlikely - and since both hashing and the radixsort that's used for bucketing are O(n), both asymptotical and
real-world performance (as well as code complexity) are significantly improved.
2017-11-17 18:34:53 +01:00
Sergey Sharybin 3241905f40 Fix T52818: Tangent space calculation is really slow for high-density mesh with degenerated topology
Now we replace O(N^2) computational complexity with O(N) extra memory penalty.
Memory is much cheaper than CPU time. Keep in mind, memory penalty is like
4 megabytes per 1M vertices.
2017-09-19 17:50:09 +05:00
Sergey Sharybin 2dab6f499c Mikkspace: Cleanup, reduce indentation level 2017-09-19 17:50:09 +05:00
Sergey Sharybin 5121dacf9d Fix for fix (tm): Residue of the debug code 2017-08-25 21:33:44 +02:00
Sergey Sharybin 90110d3732 Fix mistake in previous tangent space optimization 2017-08-25 21:30:20 +02:00
Sergey Sharybin d79fa8dc4d Another optimization of tangent space calculation
Don't use quick sort for small arrays, bubble sort works way faster for small
arrays due to cache coherency. This is what qsort() from libc is doing actually.
We can also experiment unrolling some extra small arrays, for example 3 and 4
element arrays.

This reduces tangent space calculation for dragon from 3.1sec to 2.9sec.
2017-08-25 14:54:44 +02:00
Sergey Sharybin 49717d4971 Optimize tangent space calculation by inlining functions
Brings tangent space calculation from 4.6sec to 3.1sec for dragon model in BI.
Cycles is also somewhat faster, but it has other bottlenecks.

Funny thing, using simple `static inline` already gives a lot of speedup here.
That's just answering question whether it's OK to leave decision on what to
inline up to a compiler..
2017-08-25 14:50:04 +02:00
Campbell Barton ba98f06acc mikktspace: minor optimization
Add a safe version of normalize since all uses of normalize
did zero length checks, move this into a function.

Also avoid unnecessary conversion.

Gives minor speedup here (approx 3-5%).
2017-08-03 07:03:59 +10:00
Brecht Van Lommel 5a0f397eaa Fix T49523: very slow normal map tangent computation for rendering in 2.78. 2016-10-06 03:12:04 +02:00
Brecht Van Lommel 0552d5820b Fix T49384: crash in tangent space calculation with NaN mesh vertices. 2016-09-18 13:38:20 +02:00
Campbell Barton b10e3cc997 Cleanup: warning 2016-03-13 15:15:38 +11: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
Campbell Barton 4fe413a419 CMake: use -Wshadow warning for C source
C source now builds without shadowing, enable with GCC by default.
2015-11-23 17:43:55 +11:00
Campbell Barton c1c26c36f6 Style Cleanup: remove preprocessor indentation (updated wiki style guide too) 2013-12-22 14:12:19 +11:00
Campbell Barton 0392acc607 fix [#36685] crash calculating tangent space data on degenerate geometry
the error was that the range check was done on the float before converting to an int.
now convert to and int first and ensure a valid range on that.
2013-09-09 09:33:34 +00:00
Campbell Barton 4f29aeeff2 code cleanup: some structs were declaring data when only typedef's were intended, make local vars and functions static. 2013-08-07 03:44:05 +00:00
Bastien Montagne ab2c273b12 Added GPL header to sconscripts!
Also changed shebang to '#!/usr/bin/env python', this is more portable across unixes...
2012-12-17 08:01:43 +00:00
Campbell Barton 25c96bc9f3 code cleanup: remove unused macros, commet some which may be useful later - or good to keep for completeness. quieted some warnings and add flags -Wmissing-include-dirs and -Wno-div-by-zero to cmake/gcc 2012-09-20 01:02:39 +00:00
Campbell Barton e75f5c8208 quiet -Wmissing-prototypes warnings, and enable this warning by default for C with gcc.
helps for finding unused functions and making functions static, also did some minor code cleanup.
2012-09-15 01:52:28 +00:00
Campbell Barton d5032657ed style cleanup 2012-06-06 22:38:39 +00:00
Campbell Barton 5189356d58 style cleanup 2012-06-04 20:11:09 +00:00
Campbell Barton b340f930ec style cleanup: changes to brace placement / newlines - for/while/if/switch 2012-04-28 06:31:57 +00:00
Brecht Van Lommel 4d7c44717a Code cleanup: fix some clang static checker warnings. 2011-12-22 20:29:44 +00:00
Campbell Barton 4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Campbell Barton 38221fa8e6 set mikktspace functions as static which are not used externally. 2011-10-06 11:40:49 +00:00
Campbell Barton 2d8c1e60e6 print an error message if Python.h can't be found for cmake and scons since its such a common problem. 2011-07-16 06:55:45 +00:00
Campbell Barton 09da9d4393 cmake maintenance
blender_add_lib now takes a separate include argument to suppress warnings in system includes (mostly ffmpeg & python).
also only build wm_apple.c on apple+carbon configuration.
2011-05-31 01:15:44 +00:00
Campbell Barton 6e5ce953da use 'is None' rather then '== None' as suggested by python docs & mis-spelling. 2011-03-29 04:16:55 +00:00
Campbell Barton 9b9c4184c8 misc nodes & editors: floats were being implicitly promoted to doubles, adjust to use floats.
+ minor update to demo_mode
2011-03-28 17:08:33 +00:00
Campbell Barton e9005b985e remove some redundant vars, assignments & checks. 2011-03-19 05:06:06 +00:00
Nathan Letwory ed8719bd1f Apply a small patch from mikktspace author Morten Mikkelsen (cosmetic changes). 2011-03-08 20:39:32 +00:00
Nathan Letwory f5419aec80 doxygen: intern/mikktspace tagged. 2011-02-25 11:47:49 +00:00
Campbell Barton c14aca0e95 add includes to cmake files 2011-02-21 12:18:34 +00:00
Guillermo S. Romero 456ca98564 malloc() comes from stdlib.h per K&R ANSI C, C89 & C99.
If some plataform really needs malloc.h, that is the exception to get #ifdef.
2011-02-17 21:14:54 +00:00
Campbell Barton 538d9180d3 apply fix [#26117] Recent changes to "mikktspace.c" broke building on FreeBSD. Patch attached.
also check for NetBSD.

note: we probably should use define HAVE_MALLOC_H, seems common for other projects.
2011-02-17 08:35:15 +00:00
M.G. Kishalmi b7d349e09c The modifications in mkktspace broke compilation on gcc 4.2.x
This is a patch proposed by sparky_ on irc.
2011-02-16 08:49:27 +00:00