diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-06-17 02:56:45 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-06-19 11:47:56 +0300 |
commit | bd9a328b588d32d82a6ee03c2256b21abfc81d39 (patch) | |
tree | 823cd9278672a193bbf43e8f85626581ee1af467 /source/blender | |
parent | 0993af54842ad9ad43a45fded7e397c6eaafb9a0 (diff) |
Eevee: Fix Planar Probe offset changing influence calculation.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lightprobes.c | 10 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_private.h | 1 |
2 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index a58c338b14b..47dc9ababeb 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -470,9 +470,13 @@ static void EEVEE_planar_reflections_updates(EEVEE_SceneLayerData *sldata) float refpoint[3]; copy_v3_v3(eplanar->plane_equation, ob->obmat[2]); normalize_v3(eplanar->plane_equation); /* plane normal */ + eplanar->plane_equation[3] = -dot_v3v3(eplanar->plane_equation, ob->obmat[3]); + + /* Compute offset plane equation (fix missing texels near reflection plane). */ + copy_v3_v3(ped->planer_eq_offset, eplanar->plane_equation); mul_v3_v3fl(refpoint, eplanar->plane_equation, -probe->clipsta); add_v3_v3(refpoint, ob->obmat[3]); - eplanar->plane_equation[3] = -dot_v3v3(eplanar->plane_equation, refpoint); + ped->planer_eq_offset[3] = -dot_v3v3(eplanar->plane_equation, refpoint); /* Compute XY clip planes. */ normalize_v3_v3(eplanar->clip_vec_x, ob->obmat[0]); @@ -1136,13 +1140,11 @@ update_planar: EEVEE_LightProbeEngineData *ped = EEVEE_lightprobe_data_get(ob); if (ped->need_update) { - EEVEE_PlanarReflection *eplanar = &pinfo->planar_data[i]; - /* Temporary Remove all planar reflections (avoid lag effect). */ int tmp_num_planar = pinfo->num_planar; pinfo->num_planar = 0; - render_scene_to_planar(vedata, i, ped->viewmat, ped->persmat, eplanar->plane_equation); + render_scene_to_planar(vedata, i, ped->viewmat, ped->persmat, ped->planer_eq_offset); /* Restore */ pinfo->num_planar = tmp_num_planar; diff --git a/source/blender/draw/engines/eevee/eevee_private.h b/source/blender/draw/engines/eevee/eevee_private.h index ddda9cd3bf8..72419831795 100644 --- a/source/blender/draw/engines/eevee/eevee_private.h +++ b/source/blender/draw/engines/eevee/eevee_private.h @@ -344,6 +344,7 @@ typedef struct EEVEE_LightProbeEngineData { /* For planar reflection rendering */ float viewmat[4][4]; float persmat[4][4]; + float planer_eq_offset[4]; struct ListBase captured_object_list; } EEVEE_LightProbeEngineData; |