If your weapon code is in ZScript, you'll need to write a custom function that enables the shader upon firing the weapon and attach it to the weapon's Fire state. The documentation regarding using shaders in ZScript is unfortunately rather lacking - you'll basically have to look at other people's shaders to learn how it works.
This snippet from GZDoom's base.zs should be of some help, though:
Code: Select all
struct Shader native
{
native clearscope static void SetEnabled(PlayerInfo player, string shaderName, bool enable);
native clearscope static void SetUniform1f(PlayerInfo player, string shaderName, string uniformName, float value);
native clearscope static void SetUniform2f(PlayerInfo player, string shaderName, string uniformName, vector2 value);
native clearscope static void SetUniform3f(PlayerInfo player, string shaderName, string uniformName, vector3 value);
native clearscope static void SetUniform1i(PlayerInfo player, string shaderName, string uniformName, int value);
}