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-06-15 01:23:37 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-06-15 01:57:16 +0300
commitf5203e6cba27d8b0ed132fabe7c13866167000f0 (patch)
tree9ae3bc3ebf7c257e2576f208e77f6a31fa4647fa /source/blender/draw/modes/object_mode.c
parent634dbfa2edb1f43d29051c696a3ccc645887407f (diff)
Probe: Fix display of the Influence of grid probes.
Diffstat (limited to 'source/blender/draw/modes/object_mode.c')
-rw-r--r--source/blender/draw/modes/object_mode.c18
1 files changed, 12 insertions, 6 deletions
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);
}
}