light: remove -lightgrid_force_cube, -lightgrid_force_pot

This commit is contained in:
Eric Wasylishen 2023-03-04 14:43:04 -07:00
parent 6c3fd1503f
commit adb7ecce15
3 changed files with 0 additions and 30 deletions

View File

@ -391,8 +391,6 @@ public:
setting_int32 lmshift; setting_int32 lmshift;
setting_bool lightgrid; setting_bool lightgrid;
setting_vec3 lightgrid_dist; setting_vec3 lightgrid_dist;
setting_bool lightgrid_force_cube;
setting_bool lightgrid_force_pot;
setting_enum<lightgrid_format_t> lightgrid_format; setting_enum<lightgrid_format_t> lightgrid_format;
setting_func dirtdebug; setting_func dirtdebug;

View File

@ -333,9 +333,6 @@ light_settings::light_settings()
lightgrid{this, "lightgrid", false, &experimental_group, "experimental LIGHTGRID bspx lump"}, lightgrid{this, "lightgrid", false, &experimental_group, "experimental LIGHTGRID bspx lump"},
lightgrid_dist{this, "lightgrid_dist", 32.f, 32.f, 32.f, &experimental_group, lightgrid_dist{this, "lightgrid_dist", 32.f, 32.f, 32.f, &experimental_group,
"distance between lightgrid sample points, in world units. controls lightgrid size."}, "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}}, lightgrid_format{this, "lightgrid_format", lightgrid_format_t::OCTREE, {{"octree", lightgrid_format_t::OCTREE}},
&experimental_group, "lightgrid BSPX lump to use"}, &experimental_group, "lightgrid BSPX lump to use"},

View File

@ -420,11 +420,6 @@ void LightGrid(bspdata_t *bspdata)
data.grid_dist = light_options.lightgrid_dist.value(); data.grid_dist = light_options.lightgrid_dist.value();
auto grid_bounds = LightGridBounds(bsp); 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(); const qvec3f grid_maxs = grid_bounds.maxs();
data.grid_mins = grid_bounds.mins(); 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]), 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])}; 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.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]); data.occlusion.resize(data.grid_size[0] * data.grid_size[1] * data.grid_size[2]);