From b0ae7d86bf9268ce38aac3882d4e3252f571bca2 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 1 Jul 2022 22:41:46 -0400 Subject: [PATCH] only generate bounds if rays is enabled don't lightmap sky again --- common/bspfile.cc | 4 ++-- light/surflight.cc | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/bspfile.cc b/common/bspfile.cc index 69db3dff..b6f83e52 100644 --- a/common/bspfile.cc +++ b/common/bspfile.cc @@ -391,9 +391,9 @@ struct gamedef_q2_t : public gamedef_t max_entity_key = 256; } - bool surf_is_lightmapped(const surfflags_t &flags) const override { return !(flags.native & Q2_SURF_NODRAW); } + bool surf_is_lightmapped(const surfflags_t &flags) const override { return !(flags.native & (Q2_SURF_NODRAW | Q2_SURF_SKY)); } - bool surf_is_subdivided(const surfflags_t &flags) const override { return true; } + bool surf_is_subdivided(const surfflags_t &flags) const override { return !(flags.native & Q2_SURF_SKY); } bool surfflags_are_valid(const surfflags_t &flags) const override { diff --git a/light/surflight.cc b/light/surflight.cc index 8af7f7ae..2b78f4cc 100644 --- a/light/surflight.cc +++ b/light/surflight.cc @@ -111,7 +111,9 @@ static void MakeSurfaceLight(const mbsp_t *bsp, const settings::worldspawn_keys l.style = style; // Init bbox... - l.bounds = EstimateVisibleBoundsAtPoint(facemidpoint); + if (options.visapprox.value() == visapprox_t::RAYS) { + l.bounds = EstimateVisibleBoundsAtPoint(facemidpoint); + } for (auto &pt : points) { if (options.visapprox.value() == visapprox_t::VIS) {