Skip to content

Commit

Permalink
light: fix nan's (fully black lightmap) in some cases when using _sur…
Browse files Browse the repository at this point in the history
…face lights
  • Loading branch information
ericwa committed Dec 24, 2023
1 parent 73b694a commit 89908df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions light/entities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,10 @@ static void CreateSurfaceLightOnFaceSubdivision(const mface_t *face, const model
const light_t *surflight_template, const mbsp_t *bsp, int numverts, const qvec3f *verts)
{
qvec3f midpoint = qv::PolyCentroid(verts, verts + numverts);
for (int i = 0; i < 3; ++i)
if (std::isnan(midpoint[i]))
return;

qplane3f plane = Face_Plane(bsp, face);

/* Nudge 2 units (by default) along face normal */
Expand Down

0 comments on commit 89908df

Please sign in to comment.