Jump to content

[HELP] Weapon Fire Shader


Vazern

Recommended Posts

Hello guys!
I started with shaders today, I made a script to apply a texture to the weapons fire, but it is not working, nor does it give any error in the debug.

Client-side

shader = dxCreateShader("shader/shader.fx")
fire_fx = dxCreateTexture("files/fire.png")

function replaceFireFX()
    engineApplyShaderToWorldTexture(shader, "muzzle_texture4")
    dxSetShaderValue(shader, "gTexture", fire_fx)
end
addEventHandler("onClientResourceStart", resourceRoot, replaceFireFX)
addEventHandler("onClientPlayerJoin", root, replaceFireFX)

FX-Code

texture gTexture;

technique TexReplace
{
    pass P0
    {
        Texture[0] = gTexture;
    }
}


fire.png

KhlW3jp.jpg

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...