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.
This commit is contained in:
parent
560a73610b
commit
ec7510b458
Notes:
blender-bot
2023-02-14 04:46:12 +01:00
Referenced by issue #67319, Array in object offset with empty dissapear
|
@ -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. */
|
||||
|
|
Loading…
Reference in New Issue