diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-06-24 18:44:50 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-06-24 18:44:57 +0300 |
commit | ec7510b458528eb8dcdf2c538a2b805813940447 (patch) | |
tree | f605cec0babc2b8792c84ff3040d1f88f67508bc /source/blender/draw | |
parent | 560a73610b76a08384d7396f3e864f82ece558a2 (diff) |
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.
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/draw_manager_data.c | 5 |
1 files changed, 5 insertions, 0 deletions
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. */ |