bounce lighting fix

change defaults for Q2 to look a bit closer to how it looked before
This commit is contained in:
Jonathan 2022-07-02 17:22:11 -04:00
parent 0baa788d7e
commit b8bb4cdd2a
4 changed files with 13 additions and 9 deletions

View File

@ -315,7 +315,7 @@ public:
/* Q2 surface lights (mxd) */ /* Q2 surface lights (mxd) */
setting_scalar surflightscale{ setting_scalar surflightscale{
this, "surflightscale", 0.3, &worldspawn_group}; // Strange defaults to match arghrad3 look... this, "surflightscale", 1.0, &worldspawn_group};
setting_scalar surflightsubdivision{this, {"surflightsubdivision", "choplight"}, 16.0, 1.0, 8192.0, setting_scalar surflightsubdivision{this, {"surflightsubdivision", "choplight"}, 16.0, 1.0, 8192.0,
&worldspawn_group}; // "choplight" - arghrad3 name &worldspawn_group}; // "choplight" - arghrad3 name

View File

@ -1197,10 +1197,13 @@ int light_main(int argc, const char **argv)
options.rangescale.setValue(1.0f); options.rangescale.setValue(1.0f);
} }
if (!options.bouncecolorscale.isChanged()) { if (!options.bouncecolorscale.isChanged()) {
options.bouncecolorscale.setValue(1.0f); options.bouncecolorscale.setValue(0.5f);
}
if (!options.surflightscale.isChanged()) {
options.surflightscale.setValue(0.65f);
} }
if (!options.bouncescale.isChanged()) { if (!options.bouncescale.isChanged()) {
options.bouncescale.setValue(1.5f); options.bouncescale.setValue(1.25f);
} }
if (!options.bounce.isChanged()) { if (!options.bounce.isChanged()) {
options.bounce.setValue(true); options.bounce.setValue(true);

View File

@ -1897,9 +1897,9 @@ inline qvec3f GetSurfaceLighting(const settings::worldspawn_keys &cfg, const sur
qvec3f result; qvec3f result;
float dotProductFactor = 1.0f; float dotProductFactor = 1.0f;
const float dp1 = qv::dot(vpl->surfnormal, dir); float dp1 = qv::dot(vpl->surfnormal, dir);
const qvec3f sp_vpl = dir * -1.0f; const qvec3f sp_vpl = dir * -1.0f;
float dp2 = 1.f;//qv::dot(sp_vpl, normal); float dp2 = qv::dot(sp_vpl, normal);
if (!vpl->omnidirectional) { if (!vpl->omnidirectional) {
if (dp1 < 0.0f) if (dp1 < 0.0f)
@ -1907,8 +1907,9 @@ inline qvec3f GetSurfaceLighting(const settings::worldspawn_keys &cfg, const sur
if (dp2 < 0.0f) if (dp2 < 0.0f)
return {0}; // vpl behind sample face return {0}; // vpl behind sample face
dp2 = // Rescale a bit to brighten the faces nearly-perpendicular to the surface light plane...
0.5f + dp2 * 0.5f; // Rescale a bit to brighten the faces nearly-perpendicular to the surface light plane... dp1 = 0.5f + dp1 * 0.5f;
dp2 = 0.5f + dp2 * 0.5f;
dotProductFactor = dp1 * dp2; dotProductFactor = dp1 * dp2;
} else { } else {

View File

@ -159,7 +159,7 @@ static void MakeSurfaceLightsThread(const mbsp_t *bsp, const settings::worldspaw
return; return;
} }
MakeSurfaceLight(bsp, cfg, face, std::nullopt, false/*!(info->flags.native & Q2_SURF_SKY)*/, (info->flags.native & Q2_SURF_SKY), 0, info->value); MakeSurfaceLight(bsp, cfg, face, std::nullopt, !(info->flags.native & Q2_SURF_SKY), (info->flags.native & Q2_SURF_SKY), 0, info->value);
} }
// check matching templates // check matching templates