Age | Commit message (Collapse) | Author |
|
|
|
|
|
Main issue here is that glBuf* calls were invoked from threads different than
main thread. This caused a crash (since those do not have a GL context active).
Fix here is twofold:
* add an ID buffer in buffer pool that handles pbvh buffers and is freed
from main thread when gpu_buffer_pool_free_unused is called.
* do not create glbuffers in derivedmesh creation routine, rather tag nodes
for update and create those in the draw function
(guaranteed to be called from main thread)
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D169
|
|
reflect that. Previous name GPU_Buffers was very similar to GPU_Buffer,
renamed to GPU_PBVH_Buffers
|
|
|
|
size (~85% wasted space).
|
|
|
|
* The mask was not subdivided properly on splitting edges, which gave interesting
but definitely wrong fractal-like borders around masks.
* Edge splitting was only done where the mask was < 50%, with the reasoning that
you can't do a 50% topology update. But this gives an ugly border in the mesh.
The mask should already make the brush move the vertices only 50%, which means
that topology updates will also happen less frequent, that should be enough.
|
|
remove a vertex from the pbvh if the only face it was part of was
removed from the pbvh. This should work but no time to investigate now
properly, and better have a solid release. The problem could be seen
when sculpting to open meshes. Some vertices and faces on the boundaries
would become stuck and unresponsive.
|
|
|
|
sculpting, store offset directly.
|
|
|
|
also avoid allocs per node in pbvh_bmesh_node_limit_ensure()
|
|
|
|
calloc. Since we copy the first 1/1.3 part of the new array from the
existing nodes, only the rest 0.3/1.3 should be initialized to zero.
This should in theory cut down the times of occasional hangs with
dyntopo, since my guess is that it is caused by dynamic reallocations.
Maybe a linked list structure would help here? This is a bigger change
though, leaving as is for now.
Also, minor cleanup, delete duplicate ghash deletion and remove unneeded
commented code.
|
|
vertex and edge),
also replace BM_face_create_quad_tri_v with BM_face_create_verts
|
|
side in some cases it gets a bit confusing.
also correct edge-rotate where bool->flag conversion worked by accident.
|
|
|
|
* Actually check if normal recalculation flags exists and set it when
splitting nodes in dyntopo. Right now, nodes that need GPU buffer update
will always get in the list to get their normals generated, but to avoid
a possible future breakage better do it right now.
* Avoid keeping deleted/removed vertices in vertex-to-node and unique
vertex hashes, since some checks rely on those and may go awry if these
still exist. Also they pollute the hashes, and may hurt performance
somewhat.
|
|
Turn off pbvh normal update flag after recalculation, saves
recalculating normals every frame when not stroking the mesh.
For this to work reliably with undo we need to support original normals
in the bm_log (was marked as a TODO already in the code), so that
undoing avoids having invalid normals in the mesh (since we don't update
every frame anymore). This was added in this commit as well.
Also added some (disabled) quite paranoid checks in the bmesh valication
code for dyntopo hoping to catch the real normal update issue. No luck
there yet.
|
|
and undo buffers.
When we have smooth shading we must not only update the unique vertex
normals.
|
|
avoids remove,insert and only hashes the key once.
|
|
|
|
also minor optimization for BM_edge_in_face(), check edges radial loops rather then the faces edges
since normally there are 0-2 faces attached to an edge compared to 3+ edges in a face.
|
|
a different function signature. (which evidently works but error prone).
|
|
|
|
- creating faces was unnecessarily checking if they already existed.
- deleting a face did edge-lookups, when the edges are already available from the face-loops.
|
|
|
|
|
|
Fixes [#34348] Collapse short edges affects masked geometry
/projects.blender.org/tracker/?func=detail&aid=34348&group_id=9&atid=498
Fixed by disallowing topology updates on edges with a vertex masked at
50% or greater. This is a necessarily arbitrary choice; can't do
halfway updates for topology like we can with displacement.
|
|
|
|
|
|
path_util_1.patch from Lawrence D'Oliveiro (ldo)
|
|
|
|
Was incorrectly testing for a vertex in a set with BLI_ghash_lookup
rather than BLI_ghash_haskey; the key in this case is always null so
the test failed.
This could leave the PBVH in an inconsistent state, since the
top-level map of BMesh vertices to PBVH nodes would indicate the
vertex was in a node, but that node wouldn't actually have any faces
using the vertex. That inconsistent state would eventually lead to a
crash in pbvh_bmesh_vert_remove().
Fixes
http://projects.blender.org/tracker/?func=detail&atid=498&aid=34370&group_id=9
|
|
|
|
Fixes [#33964] Dyntopo crash with edge collapse + undo
projects.blender.org/tracker/?func=detail&aid=33964&group_id=9&atid=498
|
|
After deleting a face, check for unused edges and delete them.
Fixes bug [#33891]
projects.blender.org/tracker/?func=detail&aid=33891&group_id=9&atid=498
|
|
Moved the GPU function gpu_bmesh_face_visible() to BKE_paint and
inverted the test to match equivalent tests for other mesh types:
paint_is_bmesh_face_hidden().
Changed BKE_pbvh_bmesh_node_save_orig() to not save hidden faces into
the triangle array.
Modified the non-use-original branch of pbvh_bmesh_node_raycast() to
skip hidden faces.
Fixes bug #33914:
projects.blender.org/tracker/index.php?func=detail&aid=33914&group_id=9&atid=498
|
|
counting the edge-faces then using an iterator,
instead use BM_edge_loop_pair()
|
|
|
|
|
|
single verts.
|
|
- no need for bm_triangle_other_vert_find(), the other vert is known relative to the loop.
- no need for bm_face_edge_backwards(), the verts are in order in the loop.
|
|
conversion).
|
|
|
|
- add option to calloc or not, existing code wasnt consistent here, would calloc on first alloc but not on realloc, also - the static memory was never zero'd.
use flag BLI_BUFFER_USE_CALLOC to ensure all new memory is zero'd (static/alloc/realloc's).
- add BLI_buffer_declare_static / BLI_buffer_declare so its possible to have a buffer that never uses static memory.
|
|
|
|
len_v3, len_squared_v3
|
|
|