diff --git a/include/light/light.hh b/include/light/light.hh index e96cba9d..38076b31 100644 --- a/include/light/light.hh +++ b/include/light/light.hh @@ -315,7 +315,7 @@ public: /* Q2 surface lights (mxd) */ 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, &worldspawn_group}; // "choplight" - arghrad3 name diff --git a/light/light.cc b/light/light.cc index 241082a0..b100d8a6 100644 --- a/light/light.cc +++ b/light/light.cc @@ -1197,10 +1197,13 @@ int light_main(int argc, const char **argv) options.rangescale.setValue(1.0f); } 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()) { - options.bouncescale.setValue(1.5f); + options.bouncescale.setValue(1.25f); } if (!options.bounce.isChanged()) { options.bounce.setValue(true); diff --git a/light/ltface.cc b/light/ltface.cc index a2a6e594..3d7dcbaf 100644 --- a/light/ltface.cc +++ b/light/ltface.cc @@ -1897,18 +1897,19 @@ inline qvec3f GetSurfaceLighting(const settings::worldspawn_keys &cfg, const sur qvec3f result; 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; - float dp2 = 1.f;//qv::dot(sp_vpl, normal); + float dp2 = qv::dot(sp_vpl, normal); if (!vpl->omnidirectional) { if (dp1 < 0.0f) return {0}; // sample point behind vpl if (dp2 < 0.0f) return {0}; // vpl behind sample face - - dp2 = - 0.5f + dp2 * 0.5f; // Rescale a bit to brighten the faces nearly-perpendicular to the surface light plane... + + // 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; } else { diff --git a/light/surflight.cc b/light/surflight.cc index ae932df1..9fa13e52 100644 --- a/light/surflight.cc +++ b/light/surflight.cc @@ -159,7 +159,7 @@ static void MakeSurfaceLightsThread(const mbsp_t *bsp, const settings::worldspaw 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