Monday, November 12, 2018
Cross-Platform Vulkan Mesh Render Example in C
I feel I should take some time out to briefly talk about the current state of my Vulkan stuff.
The specific commit I'm talking about is this one.
This is the most simple cross platform Vulkan mesh rendering example, that is written in C, that I'm aware of. Does it do everything correctly? Probably not. It can't even handle the window being resized. What it does do is contain 100% of the Vulkan code within a single file, while leaving the platform specific code to be the simplest possible example of each. It is also utterly painless to compile, not requiring any external SDK to be installed, it requires only the compiler for your platform.
The complete steps required to prepare the build environment are in the Readme file, which for Windows, is get a good version of MinGW-w64 (specifically 8.1.0-x86_64-posix-seh), on Linux is how to install the up to date Nvidia drivers (and the Vulkan driver, which is not included by default) and Clang, and on Mac it is naught more than "Install XCode". Why no Clang on Windows? Debugging 64bit binaries created with Clang on Windows is currently an "at your own risk" case, and in my experience as of a few weeks ago when I started this was "problematic" when using VSCode as my debugging interface. Given the standard of work of the Clang and VSCode people, I'm sure this will be a distant memory quite soon, if they haven't already taken care of it.
Being that it does load a Wavefront OBJ file, it has my old OBJ loading code in there, which while it works just fine for most simple models, does do some silly things with some of the more complicated models (I'm looking at you Powerplant). It is capable of loading the San Miguel scene, and some versions of the Sponza Atrium, as well as everything from the Stanford 3D Scan Respository. It's not the main focus of this, and here it's only contribution is that it does not add a cumbersome OBJ loading library (I'm looking at you absolutely everything ever). If you know of an OBJ loader written in C that is of Sean Barrett levels of awesome, I'd love to hear about it.
This is the last point of the project being "simple". From here I'm adding OpenVR support and all the other complexity that I usually roll with, starting with my usual window handling code. Maybe at some point in the future it will return to an example-like state of commenting, but from commits after this one will break things for a while.
Subscribe to:
Posts (Atom)