minlight calculation, works with style now too
This commit is contained in:
parent
feeaae6a09
commit
d4ad3947ea
|
|
@ -63,6 +63,7 @@ struct surfacelight_t
|
|||
int32_t style = 0; // style ID
|
||||
float intensity = 0; // Surface light strength for each point
|
||||
float totalintensity = 0; // Total surface light strength
|
||||
float rawintensity = 0; // Original value
|
||||
qvec3d color; // Surface color
|
||||
|
||||
bool operator==(const per_style_t &other) const;
|
||||
|
|
|
|||
|
|
@ -3447,16 +3447,12 @@ void PostProcessLightFace(const mbsp_t *bsp, lightsurf_t &lightsurf, const setti
|
|||
}
|
||||
|
||||
if (lightsurf.vpl) {
|
||||
if (auto value = IsSurfaceLitFace(bsp, face)) {
|
||||
auto *entity = std::get<3>(value.value());
|
||||
float surface_minlight_scale = entity ? entity->surflight_minlight_scale.value() : 1.f;
|
||||
surface_minlight_scale *= lightsurf.surflight_minlight_scale;
|
||||
for (auto &style : lightsurf.vpl->styles) {
|
||||
|
||||
if (!style.bounce && style.rawintensity > 0) {
|
||||
|
||||
if (surface_minlight_scale > 0) {
|
||||
minlight = std::get<0>(value.value()) * surface_minlight_scale;
|
||||
minlight_color = std::get<2>(value.value());
|
||||
LightFace_Min(
|
||||
bsp, face, minlight_color, minlight, &lightsurf, lightmaps, std::get<1>(value.value()), true);
|
||||
bsp, face, style.color, style.rawintensity * 255.f, &lightsurf, lightmaps, style.style, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -218,6 +218,7 @@ static void MakeSurfaceLight(const mbsp_t *bsp, const settings::worldspawn_keys
|
|||
setting.rescale = extended_flags.surflight_rescale;
|
||||
|
||||
// Store surfacelight settings...
|
||||
setting.rawintensity = intensity;
|
||||
setting.totalintensity = intensity * facearea;
|
||||
setting.intensity = setting.totalintensity / l->points_before_culling;
|
||||
setting.color = texture_color.value();
|
||||
|
|
|
|||
Loading…
Reference in New Issue