light: make bounce of styled lights opt in with "_bouncestyled" worldspawn key

This commit is contained in:
Eric Wasylishen 2017-03-27 16:44:04 -06:00
parent 30b8503ccf
commit 10386581a6
4 changed files with 33 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2017-03-27 TyrUtils-ericw 0.15.10-beta2
- light: styled lights no longer bounce by default, set "_bouncestyled" "1" to enable.
2017-03-26 TyrUtils-ericw 0.15.10-beta1
- light: fix Linux binary

View File

@ -263,6 +263,7 @@ public:
/* bounce */
lockable_bool_t bounce;
lockable_bool_t bouncestyled;
lockable_vec_t bouncescale, bouncecolorscale;
/* sunlight */
@ -305,6 +306,7 @@ public:
/* bounce */
bounce {"bounce", false},
bouncestyled {"bouncestyled", false},
bouncescale {"bouncescale", 1.0f, 0.0f, 100.0f},
bouncecolorscale {"bouncecolorscale", 0.0f, 0.0f, 1.0f},
@ -334,8 +336,7 @@ public:
&dirtMode, &dirtDepth, &dirtScale, &dirtGain, &dirtAngle,
&minlightDirt,
&phongallowed,
&bounce,
&bouncescale, &bouncecolorscale,
&bounce, &bouncestyled, &bouncescale, &bouncecolorscale,
&sunlight,
&sunlight_color,
&sun2,

View File

@ -1205,7 +1205,14 @@ static void LightFace_SampleMipTex(miptex_t *tex, const float *projectionmatrix,
}
}
// FIXME: factor out / merge with LightFace
/*
* ================
* GetDirectLighting
*
* Mesaures direct lighting at a point, currently only used for bounce lighting.
* FIXME: factor out / merge with LightFace
* ================
*/
std::map<int, glm::vec3>
GetDirectLighting(const globalconfig_t &cfg, raystream_t *rs, const vec3_t origin, const vec3_t normal)
{
@ -1222,6 +1229,11 @@ GetDirectLighting(const globalconfig_t &cfg, raystream_t *rs, const vec3_t origi
float surfpointToLightDist;
vec3_t color, normalcontrib;
// Skip styled lights if "bouncestyled" setting is off.
if (entity.style.intValue() != 0 && !cfg.bouncestyled.boolValue()) {
continue;
}
GetLightContrib(cfg, &entity, normal, origin, false, color, surfpointToLightDir, normalcontrib, &surfpointToLightDist);
const float dirt = Dirt_GetScaleFactor(cfg, occlusion, &entity, surfpointToLightDist, /* FIXME: pass */ nullptr);

View File

@ -213,6 +213,19 @@ Adjust brightness of final lightmap. Default 1, >1 is brighter, <1 is darker.
.IP "\fB""_lightmap_scale"" ""n""\fP"
Forces all surfaces+submodels to use this specific lightmap scale. Removes "LMSHIFT" field.
.IP "\fB""_bounce"" ""n""\fP"
1 enables bounce lighting, disabled by default.
.IP "\fB""_bouncescale"" ""n""\fP"
Scales brightness of bounce lighting, default 1.
.IP "\fB""_bouncecolorscale"" ""n""\fP"
Weight for bounce lighting to use texture colors from the map: 0=ignore map textures (default), 1=multiply bounce light color by texture color.
.IP "\fB""_bouncestyled"" ""n""\fP"
1 makes styled lights bounce (e.g. flickering or switchable lights), default is 0, they do not bounce.
.SS "Model Entity Keys"
.PP