light: add "_lightignore" model key
This commit is contained in:
parent
e3bd63eef2
commit
57834c438b
|
|
@ -217,6 +217,7 @@ public:
|
|||
lockable_vec_t minlight, shadow, shadowself, dirt, phong, phong_angle;
|
||||
lockable_string_t minlight_exclude;
|
||||
lockable_vec3_t minlight_color;
|
||||
lockable_bool_t lightignore;
|
||||
|
||||
float getResolvedPhongAngle() const {
|
||||
const float s = phong_angle.floatValue();
|
||||
|
|
@ -240,7 +241,9 @@ public:
|
|||
phong { "phong", 0 },
|
||||
phong_angle { "phong_angle", 0 },
|
||||
minlight_exclude { "minlight_exclude", "" },
|
||||
minlight_color { "minlight_color", 255, 255, 255, vec3_transformer_t::NORMALIZE_COLOR_TO_255 }
|
||||
minlight_color { "minlight_color", 255, 255, 255, vec3_transformer_t::NORMALIZE_COLOR_TO_255 },
|
||||
lightignore { "lightignore", false }
|
||||
|
||||
{
|
||||
VectorSet(offset, 0, 0, 0);
|
||||
}
|
||||
|
|
@ -248,7 +251,7 @@ public:
|
|||
settingsdict_t settings() {
|
||||
return {{
|
||||
&minlight, &shadow, &shadowself, &dirt, &phong, &phong_angle,
|
||||
&minlight_exclude, &minlight_color
|
||||
&minlight_exclude, &minlight_color, &lightignore
|
||||
}};
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1512,6 +1512,10 @@ LightFace_Min(const bsp2_t *bsp, const bsp2_dface_t *face,
|
|||
Lightmap_Save(lightmaps, lightsurf, lightmap, 0);
|
||||
}
|
||||
|
||||
// FIXME: Refactor this?
|
||||
if (lightsurf->modelinfo->lightignore.boolValue())
|
||||
return;
|
||||
|
||||
/* Cast rays for local minlight entities */
|
||||
const dmodel_t *shadowself = modelinfo->shadowself.boolValue() ? modelinfo->model : NULL;
|
||||
for (const auto &entity : GetLights()) {
|
||||
|
|
@ -2351,6 +2355,7 @@ LightFace(bsp2_dface_t *face, facesup_t *facesup, const modelinfo_t *modelinfo,
|
|||
total_samplepoints += lightsurf->numpoints;
|
||||
|
||||
/* positive lights */
|
||||
if (!modelinfo->lightignore.boolValue()) {
|
||||
for (const auto &entity : GetLights())
|
||||
{
|
||||
if (entity.getFormula() == LF_LOCALMIN)
|
||||
|
|
@ -2364,6 +2369,7 @@ LightFace(bsp2_dface_t *face, facesup_t *facesup, const modelinfo_t *modelinfo,
|
|||
|
||||
/* add indirect lighting */
|
||||
LightFace_Bounce(ctx->bsp, face, lightsurf, lightmaps);
|
||||
}
|
||||
|
||||
/* minlight - Use the greater of global or model minlight. */
|
||||
if (lightsurf->minlight > cfg.minlight.floatValue())
|
||||
|
|
@ -2377,6 +2383,7 @@ LightFace(bsp2_dface_t *face, facesup_t *facesup, const modelinfo_t *modelinfo,
|
|||
}
|
||||
|
||||
/* negative lights */
|
||||
if (!modelinfo->lightignore.boolValue()) {
|
||||
for (const auto &entity : GetLights())
|
||||
{
|
||||
if (entity.getFormula() == LF_LOCALMIN)
|
||||
|
|
@ -2388,6 +2395,7 @@ LightFace(bsp2_dface_t *face, facesup_t *facesup, const modelinfo_t *modelinfo,
|
|||
if (sun.sunlight < 0)
|
||||
LightFace_Sky (&sun, lightsurf, lightmaps);
|
||||
}
|
||||
}
|
||||
|
||||
/* bounce debug */
|
||||
// TODO: add a BounceDebug function that clear the lightmap to make the code more clear
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
"classname" "worldspawn"
|
||||
"wad" "free_wad.wad;fence.wad"
|
||||
"light" "4"
|
||||
"_dirt" "1"
|
||||
// brush 0
|
||||
{
|
||||
( 1184 -640 80 ) ( 1184 -640 81 ) ( 1184 -639 80 ) narrow 64 -0 -0 1 1
|
||||
|
|
@ -1957,3 +1958,71 @@
|
|||
"delay" "2"
|
||||
"style" "2"
|
||||
}
|
||||
// entity 84
|
||||
{
|
||||
"classname" "func_wall"
|
||||
"_lightignore" "1"
|
||||
"_shadowself" "1"
|
||||
// brush 0
|
||||
{
|
||||
( 592 -384 112 ) ( 656 -384 128 ) ( 656 -384 112 ) brownmetal -0 48 -0 1 1
|
||||
( 592 -480 112 ) ( 592 -368 128 ) ( 592 -480 128 ) brownmetal -0 48 -0 1 1
|
||||
( 592 -480 112 ) ( 656 -368 112 ) ( 592 -368 112 ) brownmetal -0 16 -0 1 1
|
||||
( 592 -480 144 ) ( 656 -368 144 ) ( 656 -480 144 ) brownmetal -0 16 -0 1 1
|
||||
( 592 -368 112 ) ( 656 -368 128 ) ( 592 -368 128 ) brownmetal -0 48 -0 1 1
|
||||
( 656 -480 112 ) ( 656 -368 128 ) ( 656 -368 112 ) brownmetal -0 48 -0 1 1
|
||||
}
|
||||
// brush 1
|
||||
{
|
||||
( 592 -480 112 ) ( 656 -480 128 ) ( 656 -480 112 ) brownmetal -0 48 -0 1 1
|
||||
( 592 -576 112 ) ( 592 -464 128 ) ( 592 -576 128 ) brownmetal 32 48 -0 1 1
|
||||
( 592 -576 112 ) ( 656 -464 112 ) ( 592 -464 112 ) brownmetal -0 -16 -0 1 1
|
||||
( 592 -576 144 ) ( 656 -464 144 ) ( 656 -576 144 ) brownmetal -0 -16 -0 1 1
|
||||
( 592 -464 112 ) ( 656 -464 128 ) ( 592 -464 128 ) brownmetal -0 48 -0 1 1
|
||||
( 656 -576 112 ) ( 656 -464 128 ) ( 656 -464 112 ) brownmetal 32 48 -0 1 1
|
||||
}
|
||||
// brush 2
|
||||
{
|
||||
( 592 -480 80 ) ( 656 -480 96 ) ( 656 -480 80 ) brownmetal 64 80 0 1 1
|
||||
( 592 -480 80 ) ( 592 -368 96 ) ( 592 -480 96 ) brownmetal 64 80 0 1 1
|
||||
( 592 -480 80 ) ( 656 -368 80 ) ( 592 -368 80 ) brownmetal 64 80 0 1 1
|
||||
( 592 -480 112 ) ( 656 -368 112 ) ( 656 -480 112 ) brownmetal -0 16 -0 1 1
|
||||
( 592 -368 80 ) ( 656 -368 96 ) ( 592 -368 96 ) brownmetal 64 80 0 1 1
|
||||
( 656 -480 80 ) ( 656 -368 96 ) ( 656 -368 80 ) brownmetal 64 80 0 1 1
|
||||
}
|
||||
}
|
||||
// entity 85
|
||||
{
|
||||
"classname" "func_wall"
|
||||
"_lightignore" "1"
|
||||
"_minlight" "100"
|
||||
"_minlight_color" "50 50 255"
|
||||
"_shadowself" "1"
|
||||
// brush 0
|
||||
{
|
||||
( 592 -560 128 ) ( 656 -560 144 ) ( 656 -560 128 ) brownmetal -0 -0 -0 1 1
|
||||
( 592 -656 128 ) ( 592 -544 144 ) ( 592 -656 144 ) brownmetal 48 -0 -0 1 1
|
||||
( 592 -656 128 ) ( 656 -544 128 ) ( 592 -544 128 ) brownmetal -0 -32 -0 1 1
|
||||
( 592 -656 160 ) ( 656 -544 160 ) ( 656 -656 160 ) brownmetal -0 -32 -0 1 1
|
||||
( 592 -544 128 ) ( 656 -544 144 ) ( 592 -544 144 ) brownmetal -0 -0 -0 1 1
|
||||
( 656 -656 128 ) ( 656 -544 144 ) ( 656 -544 128 ) brownmetal 48 -0 -0 1 1
|
||||
}
|
||||
// brush 1
|
||||
{
|
||||
( 592 -656 128 ) ( 656 -656 144 ) ( 656 -656 128 ) brownmetal -0 -0 -0 1 1
|
||||
( 592 -752 128 ) ( 592 -640 144 ) ( 592 -752 144 ) brownmetal 16 -0 -0 1 1
|
||||
( 592 -752 128 ) ( 656 -640 128 ) ( 592 -640 128 ) brownmetal -0 -0 -0 1 1
|
||||
( 592 -752 160 ) ( 656 -640 160 ) ( 656 -752 160 ) brownmetal -0 -0 -0 1 1
|
||||
( 592 -640 128 ) ( 656 -640 144 ) ( 592 -640 144 ) brownmetal -0 -0 -0 1 1
|
||||
( 656 -752 128 ) ( 656 -640 144 ) ( 656 -640 128 ) brownmetal 16 -0 -0 1 1
|
||||
}
|
||||
// brush 2
|
||||
{
|
||||
( 592 -656 96 ) ( 656 -656 112 ) ( 656 -656 96 ) brownmetal -0 32 -0 1 1
|
||||
( 592 -656 96 ) ( 592 -544 112 ) ( 592 -656 112 ) brownmetal 48 32 -0 1 1
|
||||
( 592 -656 96 ) ( 656 -544 96 ) ( 592 -544 96 ) brownmetal -0 -32 -0 1 1
|
||||
( 592 -656 128 ) ( 656 -544 128 ) ( 656 -656 128 ) brownmetal -0 -32 -0 1 1
|
||||
( 592 -544 96 ) ( 656 -544 112 ) ( 592 -544 112 ) brownmetal -0 32 -0 1 1
|
||||
( 656 -656 96 ) ( 656 -544 112 ) ( 656 -544 96 ) brownmetal 48 32 -0 1 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue