roDaN Posted February 22, 2022 Share Posted February 22, 2022 (edited) Hello, as the title says I am not able to set a shader for the gunshot effect. Seems like this is impossible to replace because ant other effect I'm trying to replace works. Lua code: theTechnique = dxCreateShader("shader.fx") explosionTexture = dxCreateTexture( "texture.png") function replaceEffect() engineApplyShaderToWorldTexture(theTechnique, "muzzle_texture4") -- also tried "gunflash" dxSetShaderValue (theTechnique, "gTexture", explosionTexture) end addEventHandler("onClientResourceStart",resourceRoot,replaceEffect) Shader code: texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } EDIT: Actually seems like I am very wrong, the texture applied to the effect should be made for it. But how can I do it ? Edited February 22, 2022 by roDaN Revelation, lmao Link to comment
βurak Posted February 22, 2022 Share Posted February 22, 2022 (edited) open the txd of the weapon you want to change and do it from there, then change it using "engineLoadTXD" and "engineImportTXD" Edited February 22, 2022 by Burak5312 Link to comment
roDaN Posted February 22, 2022 Author Share Posted February 22, 2022 4 hours ago, Burak5312 said: open the txd of the weapon you want to change and do it from there, then change it using "engineLoadTXD" and "engineImportTXD" I want to apply it on a createEffect Link to comment
βurak Posted February 22, 2022 Share Posted February 22, 2022 (edited) i tested now it uses texture named "sphere" but they use fxp files to create the effect I'm not sure you can do this in mta but you can find them in "effects.fxp" file Edited February 22, 2022 by Burak5312 Link to comment
roDaN Posted February 22, 2022 Author Share Posted February 22, 2022 2 hours ago, Burak5312 said: i tested now it uses texture named "sphere" but they use fxp files to create the effect I'm not sure you can do this in mta but you can find them in "effects.fxp" file Thank you for your answer but there are a lot of examples/resources that work, seems like there might be some requirement for the texture applied with shader. Link to comment
Dzsozi (h03) Posted February 24, 2022 Share Posted February 24, 2022 (edited) Try muzzle_texture* instead of muzzle_texture4 engineApplyShaderToWorldTexture(theTechnique, "muzzle_texture*") Edited February 24, 2022 by Dzsozi (h03) Link to comment
roDaN Posted February 24, 2022 Author Share Posted February 24, 2022 7 hours ago, Dzsozi (h03) said: Try muzzle_texture* instead of muzzle_texture4 engineApplyShaderToWorldTexture(theTechnique, "muzzle_texture*") Thanks for your response, but still no luck with your method. My final goal was reached, but I would still like to know what is the problem with replacing this texture. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now