sdf_raster is a research renderer developed in C++ using the Vulkan API, designed for efficient rendering of SDF data in real-time. It showcases occlusion optimizations and mesh shaders (WIP).
The goal of this master degree diploma project is to develop accelerated implicit surface rasterization algorithm on GPU.
- SDF triangulation: Dynamic geometry generation from SDF octrees using Marching Cubes.
- Frutum culling: Culling whole SDF-octree subtrees which are not intersected with frustum.
- Fly-around cam: Simple camera and controls for scene navigation. Caches previous camera view.
- Culling demo: Ability to leave your current frustum and look at the renderered scene from another angle.
- Occlusion culling (WIP): Occlusion culling optimization using H-Zbuffer.
- Mesh shading (WIP): Directly feeding rasterizer with geometry, rather then using per-frame vertex buffers.
- Language:
C++17(or higher) - Graphics API:
Vulkan 4.0+ - Build System:
CMake - Windowing System:
GLFW - Third-party Libraries:
Vulkan SDK(for Vulkan API and tooling)volk(Vulkan function loader)spdlog(for logging)LiteMath(linear algebra)nlohmann/json(for configuration/data parsing)dear ImGui(for debug GUI/interface)stb_image(for texture/image loading)
- Shader Language:
Slang
- Vulkan Libraries (optional Vulkan SDK for Debug):
Vulkan 4.0+ - C++ Compiler: g++ or clang.
- Shader Compiler: slangc. See script
./utils/install_slang.shfor quick install or use Vulkan SDK. - CMake: Version
3.16or newer. - OS: Linux, macOS. Windows is not supported.
-
Clone the repository:
git clone https://github.com/Reefufui/sdf_raster.git cd sdf_raster -
Configure and Build:
-
For Linux:
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release cmake --build build -j$(nproc)
*Optionally, replace
-DCMAKE_BUILD_TYPE=ReleasewithDebugorRelWithDebInfo. If so, make sure that Vulkan SDK: is installed and properly configured. TheVULKAN_SDKenvironment variable must be set. See scriptutils/install_vulkan_sdk_apt.shfor quick linux setup. -
For macOS:
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release cmake --build build -j$(sysctl -n hw.ncpu)
*Optionally, replace
-DCMAKE_BUILD_TYPE=ReleasewithDebugorRelWithDebInfo. If so, make sure that Vulkan SDK: is installed and properly configured. TheVULKAN_SDKenvironment variable must be set.
-
Important: The application must be run from the build directory to ensure all resources are loaded correctly.
After building the project, navigate to the build directory and run the executable:
cd build
./bin/sdf_raster- Toggle Camera Mode:
click | esc: Exit flying camera mode. (Cursor becomes enabled).right click: Enter flying camera mode. (Cursor becomes disabled).
- Movement (in Camera Mode):
w, a, s, d: Move forwards, left, backwards, right.space: Move up.ctrl (control): Move down.mouse: Look around.scroll: Adjust FOV.
- Camera Reset:
r: Reset camera position and orientation.
- FPS dump:
i: Dump current FPS to log.
- Toggle Frustum View:
c: Toggle culling visualization (to see which parts are rendered).
- Exit Application:
- Close the window.
- Camera settings are saved (
/tmp/cached_camera.json) and restored between sessions.

