Commit: bd9a328b588d32d82a6ee03c2256b21abfc81d39
Author: Clément Foucault
Date:   Sat Jun 17 01:56:45 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBbd9a328b588d32d82a6ee03c2256b21abfc81d39

Eevee: Fix Planar Probe offset changing influence calculation.

===================================================================

M       source/blender/draw/engines/eevee/eevee_lightprobes.c
M       source/blender/draw/engines/eevee/eevee_private.h

===================================================================

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;

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to