The idea was to create a custom-built C++ core framework designed to unify optical and acoustic phenomena through real-time raytracing. By leveraging a single mathematical foundation, it simulates both the behavior of light (Whitted/Path Tracing) and the propagation of sound through virtual environments. But it is still WIP, just created the raytracing part, no audio yet :)
You can see the devlog on my portfolio website.
- Language: C++20
- Framework: SerraEngine (Custom core engine)
- Windowing & Input: SDL3
- Graphics API: OpenGL (via GLAD)
- Math: GLM
- Build System: CMake (3.20+)
The engine is engineered with strict adherence to SOLID principles and modular design:
- Core Orchestration: High-level minimal loop, decoupled from the underlying renderer.
- Agnostic Renderer: The pixel/sample buffer is oblivious to whether it's rendering optical photons or acoustic phonons.
- Material System: Unified
Materialstructures that contain both optical parameters (Reflectance, Refraction) and acoustic coefficients (Absorption, Scattering). - Modern Audio Pipeline: Utilizes the new SDL3 audio stream API (
SDL_GetAudioStreamData) instead of legacy audio callbacks for seamless, low-latency playback.
- CMake 3.20 or higher
- A C++20 compatible compiler (MSVC, GCC, or Clang)
- SDL3
- OpenGL development libraries
# Clone the repository and the SerraEngine dependency
git clone https://github.com/yourusername/raytracing-audio.git
cd raytracing-audio
# Create a build directory
mkdir build && cd build
# Configure with CMake
cmake ..
# Build the project
cmake --build . --config Release- Memory Management: Strictly modern C++ idioms (
std::unique_ptr,std::shared_ptr). Zero rawnew/deleteallocations in the high-level logic. - Composition over Inheritance: The
EntityandScenestructures are built to remain lightweight and extensible. - Performance: Hot paths are profiled and optimized for cache coherency. Interface segregation guarantees the
Raytracerlogic never depends on external APIs likeSDL_Window.
The project has been inspired by various learning resources:
- CPU Raytracing: Ray Tracing in One Weekend
- Compute Shaders: Jakubg05, Kidrigger, LWJGL Wiki
- Vulkan Raytracing: TheCherno
This project is open-source and available under the terms of the MIT License.
