Advertisement

We're Getting Mutants in the MCU - The Loop

01:36

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. C:\Tools\google-shaderc\

You should add the C:\Tools\google-shaderc\bin path to your PATH environment variable. Use spirv-cross to decompile the binary vulkan shaders to human-readable glsl. Eg: spirv-cross --version 450 --vulkan-semantics --stage vert PSTREAM_VERT_PSTREAM_STARS_0.SPV > PSTREAM_VERT_PSTREAM_STARS_0.GLSL

Edit the glsl. Use glslc to compile the glsl to vulkan. Eg: glslc -std=450 -fshader-stage=vertex -o "PSTREAM_VERT_PSTREAM_STARS_0.SPV" "PSTREAM_VERT_PSTREAM_STARS_0.GLSL"

Make sure you set the correct shader stage. See glslc --help 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 _F01_DIFFUSEMAP) There are 64 possible flags. The value on the end of the shader name, such as ATMOSPHERE_FRAG_CLOUD_769.SPV 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 (_F01_DIFFUSEMAP, _F09_TRANSPARENT, _F10_NORECEIVESHADOW) are defined for this shader (smallest bit is on the right)."

Community content is available under CC-BY-SA unless otherwise noted.