diff options
author | Gordon MacPherson <gordon@gordonite.tech> | 2020-12-30 09:56:49 +0000 |
---|---|---|
committer | Gordon MacPherson <gordon@gordonite.tech> | 2021-01-26 19:48:18 +0000 |
commit | 86c7faa169a2d11be7ea3c83ae833ffba0660556 (patch) | |
tree | 098bce42aa4f6e889825fbdae82890c595c3bf9b /servers/rendering | |
parent | fa498f6105bb18a038210f4c000e1a97b7c86354 (diff) |
Fix zero scaling and material mappings being mapped to wrong fields
- fixes scale values of 0.0013 (det == 0.00004) not rendering, they should render even at small values, but not at zero like the editor grid plugin supplies zero exactly.
- fixes node_3d_editor_plugin visibility bug when scale is zero
- fix culling with small scaling values - which are still valid to be rendered like 0.00004
note: grid is still not fixed, it has det == 0 issues but this fixes one of them.
Diffstat (limited to 'servers/rendering')
-rw-r--r-- | servers/rendering/renderer_scene_cull.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/servers/rendering/renderer_scene_cull.cpp b/servers/rendering/renderer_scene_cull.cpp index e1f179aa3b..db601ba49c 100644 --- a/servers/rendering/renderer_scene_cull.cpp +++ b/servers/rendering/renderer_scene_cull.cpp @@ -1253,7 +1253,8 @@ void RendererSceneCull::_update_instance(Instance *p_instance) { scene_render->geometry_instance_set_transform(geom->geometry_instance, p_instance->transform, p_instance->aabb, p_instance->transformed_aabb); } - if (p_instance->scenario == nullptr || !p_instance->visible || Math::is_zero_approx(p_instance->transform.basis.determinant())) { + // note: we had to remove is equal approx check here, it meant that det == 0.000004 won't work, which is the case for some of our scenes. + if (p_instance->scenario == nullptr || !p_instance->visible || p_instance->transform.basis.determinant() == 0) { p_instance->prev_transformed_aabb = p_instance->transformed_aabb; return; } |