Vazern

[HELP] Weapon Fire Shader

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

Share this post


Link to post

I also tried that world texture once and for some unknown reason it doesn't work. A shader specialist might know.

 

  • Like 1

Share this post


Link to post

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.