Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-03-13Cleanup: doxygen commentsCampbell Barton
2018-03-01Refactor: Merge non-functional-change part of 'edit normals' 2017 GSoC.Bastien Montagne
This merges changes in internals, runtime-only of existing custom normals code, which make sense as of themselves, and will make diff of soc branch easier/lighter to review. In the details, it mostly changes two things: * Now, smooth fans (aka MLoopNorSpaceArray) can store either loop indices, or pointers to BMLoop themselves. This makes sense since in BMesh, it's relatively easy to get index from a BMElement, but nearly impracticable to go the other way around. * First change enforces another, now we cannot rely anymore on `loops` being NULL in MLoopNorSpace to detect single-loop fans, so we instead store that info in a new flag. Again, these are expected to be totally non-functional changes.
2018-02-22Cleanup: Fix const pointers mess in previous commit.Bastien Montagne
2018-02-22Fix (unreported) meshes changing shading when creating empty clnors data.Bastien Montagne
When you were using autosmooth to generate some custom normals, and created empty custom loop normal data, you would go back to an 'all smooth' shading, cancelling some sharp edges generated by the mesh's smooth threshold. Now we will first tag such edges as sharp, such that shading remains the same. This is not crucial in current master, but it is for clnors editing gsoc branch!
2018-02-22Cleanup: clnor code: more 'do not use same varname for two different things'.Bastien Montagne
2018-02-20Cleanup: split normals: use different varnames for angle and its cosine.Bastien Montagne
Using same name for two different things is not the best idea ever...
2018-02-18Cleanup: add 2d suffix to BLI filesCampbell Barton
Some of these API's can have 3D versions, explicitly name them 2D.
2018-02-08Mesh: concave quad supportCampbell Barton
Previously quads always split along first-third vertices. This is still the default, to avoid flickering with animated deformation however concave quads that would create two opposing triangles now use second-fourth split. Reported as T53999 although this issue has been known limitation for a long time.
2018-01-31Fix possible concurency issue in mesh normals computation.Bastien Montagne
Failure in own code from last December, thanks @sergey for finding it. To be backported to 2.79a.
2018-01-18Fix buffer overflow vulnerabilities in mesh code.Brecht Van Lommel
Solves these security issues from T52924: CVE-2017-12081 CVE-2017-12082 CVE-2017-12086 CVE-2017-12099 CVE-2017-12100 CVE-2017-12101 CVE-2017-12105 While the specific overflow issue may be fixed, loading the repro .blend files may still crash because they are incomplete and corrupt. The way they crash may be impossible to exploit, but this is difficult to prove. Differential Revision: https://developer.blender.org/D3002
2018-01-11Mesh evaluate: Tweak threadability criteriaSergey Sharybin
Gives measurable speedup on layout scenes from Spring. Actual value for chunk size is a subject for more scientific research.
2018-01-10Task scheduler: Use restrict pointer qualifierSergey Sharybin
Those pointers are never to be aliased, so let's be explicit about this and hope compiler does save some CPU ticks.
2018-01-09Task scheduler: Use single parallel range function with more flexible functionSergey Sharybin
Now all the fine-tuning is happening using parallel range settings structure, which avoid passing long lists of arguments, allows extend fine-tuning further, avoid having lots of various functions which basically does the same thing.
2018-01-09Task scheduler: Get rid of extended version of parallel range callbackSergey Sharybin
Wrap all arguments into TLS type of argument. Avoids some branching and also makes it easier to extend things in the future.
2017-12-23Fix scalability issue in threaded code of Mesh normals computation.Bastien Montagne
We tried to do as much as possible in a single threaded callback, which lead to using some nasty tricks like fake atomic-based spinlocks to perform some operations (like float addition, which has no atomic intrinsics). While OK with 'standard' low number of working threads (8-16), because collision were rather rare and implied memory barrier not *that* much overhead, this performed poorly with more powerful systems reaching the 100 of threads and beyond (like workstations or render farm hardware). There, both memory barrier overhead and more frequent collisions would have significant impact on performances. This was addressed by splitting further the process, we now have three loops, one over polys, loops and vertices, and we added an intermediate storage for weighted loop normals. This allows to avoid completely any atomic operation in body of threaded loops, which should fix scalability issues. This costs us slightly higher temp memory usage (something like 50Mb per million of polygons on average), but looks like acceptable tradeoff. Further more, tests showed that we could gain an additional ~7% of speed in computing normals of heavy meshes, by also parallelizing the last two loops (might be 1 or 2% on overall mesh update at best...). Note that further tweaking in this code should be possible once Sergey adds the 'minimum batch size' option to threaded foreach API, since very light loops like the one on loops (mere v3 addition) require much bigger batches than heavier code (like the one on polys) to keep optimal performances.
2017-10-20Cleanup: redundant castsCampbell Barton
2017-10-06Cleanup: Math lib naming (use v3 suffix)Campbell Barton
2017-08-21Fix T52434: Restore mesh center of mass calculationCampbell Barton
The new method while improved for solid objects doesn't work for non-manifold meshes, keep both.
2017-06-19Cleanup: doxygen commentsCampbell Barton
Also remove duplicate & mismatching comments from grease-pencil header. Keep comments close to implementation to avoid getting out of sync.
2017-05-12Mesh Center: improved center-of-mass calculationBill Currie
Previous method was based on face-area, giving un-even results based on topology and gave issues with zero area faces. This method gives matching results for concave ngons and the same geometry triangulated.
2017-04-24Cleanup: styleCampbell Barton
2017-03-14CLNor: rework threaded computation.Bastien Montagne
Was using some threaded queue on top of task pool, tssk... Now using properly task pool directly to crunch chunks of smooth fans. No noticable changes in speed. Tried to completely get rid of the 'no threading with few loops' code, but even just creating/freeing the task pool, without actually pushing any task, is enough to make code 50% slower in worst case scenario (i.e. few thousands of simple cube objects).
2017-03-14CLNor code: use averaged debug timing.Bastien Montagne
2017-03-14Fix T50876: Cycles Crash - Cycles crashes before sampling when certain ↵Bastien Montagne
meshes have autosmooth enabled. The root of the issue was in custom normal code, so far it assumed that we could only have one cyclic smooth fan around each vertex, which is... blatantly wrong (again, the two cones sharing same vertex tip e.g.). This required a rather deep change in how smooth fans/clnor spaces are processed, took me some time to find a 'good' solution. Note that new code is slightly slower than previous one (maybe about 5%), not much to be done here, am afraid. Tested against all older report files I could find, seems OK.
2017-03-10Fix useless allocation of edge_vectors in threaded case of loop split ↵Bastien Montagne
generation.
2017-02-22Refactor Mesh split_faces() code to use loop normal spaces.Bastien Montagne
Finding which loop should share its vertex with which others is not easy with regular Mesh data (mostly due to lack of advanced topology info, as opposed with BMesh case). Custom loop normals computing already does that - and can return 'loop normal spaces', which among other things contain definitions of 'smooth fans' of loops around vertices. Using those makes it easy to find vertices (and then edges) that needs splitting. This commit also adds support of non-autosmooth meshes, where we want to split out flat faces from smooth ones.
2017-01-11Add mid_v3_v3_array function and remove redundant functionsLuca Rood
Other than implementing a `mid_v3_v3_array` function, this removes `cent_tri_v3` and `cent_quad_v3` in favor of `mid_v3_v3v3v3` and `mid_v3_v3v3v3v3` respectively. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D2459
2016-11-15Atomics: Make naming more obvious about which value is being returnedSergey Sharybin
2016-11-02Solve threading conflict when calculating smooth normalsSergey Sharybin
It was possible to have synchronization issues whe naccumulating smooth normal to a vertex, causing shading artifacts during playback. Bug found by Dalai, thanks!
2016-08-02Fix T48986: Incorrect normals or tangents when using custom split normals.Bastien Montagne
(Re)-setting custom normals could cause some unwanted splitting of some of them, leading to slightly different tangent space. Simply enlarged slightly the threshold detecting similar normals as identical ones for now, afarid this is the kind of issue that cannot get a full complete solution for until we drop floats...
2016-06-07Fix (unreported) EditNormal modifier: broken 'flip poly' feature.Bastien Montagne
Newly computed custom normals were forgotten during poly flipping, leading to wrong custom normals being assigned to wrong loop... Dead simple, but was tough to track down this one!
2016-04-26Support multiple tangents for BI render & viewportAlexander Romanov
Normal Map node support for GLSL mode and the internal render (multiple tangents support). The Normal Map node is a useful node which is present in the Cycles render. It makes it possible to use normal mapping without additional material node in a node tree. This patch implements Normal Map node for GLSL mode and the internal render. Previously only the active UV layer was used to calculate tangents.
2016-04-01Cleanup: style/spellingCampbell Barton
2016-03-14Support mdisps for Mesh.flip_normals()Campbell Barton
2016-03-14Cleanup: move MDisps flipping to own functionCampbell Barton
2016-03-14Cleanup: style/spellingCampbell Barton
2016-02-28BKE_mesh: add polygon flipping tools.Bastien Montagne
Those new functions invert the winding of polygons, effectively inverting their normals. A helper was also added to allow swapping two items in customdata layers. Being able to invert normals outside of BMesh area is very important in several places, like IO scripts or customnormals modifiers... Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D1814
2016-01-28Cleanup: warnings & styleCampbell Barton
2016-01-28cleanup: spelling / typosMike Erwin
no functional changes
2016-01-26mesh_evaluate.c: OMP -> BLI_task, and some more parallelization.Bastien Montagne
Only concerns poly normals computing, have usual 10% speedup of affected code for OMP -> BLI_task switching. Also parallelized the 'weighted accum' part (used when computing both polys and vertices normals, when using modifiers e.g.), which gives nice 325% speedup (from 66ms to 20ms for a 500k poly monkey with simple deform modifier e.g.). ;)
2015-12-21Cleanup: warnings (msvc)Campbell Barton
Part of patch D1670 by @LazyDodo
2015-10-12Add functions to compute normals (verts, polys and loops ones) for a given ↵Bastien Montagne
shapekey. Title says pretty much everything, we now have BKE and RNA funcs to get vertex, poly and loop normals of a given shapekey. This will be used e.g. in FBX exporter (shapekeys need normal data too). Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D1510
2015-09-15Cleanup: hide clnors warning prints behind G.debug, those can get annoyingly ↵Bastien Montagne
verbose...
2015-09-14Fix T46114: paint face-mask hide clears sharp flagCampbell Barton
2015-09-13Cleanup: spellingCampbell Barton
2015-09-04Fix T46015: normals_split_custom_set_from_vertices doesn't work with zero ↵Bastien Montagne
vectors This was simply broken for vertex case (indexing loop normals with vert indices...). Turns out to be rather verbose to replace on-the-fly zero normals by default ones correctly, and do not want to make a full copy of the given custom normals array, so now this one is editied in place (replacing zero vectors by correct default normals). Don't think this could be a serious issue anyway.
2015-09-03Fix T45984: Setting custom normals properly requires multiple calls to ↵Bastien Montagne
normals_split_custom_set() The detection of needed sharp edges (based on given loop normals) would not fully work on first run in case we started with a complete smooth cyclic loop fan (edge between first and last loop of the fan would not get checked).
2015-08-12Displace Modifier: add an option to displace along (averaged) custom ↵Bastien Montagne
normals, instead of vertex normals. User suggestion/request from 'boby'.
2015-08-05Remove redundant addition in BKE_mesh_calc_volumeCampbell Barton
2015-07-30Move tangents and baking to looptris:Antony Riakiotakis
Notes: * Code in rendering and in game engine will still convert tangents to a tessface representation. Added code that takes care of tangent layer only, might be removed when BGE and rendering goes full mlooptri mode. * Baking should work discovered some dead code while I was working on the patch, also tangents are broken when baking from multires (also in master), but those are separate issues that can be fixed later. This should fix T45491 as well