diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-06-15 01:23:37 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-06-15 01:57:16 +0300 |
commit | f5203e6cba27d8b0ed132fabe7c13866167000f0 (patch) | |
tree | 9ae3bc3ebf7c257e2576f208e77f6a31fa4647fa /source | |
parent | 634dbfa2edb1f43d29051c696a3ccc645887407f (diff) |
Probe: Fix display of the Influence of grid probes.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 18 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_lightprobe_types.h | 3 |
2 files changed, 14 insertions, 7 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); } } 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 */ |