From 5864406f4d76f95e652a0ba48a06319f450ba8c5 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 21 Jul 2021 14:15:56 +0900 Subject: [PATCH] [vulkan] Enable all lights when camera out of map Without shadows, this is quite the cheat, but noclip is a cheat anyway, so probably not that big a deal. It does, however, make noclip usable for debugging. --- libs/video/renderer/vulkan/vulkan_lighting.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/video/renderer/vulkan/vulkan_lighting.c b/libs/video/renderer/vulkan/vulkan_lighting.c index eb2b1fd3a..a7a59d6c9 100644 --- a/libs/video/renderer/vulkan/vulkan_lighting.c +++ b/libs/video/renderer/vulkan/vulkan_lighting.c @@ -98,8 +98,12 @@ find_visible_lights (vulkan_ctx_t *ctx) //double start = Sys_DoubleTime (); int flags = 0; - Mod_LeafPVS_set (leaf, model, 0, lframe->pvs); - expand_pvs (lframe->pvs, model); + if (leaf == model->brush.leafs) { + memset (lframe->pvs, 0xff, sizeof (lframe->pvs)); + } else { + Mod_LeafPVS_set (leaf, model, 0, lframe->pvs); + expand_pvs (lframe->pvs, model); + } for (int i = 0; i < model->brush.numleafs; i++) { if (lframe->pvs[i / 8] & (1 << (i % 8))) { flags |= model->brush.leaf_flags[i + 1];