diff --git a/include/light/phong.hh b/include/light/phong.hh index 3ef6defb..49e61f27 100644 --- a/include/light/phong.hh +++ b/include/light/phong.hh @@ -49,6 +49,7 @@ bool FacesSmoothed(const mface_t *f1, const mface_t *f2); const std::set &GetSmoothFaces(const mface_t *face); const std::vector &GetPlaneFaces(const mface_t *face); const mface_t *Face_EdgeIndexSmoothed(const mbsp_t *bsp, const mface_t *f, const int edgeindex); +int Q2_FacePhongValue(const mbsp_t *bsp, const mface_t *face); /// a directed edge can be used by more than one face, e.g. two cube touching just along an edge using edgeToFaceMap_t = std::map, std::vector>; diff --git a/light/ltface.cc b/light/ltface.cc index 0b033c94..4025ec1f 100644 --- a/light/ltface.cc +++ b/light/ltface.cc @@ -874,7 +874,7 @@ static std::unique_ptr Lightsurf_Init( lightsurf->lightmapscale = (facesup && facesup->lmscale > modelinfo->lightmapscale) ? facesup->lmscale : modelinfo->lightmapscale; const surfflags_t &extended_flags = extended_texinfo_flags[face->texinfo]; - lightsurf->curved = extended_flags.phong_angle != 0; + lightsurf->curved = extended_flags.phong_angle != 0 || Q2_FacePhongValue(bsp, face); // nodirt if (modelinfo->dirt.isChanged()) { diff --git a/light/phong.cc b/light/phong.cc index 7d80f840..e2b697fa 100644 --- a/light/phong.cc +++ b/light/phong.cc @@ -389,7 +389,7 @@ static vector MakeFaceCache(const mbsp_t *bsp) * Q2: Returns nonzero if phong is requested on this face, in which case that is * the face tag to smooth with. Otherwise returns 0. */ -static int Q2_FacePhongValue(const mbsp_t *bsp, const mface_t *face) +int Q2_FacePhongValue(const mbsp_t *bsp, const mface_t *face) { const mtexinfo_t *texinfo = BSP_GetTexinfo(bsp, face->texinfo); if (texinfo != nullptr) {