diff options
Diffstat (limited to 'source/blender/draw/modes/object_mode.c')
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 0ae5352f4c9..ded2bc68062 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -1547,6 +1547,7 @@ typedef struct OBJECT_LightProbeEngineData { float increment_y[3]; float increment_z[3]; float corner[3]; + unsigned int cell_count; } OBJECT_LightProbeEngineData; static void DRW_shgroup_lightprobe(OBJECT_StorageList *stl, OBJECT_PassList *psl, Object *ob, ViewLayer *view_layer) @@ -1600,9 +1601,8 @@ static void DRW_shgroup_lightprobe(OBJECT_StorageList *stl, OBJECT_PassList *psl mul_m4_v3(ob->obmat, prb_data->increment_z); sub_v3_v3(prb_data->increment_z, prb_data->corner); - DRWShadingGroup *grp = DRW_shgroup_instance_create(e_data.lightprobe_grid_sh, psl->lightprobes, - DRW_cache_sphere_get(), NULL); - DRW_shgroup_set_instance_count(grp, prb->grid_resolution_x * prb->grid_resolution_y * prb->grid_resolution_z); + prb_data->cell_count = prb->grid_resolution_x * prb->grid_resolution_y * prb->grid_resolution_z; + DRWShadingGroup *grp = DRW_shgroup_create(e_data.lightprobe_grid_sh, psl->lightprobes); DRW_shgroup_uniform_vec4(grp, "color", color, 1); DRW_shgroup_uniform_vec3(grp, "corner", prb_data->corner, 1); DRW_shgroup_uniform_vec3(grp, "increment_x", prb_data->increment_x, 1); @@ -1610,6 +1610,7 @@ static void DRW_shgroup_lightprobe(OBJECT_StorageList *stl, OBJECT_PassList *psl DRW_shgroup_uniform_vec3(grp, "increment_z", prb_data->increment_z, 1); DRW_shgroup_uniform_ivec3(grp, "grid_resolution", &prb->grid_resolution_x, 1); DRW_shgroup_uniform_float(grp, "sphere_size", &prb->data_draw_size, 1); + DRW_shgroup_call_instances_add(grp, DRW_cache_sphere_get(), NULL, &prb_data->cell_count); } else if (prb->type == LIGHTPROBE_TYPE_CUBE) { prb_data->draw_size = prb->data_draw_size * 0.1f; |