Age | Commit message (Collapse) | Author |
|
|
|
- When returning the number of items in a collection use BLI_*_len()
- Keep _size() for size in bytes.
- Keep _count() for data structures that don't store length
(hint this isn't a simple getter).
See P611 to apply instead of manually resolving conflicts.
|
|
Consistent with other BLI API's
|
|
|
|
This makes brush influence into a tube instead of a sphere.
It can be used along the outline of a mesh to adjust it's silhouette.
Note that all this takes advantage of changes from vertex paint,
from testing this seems useful so exposing from the brush options.
|
|
This behavior makes more sense for sculpt, less so for painting.
Restores non PBVH behavior, adding `BKE_pbvh_find_nearest_to_ray` -
similar to ray-cast except it finds the closest point on the surface.
|
|
Prepare to add code that stores distance to the ray, avoid confusion.
|
|
Use GPU_pbvh prefix.
|
|
Just return the face or NULL, like BM_edge_exists(),
Also for BM_face_exists_overlap & bm_face_exists_tri_from_loop_vert.
No functional changes.
Old code did some partial overlap checks where this made some sense,
but it's since been removed.
|
|
|
|
When an edge was collapsed, one of the vertices would be removed.
Edges attached to the deleted vertex wouldn't be considered for collapsing again,
making the outcome from collapsing edges depend on the edge-vertex order.
Use a hash to lookup the final vertex when collapsing edges, instead of skipping them.
|
|
|
|
Gives minor speedup
|
|
Checking if faces exist was a bottleneck,
use a simpler version of this function for triangles.
Gives approx 1.6x overall speedup (when many edges are being collapsed).
|
|
|
|
PBVH-nodes attached to the vertex to be deleted were updated,
but not nodes attached to the other vertex in the edge.
|
|
This was checking vert/face for every lookup,
so far the type is always known, do a direct lookup instead.
|
|
Gives small performance boost.
|
|
Was just checking the value of the first
|
|
|
|
|
|
|
|
This is a regression introduced by 77ac33d and was caused by use-after-free
mistake.
|
|
Keep index using the outer scope for GHASH iter macros,
while its often nice, in some cases to declare in the for loop,
it means you cant use as a counter after the loop exits, and in some cases signed/unsigned may matter.
API changes should really be split off in their own commits too.
|
|
GPU_buffer no longer has a fallback to client vertex arrays, so remove
comments about it.
Changed a few internal structs/function interfaces to use bool where
appropriate.
Use for-loop scope and flexible declaration placement. PBVH does the
same thing but needs ~150 fewer lines to do it!
The change to BLI_ghashIterator_init is admittedly hackish but makes
GHASH_ITER_INDEX nicer to use.
|
|
Useful for re-using a buffer when the existing data can be thrown away.
|
|
Since many callers only need a single triangle
|
|
When 'Front Faces' brush option was enabled, dyntop would still adjust detail on back-faces.
|
|
|
|
Optimize the full rebuild case for now (though same code can be adapted to
partial redraws)
Main changes here:
* Calculate bounding centroid for faces only once (instead of every intermediate node)
* Faces do not get added to GSets immediately, instead we track a face
array which has faces that belong in a node in consecutive order.
Nodes just keep accounting of start and length in the array.
* Due to faces not being added to GSets, we can skip doing cleanup of GSets
and readdition for each intermediate node and instead only
add the faces to the final leafs node GSets when those nodes are created.
Results:
For a 1.9 million face test model, PBVH generation time (roughly measured by undoing) is
dropped from 6 seconds to about 4 seconds. Still too high, but still a nice improvement.
TODO:
Thread some parts. Unfortunately threading the GSet assignment part might not help much since
we'd need a lot of locking to avoid collisions with node assignments, especially for unique vertices.
|
|
mixed up squared nonsquared length, also remove invalid verify check.
|
|
|
|
|
|
While adding edges to the queue multiple times is redundant,
walking over them is still needed.
|
|
|
|
|
|
Normals from subdivided edges were only taken from the edges first vertex.
Interpolate between the two to give more even results.
|
|
This isn't a bottleneck but may as well avoid the extra ghash overhead.
|
|
Use tagging to avoid re-evaluating the same edges while sculpting.
While gives only minor speedup,
it allows for changes to the queue without additional redundant checks.
|
|
|
|
|
|
Dyntopo can currently create skinny faces,
especially when the faces are much larger then the resolution.
To get the old behavior, set debug value to 1234
|
|
|
|
|
|
|
|
add BM_***_count_is_over(), _count_is_equal()
Useful if we only want to know if the count is a smaller value.
|
|
|
|
Detect this from the element type, also typecheck lookup functions
|
|
|
|
|