light: add more performance stats
This commit is contained in:
parent
0c63d61a60
commit
1d4de5c17d
|
|
@ -40,6 +40,7 @@
|
|||
#include <atomic>
|
||||
|
||||
extern std::atomic<uint32_t> total_light_rays, total_light_ray_hits, total_samplepoints;
|
||||
extern std::atomic<uint32_t> 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]);
|
||||
|
|
|
|||
|
|
@ -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<double>(total_light_rays) / static_cast<double>(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<double>(total_light_rays) / static_cast<double>(total_samplepoints),
|
||||
static_cast<double>(total_light_ray_hits) / static_cast<double>(total_samplepoints));
|
||||
|
||||
logprint("%f bounce lights tested, %f hits per sample point\n",
|
||||
static_cast<double>(total_bounce_rays) / static_cast<double>(total_samplepoints),
|
||||
static_cast<double>(total_bounce_ray_hits) / static_cast<double>(total_samplepoints));
|
||||
|
||||
close_log();
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include <cassert>
|
||||
|
||||
std::atomic<uint32_t> total_light_rays, total_light_ray_hits, total_samplepoints;
|
||||
std::atomic<uint32_t> 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++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue