diff --git a/include/light/ltface.hh b/include/light/ltface.hh index c9b38654..5758f16e 100644 --- a/include/light/ltface.hh +++ b/include/light/ltface.hh @@ -40,6 +40,7 @@ #include extern std::atomic total_light_rays, total_light_ray_hits, total_samplepoints; +extern std::atomic total_bounce_rays, total_bounce_ray_hits; void FaceCentroid(const bsp2_dface_t *face, const bsp2_t *bsp, vec3_t out); void WorldToTexCoord(const vec3_t world, const texinfo_t *tex, vec_t coord[2]); diff --git a/light/light.cc b/light/light.cc index 6998a274..8239d8f5 100644 --- a/light/light.cc +++ b/light/light.cc @@ -1738,11 +1738,15 @@ main(int argc, const char **argv) WriteBSPFile(source, &bspdata); end = I_FloatTime(); logprint("%5.3f seconds elapsed\n", end - start); - logprint("%f lights tested per sample point\n", - static_cast(total_light_rays) / static_cast(total_samplepoints)); - logprint("%f lights hit per sample point\n", + logprint("\n"); + logprint("stats:\n"); + logprint("%f lights tested, %f hits per sample point\n", + static_cast(total_light_rays) / static_cast(total_samplepoints), static_cast(total_light_ray_hits) / static_cast(total_samplepoints)); - + logprint("%f bounce lights tested, %f hits per sample point\n", + static_cast(total_bounce_rays) / static_cast(total_samplepoints), + static_cast(total_bounce_ray_hits) / static_cast(total_samplepoints)); + close_log(); return 0; diff --git a/light/ltface.cc b/light/ltface.cc index f154b10c..99b773c2 100644 --- a/light/ltface.cc +++ b/light/ltface.cc @@ -27,6 +27,7 @@ #include std::atomic total_light_rays, total_light_ray_hits, total_samplepoints; +std::atomic total_bounce_rays, total_bounce_ray_hits; static void PrintFaceInfo(const bsp2_dface_t *face, const bsp2_t *bsp); @@ -1847,6 +1848,7 @@ LightFace_Bounce(const bsp2_t *bsp, const bsp2_dface_t *face, const lightsurf_t rs->pushRay(i, vpl.pos, dir, dist, /*shadowself*/ nullptr, indirect); } + total_bounce_rays += rs->numPushedRays(); rs->tracePushedRaysOcclusion(); const int N = rs->numPushedRays(); @@ -1869,6 +1871,8 @@ LightFace_Bounce(const bsp2_t *bsp, const bsp2_dface_t *face, const lightsurf_t lightsample_t *sample = &lightmap->samples[i]; VectorAdd(sample->color, indirect, sample->color); + + total_bounce_ray_hits++; } }