A Vulkan 1.1 renderer targeting Android/Linux/Windows/MacOS! Written with C11, and desgined for use in StereoKit (and elsewhere). Core goal is performance and compatability on XR standalone headsets.
It uses a mid-high level API, with an opinionated instanced rendering system, allowing for easy use and internal implementation flexibility. This renderer uses HLSL for shaders, and uses its own skshaderc tool to compile HLSL to a custom format containing optimized SPIRV with metadata.
The full API for sk_renderer can be found in sk_renderer.h.
For usage, please see the example project for example implementations of various features. For usage with OpenXR, see the example_xr project.
- Basic mesh drawing.
- PBR via GLTF.
- Gaussian splat rendering.
- Curve based text rendering.
- Basic shadow mapping.
- Compute shaders.
- Texture compression.
- ... and more
Along with the core sk_renderer, the example projects include a number of useful high-level tools. Many of these are completely standalone, or may be adaptable to other contexts.
- scene_util.h/c - Utilities for kickstarting projects.
- GLTF Loader
- STB image loading
- Mesh generation
- Texture generation
- Default system info and vertex types
- hdr_load.h - Fast load .hdr to rg11b10 or rgb9e5 formats.
- micro_ply.h - Gaussian Splat friendly .ply loader.
- float_math.h - SIMD optimized vector math.
- tex_compress.h/c - Fast convert images to BC1/ETC2 format.
- text.h/c - Vector text rendering.
sk_renderer has a Dear ImGui rendering backend with prebuilt shaders that pairs quite well with sk_app, another similar tool that has a Dear ImGui platform backend. These make for a great combo for building portable Dear ImGui applications that work on all major operating systems.
Prerequisites: CMake 3.10+
From the repository root:
cmake -B build
cmake --build build -j8 --target run# For Android
cmake -B build-android -G Ninja -DCMAKE_ANDROID_NDK=$ANDROID_NDK_HOME -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=32 -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a
cmake --build build-android -j8
cmake --build build-android -j8 --target run_apk
cmake -B build-androidx86 -G Ninja -DCMAKE_ANDROID_NDK=$ANDROID_NDK_HOME -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=32 -DCMAKE_ANDROID_ARCH_ABI=x86_64
cmake --build build-androidx86 -j8
cmake --build build-androidx86 -j8 --target run_apk# For Windows .exe from linux with mingw-w64
cmake -B build-mingw -DCMAKE_TOOLCHAIN_FILE=cmake/mingw-toolchain.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build build-mingw -j8
cd build-mingw/ && wine example/sk_renderer_test.exe ; cd -