From 78e12184f6414812f11283d80c7ebe7df7c7ed37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Fri, 8 Jan 2021 11:21:13 +0100 Subject: [PATCH] Fix Spot Lights without Shadows --- lavos/src/renderer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lavos/src/renderer.cpp b/lavos/src/renderer.cpp index eb16e41..1d58275 100644 --- a/lavos/src/renderer.cpp +++ b/lavos/src/renderer.cpp @@ -275,9 +275,10 @@ void Renderer::UpdateShadowDescriptors(LightCollection *light_collection) { vk::ImageView image_view; vk::Sampler sampler; - if(i < light_collection->spot_lights.size()) + SpotLightShadow *shadow; + if(i < light_collection->spot_lights.size() + && (shadow = light_collection->spot_lights[i]->GetShadow())) { - SpotLightShadow *shadow = light_collection->spot_lights[i]->GetShadow(); image_view = shadow->GetFinalImageView(); sampler = shadow->GetSampler(); } -- 2.45.2