Age | Commit message (Collapse) | Author |
|
We have our own assert implementation, `BLI_assert()` that is prefered over the
C standard library one. Its output is more consistent across compilers and
makes termination on assert failure optional (through `WITH_ASSERT_ABORT`).
In many places we'd include the C library header without ever accessing it.
|
|
|
|
This corrects the overlap detection for cloths since in this case kdop26
is used and epsilon represents the distance.
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenlib` module. Not all warnings are
addressed in this commit.
No functional changes.
|
|
I don't see the need for a BVH Tree to have root but not have leafs.
But apparently this case is possible.
|
|
affected by the knife tool
The knife code currently calls the `BLI_bvhtree_overlap` function that
tests the overlap between the mesh tree and an AABB that encompasses the
points projected in the clip_start, clip_end and or clip_planes of the
view.
This resulted in many false positives since the AABB is very large.
Often all the triangles "overlapped".
The solution was to create a new function that actually tests the
intersection of AABB with a plane.
Even not considering the clip_planes of the view, this solution is more
appropriate than using overlap.
Differential Revision: https://developer.blender.org/D8229
|
|
|
|
|
|
|
|
|
|
|
|
|
|
No need to create different callbacks for `BLI_task_parallel_range`,
these callbacks are called a few times.
|
|
`BLI_task_parallel_range` counts the number of tasks depending on the
number of items.
In the case of `BLI_bvhtree_overlap` the number of items is always
between 2 and 16, which makes it always run in single thread.
So, set the maximum number of items per thread to 1.
In my tests the cloth collision system (which calls that function)
went from 0.80fps to 0.88fps.
Differential Revision: https://developer.blender.org/D6523
|
|
No functional change.
|
|
As you can see, here is testing the "children" of `node1`.
So bvhtree is `tree1`.
This problem has never been observed because usually `tree_type`
of `tree1` equals `tree_type` of `tree2`.
|
|
|
|
Although not using multithreading, the `thread` parameter in the
`BVHTree_OverlapCallback` callback always returned a value between the
"number of threads".
This parameter should always be 0 in such cases.
Also a `BLI_Stack` was created for each "thread" and used.
This small overhead is no longer seen.
Differential Revision: https://developer.blender.org/D6510
|
|
No functional changes.
Allows more performance control and is important for Weld Modifier.
|
|
|
|
|
|
Ref T66423
Differential revision: https://developer.blender.org/D5562
|
|
Differential Revision: https://developer.blender.org/D3744
|
|
TLS and Settings can be used by other types of parallel 'for loops', so
removing 'Range' from their names.
No functional changes expected here.
|
|
|
|
|
|
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
|
|
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
Needed for clan-format not to wrap onto one line.
|
|
BF-admins agree to remove header information that isn't useful,
to reduce noise.
- BEGIN/END license blocks
Developers should add non license comments as separate comment blocks.
No need for separator text.
- Contributors
This is often invalid, outdated or misleading
especially when splitting files.
It's more useful to git-blame to find out who has developed the code.
See P901 for script to perform these edits.
|
|
|
|
Free the BVH tree immediately along with the mesh, otherwise we might access
invalid mesh data.
Differential Revision: https://developer.blender.org/D4201
|
|
Prevents clang-format wrapping text before comments.
|
|
|
|
|
|
Simple find_nearest relies on a heuristic for efficient culling of
the BVH tree, which involves a fast callback that always updates the
result, and the caller reusing the result of the previous find_nearest
to prime the process for the next vertex.
If the callback is slow and/or applies significant restrictions on
what kind of nodes can qualify for the result, the heuristic can't
work. Thus for such tasks it is necessary to order and prune nodes
before the callback at BVH tree level using a priority queue.
Since, according to code history, for simple find_nearest the
heuristic approach is faster, this mode has to be an option.
|
|
This lets the compiler use min/max instructions for 4.5% FPS
improvement in Shrinkwrap to Nearest Surface Point.
|
|
Continuation of https://developer.blender.org/D3802
Reviewers: brecht
Differential Revision: https://developer.blender.org/D3808
|
|
|
|
|
|
|
|
occlusion
This patch adds support for clip_planes (ie ignore what is behind a face)...
The idea is to first execute a raycast to get the polygon to which the mouse cursor points.
Then a snap test is done on the vertices or edges of the polygon.
Then with the normal and location obtained in raycast a new clip_plane is created and the snap over the whole scene is processed ignoring the elements behind the clip_plane.
Here 2 gif of how the previous patch would work on blender2.79:
{F497176}
{F497177}
Reviewers: mont29, campbellbarton
Reviewed By: campbellbarton
Subscribers: bliblubli
Tags: #bf_blender_2.8
Differential Revision: https://developer.blender.org/D2527
|
|
This reverts commit 717dd4cecd2ea8eaa7b3bbfb5a5c7ec65f0337c0.
It was causing problems in the protactor ruler.
I'll think of a better solution.
|
|
Clip_planes are an important parameter to be used in callbacks.
|
|
This patch does not make any difference for a user's POV. But it is a step for adding the occlusion test for snapping functions.
This new function finds the node(aabb) whose projection is closest to a screen coordinate.
Reviewers: campbellbarton
Reviewed By: campbellbarton
Tags: #bf_blender_2.8
Differential Revision: https://developer.blender.org/D3180
|
|
This will allow greater control of the bvhtrees that are obtained, and helps identify problems.
It is also an additional step to unify the functions.
|
|
recursive function.
Each parameter of the function is copied into the memory stack.
This also brought an improvement in peformance of snapping functions between 5% and 12% in my tests.
|