[Bf-blender-cvs] [ec7510b4585] master: Fix T67319 DRW: Large objects gets incorrectly culled

Clément Foucault noreply at git.blender.org
Wed Jun 24 17:45:03 CEST 2020


Commit: ec7510b458528eb8dcdf2c538a2b805813940447
Author: Clément Foucault
Date:   Wed Jun 24 17:44:50 2020 +0200
Branches: master
https://developer.blender.org/rBec7510b458528eb8dcdf2c538a2b805813940447

Fix T67319 DRW: Large objects gets incorrectly culled

To avoid this we just bypass culling if the object is too big to avoid
float precision issues.

===================================================================

M	source/blender/draw/intern/draw_manager_data.c

===================================================================

diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index 8a99907e5db..fa3f0417f79 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -538,6 +538,11 @@ static void drw_call_culling_init(DRWCullingState *cull, Object *ob)
     mul_v3_m4v3(corner, ob->obmat, bbox->vec[0]);
     mul_m4_v3(ob->obmat, cull->bsphere.center);
     cull->bsphere.radius = len_v3v3(cull->bsphere.center, corner);
+
+    /* Bypass test for very large objects (see T67319). */
+    if (UNLIKELY(cull->bsphere.radius > 1e12)) {
+      cull->bsphere.radius = -1.0f;
+    }
   }
   else {
     /* Bypass test. */



More information about the Bf-blender-cvs mailing list