light: CalcualateVertexNormals: skip degenerate faces

This commit is contained in:
Eric Wasylishen 2016-09-07 15:12:19 -06:00
parent 44d6828049
commit 66184a3849
1 changed files with 5 additions and 0 deletions

View File

@ -509,6 +509,11 @@ CalcualateVertexNormals(const bsp2_t *bsp)
for (int i = 0; i < bsp->numfaces; i++)
{
const bsp2_dface_t *f = &bsp->dfaces[i];
if (f->numedges < 3) {
logprint("CalcualateVertexNormals: face %d is degenerate with %d edges\n", i, f->numedges);
continue;
}
const auto &neighboursToSmooth = smoothFaces[f];
vec3_t f_norm;