/bsp_vulkan

study vulkan

Primary LanguageC++MIT LicenseMIT

Quake BSP map viewer in Vulkan

This is a BSP tree Vulkan renderer written in C++ and a port of the same viewer written in OpenGL. It handles basic geometry and curved patch rendering but with no support for game-specific shaders, entities etc. It implement PVS and frustum culling so performance is optimal. At the moment only Quake III Arena maps are supported but an interface is provided for adding other BSP versions in the future.

Screenshot

Building

The project works out of the box with latest Vulkan SDK (tested against SDK 1.0.65.1 and corresponding runtime) and Visual Studio 2015+

Usage

Running the viewer:

QuakeBspViewer.exe <path-to-bsp-file>

Use tilde key (~) to toggle statistics menu on/off. Note that you must have Quake III Arena textures and models unpacked in the root directory if you want to see proper texturing. To move around use the WASD keys. RF keys lift you up/down and QE keys let you do the barrel roll.

Dependencies

This project uses following external libraries:

Vulkan code overview

For people interested in learning Vulkan and jumping into core features, the renderer/vulkan folder contains all files related to creating buffers, instances, surfaces and command lists. Note that this is not an attempt at writing an overly abstract rendering engine and few settings are tailored for this particular project. Core BSP and overlay rendering is done in src/Q3BspMap.cpp and src/renderer/Font.cpp. Vulkan handles global to the entire application (instance, device, etc.) are stored in src/RenderContext.cpp.

Keyword list:

  • multiple pipeline and renderpass rendering with separate command pools and buffers
  • immediate screen updates with double buffering and semaphore scheduling
  • texture mapping with and without filtering
  • 3rd party memory allocation handling using VMA
  • validation layers defaulted to debug builds

TODO

  • drop vkQueueWaitIdle() every frame and double buffer command buffers
  • add MSAA
  • use pipeline derivatives
  • Linux build!