qbsp, light: support _minlight_exclude on func_group, detail, etc.
This commit is contained in:
parent
6660c5fc09
commit
b343b9504a
|
|
@ -351,6 +351,7 @@ typedef struct {
|
||||||
#define TEX_PHONG_ANGLE_CONCAVE_SHIFT 45
|
#define TEX_PHONG_ANGLE_CONCAVE_SHIFT 45
|
||||||
#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_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_NOBOUNCE (1ULL << 53) /* light doesn't bounce off this face */
|
||||||
|
#define TEX_NOMINLIGHT (1ULL << 54) /* opt out of minlight on this face */
|
||||||
|
|
||||||
// Q2 Texture flags.
|
// Q2 Texture flags.
|
||||||
#define Q2_SURF_LIGHT 0x1 // value will hold the light strength
|
#define Q2_SURF_LIGHT 0x1 // value will hold the light strength
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,6 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
lockable_vec_t minlight, shadow, shadowself, shadowworldonly, switchableshadow, switchshadstyle, dirt, phong, phong_angle, alpha;
|
lockable_vec_t minlight, shadow, shadowself, shadowworldonly, switchableshadow, switchshadstyle, dirt, phong, phong_angle, alpha;
|
||||||
lockable_string_t minlight_exclude;
|
|
||||||
lockable_vec3_t minlight_color;
|
lockable_vec3_t minlight_color;
|
||||||
lockable_bool_t lightignore;
|
lockable_bool_t lightignore;
|
||||||
|
|
||||||
|
|
@ -238,7 +237,6 @@ public:
|
||||||
phong { "phong", 0 },
|
phong { "phong", 0 },
|
||||||
phong_angle { "phong_angle", 0 },
|
phong_angle { "phong_angle", 0 },
|
||||||
alpha { "alpha", 1.0f },
|
alpha { "alpha", 1.0f },
|
||||||
minlight_exclude { "minlight_exclude", "" },
|
|
||||||
minlight_color { strings{"minlight_color", "mincolor"}, 255, 255, 255, vec3_transformer_t::NORMALIZE_COLOR_TO_255 },
|
minlight_color { strings{"minlight_color", "mincolor"}, 255, 255, 255, vec3_transformer_t::NORMALIZE_COLOR_TO_255 },
|
||||||
lightignore { "lightignore", false }
|
lightignore { "lightignore", false }
|
||||||
{
|
{
|
||||||
|
|
@ -248,7 +246,7 @@ public:
|
||||||
settingsdict_t settings() {
|
settingsdict_t settings() {
|
||||||
return {{
|
return {{
|
||||||
&minlight, &shadow, &shadowself, &shadowworldonly, &switchableshadow, &switchshadstyle, &dirt, &phong, &phong_angle, &alpha,
|
&minlight, &shadow, &shadowself, &shadowworldonly, &switchableshadow, &switchshadstyle, &dirt, &phong, &phong_angle, &alpha,
|
||||||
&minlight_exclude, &minlight_color, &lightignore
|
&minlight_color, &lightignore
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,7 @@
|
||||||
#define TEX_PHONG_ANGLE_CONCAVE_SHIFT 45
|
#define TEX_PHONG_ANGLE_CONCAVE_SHIFT 45
|
||||||
#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_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_NOBOUNCE (1ULL << 53) /* light doesn't bounce off this face */
|
||||||
|
#define TEX_NOMINLIGHT (1ULL << 54) /* opt out of minlight on this face */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The quality of the bsp output is highly sensitive to these epsilon values.
|
* The quality of the bsp output is highly sensitive to these epsilon values.
|
||||||
|
|
|
||||||
|
|
@ -1635,11 +1635,11 @@ LightFace_Min(const mbsp_t *bsp, const bsp2_dface_t *face,
|
||||||
const globalconfig_t &cfg = *lightsurf->cfg;
|
const globalconfig_t &cfg = *lightsurf->cfg;
|
||||||
const modelinfo_t *modelinfo = lightsurf->modelinfo;
|
const modelinfo_t *modelinfo = lightsurf->modelinfo;
|
||||||
|
|
||||||
const char *texname = Face_TextureName(bsp, face);
|
const uint64_t extended_flags = extended_texinfo_flags[face->texinfo];
|
||||||
if (texname[0] != '\0' && modelinfo->minlight_exclude.stringValue() == std::string{ texname }) {
|
if ((extended_flags & TEX_NOMINLIGHT) != 0) {
|
||||||
return; /* this texture is excluded from minlight */
|
return; /* this face is excluded from minlight */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find a style 0 lightmap */
|
/* Find a style 0 lightmap */
|
||||||
lightmap_t *lightmap = Lightmap_ForStyle(lightmaps, 0, lightsurf);
|
lightmap_t *lightmap = Lightmap_ForStyle(lightmaps, 0, lightsurf);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -296,6 +296,14 @@ FindTexinfoEnt(mtexinfo_t *texinfo, const mapentity_t *entity)
|
||||||
flags |= TEX_NODIRT;
|
flags |= TEX_NODIRT;
|
||||||
if (atoi(ValueForKey(entity, "_bounce")) == -1)
|
if (atoi(ValueForKey(entity, "_bounce")) == -1)
|
||||||
flags |= TEX_NOBOUNCE;
|
flags |= TEX_NOBOUNCE;
|
||||||
|
if (atoi(ValueForKey(entity, "_minlight")) == -1)
|
||||||
|
flags |= TEX_NOMINLIGHT;
|
||||||
|
|
||||||
|
const char *excludeTex = ValueForKey(entity, "_minlight_exclude");
|
||||||
|
if (strlen(excludeTex) > 0 && !Q_strcasecmp(texname, excludeTex)) {
|
||||||
|
flags |= TEX_NOMINLIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
if (shadow == -1)
|
if (shadow == -1)
|
||||||
flags |= TEX_NOSHADOW;
|
flags |= TEX_NOSHADOW;
|
||||||
if (!Q_strcasecmp("func_detail_illusionary", ValueForKey(entity, "classname"))) {
|
if (!Q_strcasecmp("func_detail_illusionary", ValueForKey(entity, "classname"))) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue