fluffels / kwark

Quake .bsp viewer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kwark

This project is a basic .bsp file loader / viewer.

Motivation

I've written a few renderers for outside scenes, but wanted to try writing one for internal scenes. Using the models and textures stored in Quake's pak0 is an easy way to get models, textures and other resources to test the renderer with.

With this project I'm mostly trying to familiarize myself with Vulkan fundamentals --- to see how everything fits together in a very simple renderer.

I'm also learning a lot about how the various Quake engines work, especially the original software renderer and the vkQuake renderer. That's been fascinating, particularly the limitations OpenGL imposed that weren't present in the software renderer and on the other hand all the work that had to be done to make the software renderer interactive.

Why not start with the Quake source?

It would have been easier in some ways to simply copy the GLQuake source and work on a Vulkan port. This is the approach taken by vkQuake.

I didn't want to do this mainly because trying to figure out as much as I can from incomplete write ups is more fun. I'm also not really interested in writing a complete client, since that's been done before.

A side effect of this is that I'm not constrained by the approach of the old code. Maybe this means I can do some of the things in a more modern way and explore more of Vulkan's functionality.

Progress Screenshot

TODO

  • βœ… Level models
  • βœ… Textures
  • βœ… Light maps
  • πŸ”² Handle fullbrights
  • βœ… Animate light maps
  • βœ… Solve "missing" light maps
  • πŸ”² Dynamic lights
  • βœ… Remove debug brushes from display
  • βœ… Sky textures
  • βœ… Animated sky textures
  • βœ… Parralax sky textures
  • βœ… Fix projection of sky textures
  • βœ… Animated slime / lava / water textures
  • πŸ”² Under water effect
  • βœ… Alias model loading
  • βœ… Fire model
  • βœ… Other scenery models
  • βœ… Monster models
  • βœ… Monster animation

Remarks

Bindless textures in Vulkan were useful. Since Quake uses so few textures per level (~60) it's possible to load them all into a sampler array and pass a texture index along with the vertex data.

Similarly, the entire light map for a level fits in a uniform texel buffer. So all the lighting calculations can be done in the fragment shader.

About

Quake .bsp viewer

License:MIT License


Languages

Language:C++ 97.5%Language:GLSL 2.2%Language:CMake 0.3%