mirror of
https://github.com/Relintai/godot-lportal.git
synced 2024-11-11 10:52:09 +01:00
Workaround to godot light cull bug
This commit is contained in:
parent
0f8094e9f3
commit
5e31db0b0c
13
ldob.cpp
13
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<GeometryInstance>(pS);
|
||||
if (pGI)
|
||||
{
|
||||
// godot visible bug workaround
|
||||
pGI->set_extra_cull_margin(0.0f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -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<GeometryInstance>(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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user