From adb7ecce15f2a48ebb3e0defaaaf7c54bae04bd8 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sat, 4 Mar 2023 14:43:04 -0700 Subject: [PATCH] light: remove -lightgrid_force_cube, -lightgrid_force_pot --- include/light/light.hh | 2 -- light/light.cc | 3 --- light/lightgrid.cc | 25 ------------------------- 3 files changed, 30 deletions(-) diff --git a/include/light/light.hh b/include/light/light.hh index c303a19d..140d85f2 100644 --- a/include/light/light.hh +++ b/include/light/light.hh @@ -391,8 +391,6 @@ public: setting_int32 lmshift; setting_bool lightgrid; setting_vec3 lightgrid_dist; - setting_bool lightgrid_force_cube; - setting_bool lightgrid_force_pot; setting_enum lightgrid_format; setting_func dirtdebug; diff --git a/light/light.cc b/light/light.cc index 34185d90..27b1d14c 100644 --- a/light/light.cc +++ b/light/light.cc @@ -333,9 +333,6 @@ light_settings::light_settings() lightgrid{this, "lightgrid", false, &experimental_group, "experimental LIGHTGRID bspx lump"}, lightgrid_dist{this, "lightgrid_dist", 32.f, 32.f, 32.f, &experimental_group, "distance between lightgrid sample points, in world units. controls lightgrid size."}, - lightgrid_force_cube{this, "lightgrid_force_cube", false, &experimental_group, "force lightgrid to be a cube"}, - lightgrid_force_pot{ - this, "lightgrid_force_pot", false, &experimental_group, "force lightgrid to be a power of 2"}, lightgrid_format{this, "lightgrid_format", lightgrid_format_t::OCTREE, {{"octree", lightgrid_format_t::OCTREE}}, &experimental_group, "lightgrid BSPX lump to use"}, diff --git a/light/lightgrid.cc b/light/lightgrid.cc index cd935722..330d80c2 100644 --- a/light/lightgrid.cc +++ b/light/lightgrid.cc @@ -420,11 +420,6 @@ void LightGrid(bspdata_t *bspdata) data.grid_dist = light_options.lightgrid_dist.value(); auto grid_bounds = LightGridBounds(bsp); - if (light_options.lightgrid_force_cube.value()) { - logging::print("before MakeCube: {}\n", grid_bounds); - grid_bounds = MakeCube(grid_bounds); - logging::print("after MakeCube: {}\n", grid_bounds); - } const qvec3f grid_maxs = grid_bounds.maxs(); data.grid_mins = grid_bounds.mins(); @@ -434,26 +429,6 @@ void LightGrid(bspdata_t *bspdata) data.grid_size = {ceil(world_size[0] / data.grid_dist[0]), ceil(world_size[1] / data.grid_dist[1]), ceil(world_size[2] / data.grid_dist[2])}; - if (light_options.lightgrid_force_pot.value()) { - const auto old_grid_size = data.grid_size; - - logging::print("before making power of 2: data.grid_size: {}\n", data.grid_size); - data.grid_size = MakePOT(data.grid_size); - logging::print("after: data.grid_size: {}\n", data.grid_size); - - // adjust the grid mins to preserve the old center point - - qvec3f old_maxs = data.grid_mins + (old_grid_size * data.grid_dist); - // should always be >= old_maxs on each component - qvec3f new_maxs = data.grid_mins + (data.grid_size * data.grid_dist); - - qvec3f delta = (new_maxs - old_maxs) / 2; - - logging::print("shifting by -{}\n", delta); - - data.grid_mins -= delta; - } - data.grid_result.resize(data.grid_size[0] * data.grid_size[1] * data.grid_size[2]); data.occlusion.resize(data.grid_size[0] * data.grid_size[1] * data.grid_size[2]);