Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2017-09-30 20:37:26 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-09-30 20:37:40 +0300
commitcc772e4bca6ddb7b040af1e050f1376a778a8718 (patch)
treecedc4e32d8bdb9b24700d72f8ce727d31f80d8b5 /source/blender/draw/engines
parent1054f65a29b0b9ee9cf7db8a4036e4a55506ce03 (diff)
Eevee: LightGrid: Fix progressive rendering.
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r--source/blender/draw/engines/eevee/eevee_lightprobes.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c
index bbd82f1c3a0..6c449a71261 100644
--- a/source/blender/draw/engines/eevee/eevee_lightprobes.c
+++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c
@@ -1320,8 +1320,9 @@ void EEVEE_lightprobes_refresh(EEVEE_SceneLayerData *sldata, EEVEE_Data *vedata)
float pos[3], grid_loc[3];
/* Other levels */
- int current_stride = 1 << (ped->max_lvl - (ped->updated_lvl + 1));
+ int current_stride = 1 << max_ii(0, ped->max_lvl - ped->updated_lvl);
int prev_stride = current_stride << 1;
+
while (!valid_cell) {
cell_id = ped->updated_cells;
lightprobe_cell_grid_location_get(egrid, cell_id, grid_loc);
@@ -1381,11 +1382,11 @@ skip_rendering:
ped->updated_lvl++;
ped->updated_cells = 0;
- if (ped->updated_lvl == ped->max_lvl) {
+ if (ped->updated_lvl > ped->max_lvl) {
ped->need_update = false;
}
- egrid->level_bias = (float)(1 << (ped->max_lvl - ped->updated_lvl));
+ egrid->level_bias = (float)(1 << max_ii(0, ped->max_lvl - ped->updated_lvl + 1));
DRW_uniformbuffer_update(sldata->grid_ubo, &sldata->probes->grid_data);
}
#if 0