Merge pull request #50397 from JestemStefan/41756_issue_fix

[3.x] Skip rendering of `Light2D` with zero size texture
This commit is contained in:
Rémi Verschelde 2021-08-12 20:30:52 +02:00 committed by GitHub
commit dc1fc97836
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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