1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

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.
This commit is contained in:
Gordon MacPherson
2020-12-30 09:56:49 +00:00
parent fa498f6105
commit 86c7faa169
4 changed files with 33 additions and 5 deletions

View File

@@ -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;
}