From 9bf47923a5955b3bd787370901529aec96eb33ec Mon Sep 17 00:00:00 2001 From: JestemStefan Date: Mon, 12 Jul 2021 15:12:33 +0200 Subject: [PATCH] Skip rendering of lights with zero size --- servers/visual/visual_server_viewport.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp index 1b2c1f85c25..b05267d46da 100644 --- a/servers/visual/visual_server_viewport.cpp +++ b/servers/visual/visual_server_viewport.cpp @@ -131,6 +131,10 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E if (cl->enabled && cl->texture.is_valid()) { //not super efficient.. Size2 tsize = VSG::storage->texture_size_with_proxy(cl->texture); + // Skip using lights with texture of 0 size + if (!tsize.x || !tsize.y) { + continue; + } tsize *= cl->scale; Vector2 offset = tsize / 2.0;