light: fix face normal smoothing condition
This commit is contained in:
parent
d426c8d9da
commit
007696a734
|
|
@ -538,11 +538,10 @@ CalcualateVertexNormals(const bsp2_t *bsp)
|
||||||
Face_Normal(bsp, f2, f2_norm);
|
Face_Normal(bsp, f2, f2_norm);
|
||||||
|
|
||||||
const vec_t cosangle = DotProduct(f_norm, f2_norm);
|
const vec_t cosangle = DotProduct(f_norm, f2_norm);
|
||||||
const vec_t angle = acos(qmax(qmin(1.0f, cosangle), 0.0f));
|
const vec_t cosmaxangle = cos(DEG2RAD(qmin(f_smoothangle, f2_smoothangle)));
|
||||||
const vec_t max_angle = DEG2RAD(qmin(f_smoothangle, f2_smoothangle));
|
|
||||||
|
|
||||||
// check the angle between the face normals
|
// check the angle between the face normals
|
||||||
if (angle < max_angle) {
|
if (cosangle >= cosmaxangle) {
|
||||||
smoothFaces[f].insert(f2);
|
smoothFaces[f].insert(f2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue