diff --git a/ldob.cpp b/ldob.cpp index f6fd7ae..1fcafae 100644 --- a/ldob.cpp +++ b/ldob.cpp @@ -59,16 +59,29 @@ VisualInstance * LSob::GetVI() const return pVI; } + void LSob::Show(bool bShow) { Spatial * pS = GetSpatial(); if (!pS) return; + // noop + if (pS->is_visible() == bShow) + return; + if (bShow) pS->show(); else pS->hide(); + + GeometryInstance * pGI = Object::cast_to(pS); + if (pGI) + { + // godot visible bug workaround + pGI->set_extra_cull_margin(0.0f); + } + } diff --git a/lroom.cpp b/lroom.cpp index 1442fae..e30dfab 100644 --- a/lroom.cpp +++ b/lroom.cpp @@ -182,6 +182,15 @@ void LRoom::SoftShow(VisualInstance * pVI, uint32_t show_flags) pVI->set_layer_mask(mask); + // test godot bug +// GeometryInstance * pGI = Object::cast_to(pVI); +// if (pGI) +// { +// // godot visible bug workaround +// pGI->set_extra_cull_margin(0.0f); +// } + + // test the visual server - NOT A BOTTLENECK. set_layer_mask is cheap }