light: lightgrid: fix not using data.occlusion, data.grid_result
This commit is contained in:
parent
78f90c1e3b
commit
6c1b8cb31c
|
|
@ -512,11 +512,9 @@ void LightGrid(bspdata_t *bspdata)
|
||||||
ceil(world_size[2] / data.grid_dist[2])
|
ceil(world_size[2] / data.grid_dist[2])
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<lightgrid_samples_t> grid_result;
|
data.grid_result.resize(data.grid_size[0] * data.grid_size[1] * data.grid_size[2]);
|
||||||
grid_result.resize(data.grid_size[0] * data.grid_size[1] * data.grid_size[2]);
|
|
||||||
|
|
||||||
std::vector<uint8_t> occlusion;
|
data.occlusion.resize(data.grid_size[0] * data.grid_size[1] * data.grid_size[2]);
|
||||||
occlusion.resize(data.grid_size[0] * data.grid_size[1] * data.grid_size[2]);
|
|
||||||
|
|
||||||
logging::parallel_for(0, data.grid_size[0] * data.grid_size[1] * data.grid_size[2], [&](int sample_index){
|
logging::parallel_for(0, data.grid_size[0] * data.grid_size[1] * data.grid_size[2], [&](int sample_index){
|
||||||
const int z = (sample_index / (data.grid_size[0] * data.grid_size[1]));
|
const int z = (sample_index / (data.grid_size[0] * data.grid_size[1]));
|
||||||
|
|
@ -540,14 +538,14 @@ void LightGrid(bspdata_t *bspdata)
|
||||||
if (!occluded)
|
if (!occluded)
|
||||||
samples = CalcLightgridAtPoint(&bsp, world_point);
|
samples = CalcLightgridAtPoint(&bsp, world_point);
|
||||||
|
|
||||||
grid_result[sample_index] = samples;
|
data.grid_result[sample_index] = samples;
|
||||||
occlusion[sample_index] = occluded;
|
data.occlusion[sample_index] = occluded;
|
||||||
});
|
});
|
||||||
|
|
||||||
// the maximum used styles across the map.
|
// the maximum used styles across the map.
|
||||||
data.num_styles = [&](){
|
data.num_styles = [&](){
|
||||||
int result = 0;
|
int result = 0;
|
||||||
for (auto &samples : grid_result) {
|
for (auto &samples : data.grid_result) {
|
||||||
result = max(result, samples.used_styles());
|
result = max(result, samples.used_styles());
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue