[Bf-blender-cvs] [f5203e6cba2] blender2.8: Probe: Fix display of the Influence of grid probes.
Clément Foucault
noreply at git.blender.org
Thu Jun 15 01:16:30 CEST 2017
Commit: f5203e6cba27d8b0ed132fabe7c13866167000f0
Author: Clément Foucault
Date: Thu Jun 15 00:23:37 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBf5203e6cba27d8b0ed132fabe7c13866167000f0
Probe: Fix display of the Influence of grid probes.
===================================================================
M source/blender/draw/modes/object_mode.c
M source/blender/makesdna/DNA_lightprobe_types.h
===================================================================
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index c5ffbf0fca3..c7d3bedb712 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -1410,25 +1410,31 @@ static void DRW_shgroup_speaker(OBJECT_StorageList *stl, Object *ob, SceneLayer
static void DRW_shgroup_lightprobe(OBJECT_StorageList *stl, Object *ob, SceneLayer *sl)
{
- static float one = 1.0f;
float *color;
LightProbe *prb = (LightProbe *)ob->data;
DRW_object_wire_theme_get(ob, sl, &color);
- prb->distfalloff = (1.0f - prb->falloff) * prb->distinf;
DRW_shgroup_call_dynamic_add(stl->g_data->probe, ob->obmat[3], color);
if ((prb->flag & LIGHTPROBE_FLAG_SHOW_INFLUENCE) != 0) {
+
+ prb->distfalloff = (1.0f - prb->falloff) * prb->distinf;
+ prb->distgridinf = prb->distinf;
+
if (prb->type == LIGHTPROBE_TYPE_GRID) {
- DRW_shgroup_call_dynamic_add(stl->g_data->cube, color, &one, ob->obmat);
+ prb->distfalloff += 1.0f;
+ prb->distgridinf += 1.0f;
}
- else if (prb->attenuation_type == LIGHTPROBE_SHAPE_BOX) {
- DRW_shgroup_call_dynamic_add(stl->g_data->cube, color, &prb->distinf, ob->obmat);
+
+ if (prb->type == LIGHTPROBE_TYPE_GRID ||
+ prb->attenuation_type == LIGHTPROBE_SHAPE_BOX)
+ {
+ DRW_shgroup_call_dynamic_add(stl->g_data->cube, color, &prb->distgridinf, ob->obmat);
DRW_shgroup_call_dynamic_add(stl->g_data->cube, color, &prb->distfalloff, ob->obmat);
}
else {
- DRW_shgroup_call_dynamic_add(stl->g_data->sphere, color, &prb->distinf, ob->obmat);
+ DRW_shgroup_call_dynamic_add(stl->g_data->sphere, color, &prb->distgridinf, ob->obmat);
DRW_shgroup_call_dynamic_add(stl->g_data->sphere, color, &prb->distfalloff, ob->obmat);
}
}
diff --git a/source/blender/makesdna/DNA_lightprobe_types.h b/source/blender/makesdna/DNA_lightprobe_types.h
index b6e2f0cecfe..779528dd3d8 100644
--- a/source/blender/makesdna/DNA_lightprobe_types.h
+++ b/source/blender/makesdna/DNA_lightprobe_types.h
@@ -65,7 +65,8 @@ typedef struct LightProbe {
float data_draw_size;
/* Runtime display data */
- float distfalloff;
+ float distfalloff, distgridinf;
+ float pad;
} LightProbe;
/* Probe->type */
More information about the Bf-blender-cvs
mailing list