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
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2013-01-19 20:10:21 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2013-01-19 20:10:21 +0400
commit9a50f454697e5dea6e8603aa90fadaa6156657d6 (patch)
tree150f678940c8bb280697a0fde95e203c1fc3f7f4 /source/blender/gpu
parent399763015769ca8e35a5639748c9bb08fbfd984b (diff)
Skip hidden faces in PBVH BMesh ray intersection test
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
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index c1eb7bdbbac..fedcb58e1a3 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -1922,22 +1922,6 @@ static int gpu_bmesh_vert_visible_count(GHash *bm_unique_verts,
return totvert;
}
-/* Return TRUE if all vertices in the face are visible, FALSE otherwise */
-static int gpu_bmesh_face_visible(BMFace *f)
-{
- BMLoop *l_iter;
- BMLoop *l_first;
-
- l_iter = l_first = BM_FACE_FIRST_LOOP(f);
- do {
- if (BM_elem_flag_test(l_iter->v, BM_ELEM_HIDDEN)) {
- return false;
- }
- } while ((l_iter = l_iter->next) != l_first);
-
- return true;
-}
-
/* Return the total number of visible faces */
static int gpu_bmesh_face_visible_count(GHash *bm_faces)
{
@@ -1947,7 +1931,7 @@ static int gpu_bmesh_face_visible_count(GHash *bm_faces)
GHASH_ITER (gh_iter, bm_faces) {
BMFace *f = BLI_ghashIterator_getKey(&gh_iter);
- if (gpu_bmesh_face_visible(f))
+ if (!paint_is_bmesh_face_hidden(f))
totface++;
}
@@ -2014,7 +1998,7 @@ void GPU_update_bmesh_buffers(GPU_Buffers *buffers,
BLI_assert(f->len == 3);
- if (gpu_bmesh_face_visible(f)) {
+ if (!paint_is_bmesh_face_hidden(f)) {
BMVert *v[3];
float fmask = 0;
int i;
@@ -2068,7 +2052,7 @@ void GPU_update_bmesh_buffers(GPU_Buffers *buffers,
GHASH_ITER (gh_iter, bm_faces) {
BMFace *f = BLI_ghashIterator_getKey(&gh_iter);
- if (gpu_bmesh_face_visible(f)) {
+ if (!paint_is_bmesh_face_hidden(f)) {
BMLoop *l_iter;
BMLoop *l_first;