Shaders are SHD files loaded by the NWN:EE engine to perform graphical changes to textures. There are vertex (per-vertex) and fragment (per-pixel) shaders that are run by the game. They are OpenGL GLSL based, a c-like language.
Using shaders you can alter the graphical presentation of textures and models. See Shader Engine Support for details on how the engine pushes uniforms and default defines to the shader files.
...
If you want to add something like an alpha override instead of just putting the alpha in the diffuse alpha layer like you should, then you can pick a texture # between 6 and 10 and add that texture in there. Then write a super simple shader mod to just get your alpha from that B&W map instead of the diffuse.
Include Files
Debugging Shaders
Errors with shaders tend to make everything pink (eg the fog or object you're applying a shader to), or it fails to load and everything goes black or other similar looking problems occur.
You can find compile errors in the engine logs; these will show a line ID of a problem, however due to the way #include works (see below) it will not necessarily make any sense.
Additional debug is more difficult - eg outputting what values you are using to a console - but you can do outputs such as changing changing the fragment colours specifically based on the values you're generating.
You can check the performance of shaders with Tracy especially if you turn vsync off and do a before/after picture of FPS with the same scene being rendered.
Mobile / Different Systems
As noted Mobile GLSL is sometimes very different from desktop GLSL, and even in the base engine shaders it is gated with a #if MOBILE gate. It is recommended to test both on mobile and desktop shaders and gate any problematic desktop things so mobile do not activate them (else mobile likely get either pink everywhere - ie shaders didn't compile - or
Include Files
Compared to usual GLSL shaders you can use #include to have include files. It can help organise your code and any similar code can be put into include files instead Compared to usual GLSL shaders you can use #include to have include files. It can help organise your code and any similar code can be put into include files instead of the base shader file. The main thing is when #include is found it will copy the entire file contents to where it is defined, it won't act like a proper include file and - say on a compilation error - show the file name and line in that file, instead it basically generates several thousand lines of file then compiles / runs it.
One major thing that won't work with them is #if blocks - #include files are always included - so make sure you instead #if block all the include if it is specific to a particular platform/uniform/define.
...