Vulkan Shader Modding

Editing shaders after the NMS Vulkan update (2.0+) has become tricky. GaticusHax has found a way to mod shaders nontheless. Here is his comment from the NMS modding discord:

"If anyone wants to mod shaders... You should download this tool package: https://github.com/google/shaderc Direct link to download: https://storage.googleapis.com/shaderc/badges/build_link_windows_vs2017_release.html These are command line tools, for compiling glsl to vulkan and for cross-compiling (decompiling) vulkan to glsl. There are similar tools in the Vulkan API but these are better. Unzip it wherever you want: eg.

You should add the  path to your PATH environment variable. Use  to decompile the binary vulkan shaders to human-readable glsl. Eg:

Edit the glsl. Use  to compile the glsl to vulkan. Eg:

Make sure you set the correct shader stage. See  for options. Don't forget to rebuild all the relevant shader variants with your changes as well. Each variant corresponds to a combination of flags found in the material files. (eg ) There are 64 possible flags. The value on the end of the shader name, such as  is the 64-bit mask of the material flags. In this case, the value is 769. In binary, it would be 00000000 00000000 00000000 00000000 00000000 00000000 00000011 00000001 This means, that flag 01, 09 and 10 are defined for this shader (smallest bit is on the right)."