Cross-platform raytracing benchmark for KdTree, BVH, and BVH16 (quantized 16-byte nodes) on the Stanford Bunny mesh.
Runs on Linux and Windows via CMake (GCC, Clang, or MSVC).
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -jRequirements:
- C++11 compiler
- CPU with SSE4.1 + AVX (for BVH16 / SIMD helpers)
cd build
./kdtree_test # Linux / macOS
# kdtree_test.exe # Windowsbunny.ply is copied next to the binary at build time. The program:
- Loads ~69k triangles from
bunny.ply - Builds and times each acceleration structure (100 full-frame rays at 800×800)
- Prints M rays/sec and traversal stats
- Writes
result.bmp(andresult.ppm) from the last pass - Opens the image with the OS default viewer (
xdg-open/ Windows shell /openon macOS)
| Before (Windows-only) | After (portable) |
|---|---|
WinMain + Win32 window / GDI |
Console main |
windows.h, DWORD, LPCTSTR, _tfopen_s |
Standard C/C++ types and I/O |
QueryPerformanceCounter |
std::chrono::steady_clock |
MessageBox / SetDIBitsToDevice |
printf + PPM image output |
MSVC __forceinline / __m128 operators |
FORCE_INLINE + Simd4/Simd8 wrappers |
Visual Studio .sln / .vcxproj only |
CMake (primary build) |
Legacy Visual Studio project files under KdTree Test/ are obsolete; use CMake on Windows as well.