From 707acbc9c5e54359d90db173eea6114da89973b9 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Mon, 25 Mar 2019 20:24:39 -0600 Subject: [PATCH] light: fix lighting artifacts with _mirrorinside. Was missing a plane side check, so the inside faces were incorrectly considered as neighbours for distributing sample points onto. Fixes #236 --- light/phong.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/light/phong.cc b/light/phong.cc index 93872721..7724fec5 100644 --- a/light/phong.cc +++ b/light/phong.cc @@ -311,9 +311,12 @@ Face_EdgeIndexSmoothed(const mbsp_t *bsp, const bsp2_dface_t *f, const int edgei // Invalid face, e.g. with vertex numbers: [0, 1, 0, 2] continue; } - + + const bool sameplane = (neighbour->planenum == f->planenum + && neighbour->side == f->side); + // Check if these faces are smoothed or on the same plane - if (!(FacesSmoothed(f, neighbour) || neighbour->planenum == f->planenum)) { + if (!(FacesSmoothed(f, neighbour) || sameplane)) { continue; }