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:
authorClément Foucault <foucault.clem@gmail.com>2019-05-04 02:41:39 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-05-04 15:11:04 +0300
commitfb3b2ab709bfd3aa1e9a1c9db9d3ce05ed4e6c13 (patch)
tree5d10c62ae50b03b38fb76e592122d754f766e631 /source/blender/draw/intern/draw_manager_exec.c
parentb2f1a6587410d00ad3bbd22e045979f80048afe2 (diff)
Cleanup: Remove unused code in sculpt_mode, workbench and draw manager
Diffstat (limited to 'source/blender/draw/intern/draw_manager_exec.c')
-rw-r--r--source/blender/draw/intern/draw_manager_exec.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c
index bfbb7af49dd..46f4d0620c8 100644
--- a/source/blender/draw/intern/draw_manager_exec.c
+++ b/source/blender/draw/intern/draw_manager_exec.c
@@ -680,12 +680,16 @@ bool DRW_culling_sphere_test(BoundSphere *bsphere)
/* Do a rough test first: Sphere VS Sphere intersect. */
BoundSphere *frustum_bsphere = &DST.clipping.frustum_bsphere;
- float center_dist = len_squared_v3v3(bsphere->center, frustum_bsphere->center);
- if (center_dist > SQUARE(bsphere->radius + frustum_bsphere->radius)) {
+ float center_dist_sq = len_squared_v3v3(bsphere->center, frustum_bsphere->center);
+ float radius_sum = bsphere->radius + frustum_bsphere->radius;
+ if (center_dist_sq > SQUARE(radius_sum)) {
return false;
}
+ /* TODO we could test against the inscribed sphere of the frustum to early out positively. */
/* Test against the 6 frustum planes. */
+ /* TODO order planes with sides first then far then near clip. Should be better culling heuristic
+ * when sculpting. */
for (int p = 0; p < 6; p++) {
float dist = plane_point_side_v3(DST.clipping.frustum_planes[p], bsphere->center);
if (dist < -bsphere->radius) {
@@ -1319,9 +1323,6 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state)
draw_geometry_execute_ex(
shgroup, call->instances.geometry, 0, *call->instances.count, true);
break;
- case DRW_CALL_GENERATE:
- call->generate.geometry_fn(shgroup, draw_geometry_execute, call->generate.user_data);
- break;
case DRW_CALL_PROCEDURAL:
GPU_draw_primitive(call->procedural.prim_type, call->procedural.vert_count);
break;