vkBasalt is a Vulkan post processing layer to enhance the visual graphics of games.
Currently, the build in effects are:
- Contrast Adaptive Sharpening
- Denoised Luma Sharpening
- Fast Approximate Anti-Aliasing
- Enhanced Subpixel Morphological Anti-Aliasing
- 3D color LookUp Table
It is also possible to use Reshade Fx shaders.
This is one of my first projects ever, so expect it to have bugs. Use it at your own risk.
Before building, you will need:
- GCC >= 9
- X11 development files
- glslang
- SPIR-V Headers
- Vulkan Headers
These instructions use --prefix=/usr, which is generally not recommened since vkBasalt will be installed in directories that are meant for the package manager. The alternative is not setting the prefix, it will then be installed in /usr/local. But you need to make sure that ld finds the library since /usr/local is very likely not in the default path.
In general, prefer using distro provided packages.
git clone https://github.com/DadSchoorse/vkBasalt.git
cd vkBasalt
meson setup --buildtype=release --prefix=/usr builddir
ninja -C builddir install
Make sure that PKG_CONFIG_PATH=/usr/lib32/pkgconfig and --libdir=lib32 are correct for your distro and change them if needed. On Debian based distros you need to replace lib32 with lib/i386-linux-gnu, for example.
ASFLAGS=--32 CFLAGS=-m32 CXXFLAGS=-m32 PKG_CONFIG_PATH=/usr/lib32/pkgconfig meson setup --prefix=/usr --buildtype=release --libdir=lib32 -Dwith_json=false builddir.32
ninja -C builddir.32 install
Debian sudo apt install vkbasalt
Fedora sudo dnf install vkBasalt
Void Linux sudo xbps-install vkBasalt
Enable the layer with the environment variable.
When using the terminal or an application (.desktop) file, execute:
ENABLE_VKBASALT=1 yourgameWith Lutris, follow these steps below:
- Right click on a game, and press
configure. - Go to the
System optionstab and scroll down toEnvironment variables. - Press on
Add, and addENABLE_VKBASALTunderKey, and add1underValue.
With Steam, edit your launch options and add:
ENABLE_VKBASALT=1 %command% Settings like the CAS sharpening strength can be changed in the config file. The config file will be searched for in the following locations:
- a file set with the environment variable
VKBASALT_CONFIG_FILE=/path/to/vkBasalt.conf vkBasalt.confin the working directory of the game$XDG_CONFIG_HOME/vkBasalt/vkBasalt.confor~/.config/vkBasalt/vkBasalt.confifXDG_CONFIG_HOMEis not set$XDG_DATA_HOME/vkBasalt/vkBasalt.confor~/.local/share/vkBasalt/vkBasalt.confifXDG_DATA_HOMEis not set/etc/vkBasalt.conf/etc/vkBasalt/vkBasalt.conf/usr/share/vkBasalt/vkBasalt.conf
If you want to make changes for one game only, you can create a file named vkBasalt.conf in the working directory of the game and change the values there.
To run reshade fx shaders e.g. shaders from the reshade repo, you have to set reshadeTexturePath and reshadeIncludePath to the matching dirctories from the repo. To then use a specific shader you need to set a custom effect name to the shader path and then add that effect name to effects like every other effect.
effects = colorfulness:denoise
colorfulness = /home/user/reshade-shaders/Shaders/Colourfulness.fx
denoise = /home/user/reshade-shaders/Shaders/Denoise.fx
reshadeTexturePath = /home/user/reshade-shaders/Textures
reshadeIncludePath = /home/user/reshade-shaders/ShadersThe HOME key can be used to disable and re-enable the applied effects, the key can also be changed in the config file. This is based on X11 so it won't work on pure wayland. It should however at least not crash without X11.
The amount of debug output can be set with the VKBASALT_LOG_LEVEL env var, e.g. VKBASALT_LOG_LEVEL=debug. Possible values are: trace, debug, info, warn, error, none.
By default the logger outputs to stderr, a file as output location can be set with the VKBASALT_LOG_FILE env var, e.g. VKBASALT_LOG_FILE="vkBasalt.log".
It's a joke: vulkan post processing → after vulcan → basalt
Yes.
Maybe. To my knowledge this hasn't happened yet but don't blame me if your frog dies.
No. I don't know anything about openGl and I don't want to either. Also openGl has no layer system like vulkan.
Maybe, but not soon.
Not really, most of the code was written from scratch. vkBasalt directly uses reshade source code for the shader compiler (thanks @crosire), but that's about it.
No. Shaders that need multiple techniques do not work, there might still be problems with stencil and blending and depth buffer access isn't ready yet.
There is a wip version that you can enable with depthCapture = on. It will lead to many problems especially on non nvidia hardware. Also the selected depth buffer isn't always the one you would want.
There is some support for it #46. One easy way so to simply edit the shader file.