Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KdTree Test

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).

Build

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j

Requirements:

  • C++11 compiler
  • CPU with SSE4.1 + AVX (for BVH16 / SIMD helpers)

Run

cd build
./kdtree_test        # Linux / macOS
# kdtree_test.exe    # Windows

bunny.ply is copied next to the binary at build time. The program:

  1. Loads ~69k triangles from bunny.ply
  2. Builds and times each acceleration structure (100 full-frame rays at 800×800)
  3. Prints M rays/sec and traversal stats
  4. Writes result.bmp (and result.ppm) from the last pass
  5. Opens the image with the OS default viewer (xdg-open / Windows shell / open on macOS)

What changed from the original Win32 app

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.

About

Fast KdTree test code.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages