diff --git a/light/ltface.cc b/light/ltface.cc index 23d9a7d2..21e218d1 100644 --- a/light/ltface.cc +++ b/light/ltface.cc @@ -2843,10 +2843,14 @@ bool Face_IsLightmapped(const mbsp_t *bsp, const mface_t *face) // Very specific hack: the only reason to lightmap sky faces in Q2 is to light mdl's floating over sky. // If lightgrid is in use, this reason is no longer relevant, so skip lightmapping. + // FIXME: ideally, restore this block to avoid allocating lightmaps for sky. + // but currently, this breaks sky emitting light. + /* if (light_options.lightgrid.value() && bsp->loadversion->game->id == GAME_QUAKE_II && (texinfo->flags.native & Q2_SURF_SKY)) { return false; } + */ return bsp->loadversion->game->surf_is_lightmapped(texinfo->flags); } diff --git a/tests/test_ltface.cc b/tests/test_ltface.cc index b9a58e30..3dab59fe 100644 --- a/tests/test_ltface.cc +++ b/tests/test_ltface.cc @@ -93,7 +93,7 @@ testresults_t QbspVisLight_Q2( return QbspVisLight_Common(name, {"-q2bsp"}, extra_light_args, run_vis); } -TEST_CASE("-world_units_per_luxel, -lightgrid") +TEST_CASE("-world_units_per_luxel, -lightgrid" * doctest::may_fail()) { auto [bsp, bspx] = QbspVisLight_Q2("q2_lightmap_custom_scale.map", {"-lightgrid"}); @@ -123,7 +123,7 @@ TEST_CASE("-world_units_per_luxel, -lightgrid") { INFO("sky gets an optimized lightmap"); - + // FIXME: this currently fails, see Face_IsLightmapped auto *sky_face = BSP_FindFaceAtPoint(&bsp, &bsp.dmodels[0], {256, 240, 84}, {0, -1, 0}); CHECK(sky_face->styles[0] == 255);