Commit: cc772e4bca6ddb7b040af1e050f1376a778a8718
Author: Clément Foucault
Date:   Sat Sep 30 19:37:26 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBcc772e4bca6ddb7b040af1e050f1376a778a8718

Eevee: LightGrid: Fix progressive rendering.

===================================================================

M       source/blender/draw/engines/eevee/eevee_lightprobes.c

===================================================================

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

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to