qbsp, light: support _lightignore on func_detail/group

This commit is contained in:
Eric Wasylishen 2019-12-09 00:09:20 -07:00
parent 5e74b4d0bb
commit a4c1ce6ff6
4 changed files with 14 additions and 4 deletions

View File

@ -353,6 +353,8 @@ typedef struct {
#define TEX_PHONG_ANGLE_CONCAVE_MASK (255ULL << TEX_PHONG_ANGLE_CONCAVE_SHIFT) /* 8 bit value. if non zero, overrides _phong_angle for concave joints. */
#define TEX_NOBOUNCE (1ULL << 53) /* light doesn't bounce off this face */
#define TEX_NOMINLIGHT (1ULL << 54) /* opt out of minlight on this face */
#define TEX_NOEXPAND (1ULL << 55) /* don't expand this face for larger clip hulls */
#define TEX_LIGHTIGNORE (1ULL << 56)
// Q2 Texture flags.
#define Q2_SURF_LIGHT 0x1 // value will hold the light strength

View File

@ -143,6 +143,7 @@
#define TEX_NOBOUNCE (1ULL << 53) /* light doesn't bounce off this face */
#define TEX_NOMINLIGHT (1ULL << 54) /* opt out of minlight on this face */
#define TEX_NOEXPAND (1ULL << 55) /* don't expand this face for larger clip hulls */
#define TEX_LIGHTIGNORE (1ULL << 56)
/*
* The quality of the bsp output is highly sensitive to these epsilon values.

View File

@ -1689,7 +1689,8 @@ LightFace_Min(const mbsp_t *bsp, const bsp2_dface_t *face,
}
// FIXME: Refactor this?
if (lightsurf->modelinfo->lightignore.boolValue())
if (lightsurf->modelinfo->lightignore.boolValue()
|| (extended_flags & TEX_LIGHTIGNORE) != 0)
return;
/* Cast rays for local minlight entities */
@ -3244,9 +3245,12 @@ LightFace(const mbsp_t *bsp, bsp2_dface_t *face, facesup_t *facesup, const globa
if (debugmode == debugmode_none) {
total_samplepoints += lightsurf->numpoints;
const uint64_t extended_flags = extended_texinfo_flags[face->texinfo];
/* positive lights */
if (!modelinfo->lightignore.boolValue()) {
if (!(modelinfo->lightignore.boolValue()
|| (extended_flags & TEX_LIGHTIGNORE) != 0)) {
for (const auto &entity : GetLights())
{
if (entity.getFormula() == LF_LOCALMIN)
@ -3282,7 +3286,8 @@ LightFace(const mbsp_t *bsp, bsp2_dface_t *face, facesup_t *facesup, const globa
}
/* negative lights */
if (!modelinfo->lightignore.boolValue()) {
if (!(modelinfo->lightignore.boolValue()
|| (extended_flags & TEX_LIGHTIGNORE) != 0)) {
for (const auto &entity : GetLights())
{
if (entity.getFormula() == LF_LOCALMIN)

View File

@ -312,6 +312,8 @@ FindTexinfoEnt(mtexinfo_t *texinfo, const mapentity_t *entity)
flags |= TEX_NOBOUNCE;
if (atoi(ValueForKey(entity, "_minlight")) == -1)
flags |= TEX_NOMINLIGHT;
if (atoi(ValueForKey(entity, "_lightignore")) == 1)
flags |= TEX_LIGHTIGNORE;
// "_minlight_exclude", "_minlight_exclude2", "_minlight_exclude3"...
for (int i = 0; i <= 9; i++) {