Annas Posted August 31, 2016 Posted August 31, 2016 Hi all, the issuse that i can't remove shader from a shaded object. This funcition is working perfect, means 'engineApplyShaderToWorldTexture' is working, but i need it, if 'textureName' that comes to the function named 'DefaultTexture' , it will remove the shader, means back the object with the official shader that it got from TXD. function applyShader ( element, textureName ) -- HERE local shaderElement = dxCreateShader ( "shader/shader.fx" ) if (textureName == "DefaultTexture") then engineRemoveShaderFromWorldTexture ( shaderElement, "*", element ) destroyElement(shaderElement) return end ---------------- local textureElement = dxCreateTexture ( ":CSTmodels/textures/"..textureName..".jpg" ) if ( shaderElement and textureElement ) then dxSetShaderValue ( shaderElement, "Tex0", textureElement ) engineApplyShaderToWorldTexture ( shaderElement, "*", element ) end end addEvent("CSTcityzones.applyShader", true) addEventHandler("CSTcityzones.applyShader", root, applyShader)
Annas Posted September 1, 2016 Author Posted September 1, 2016 Rly niggah?, No one will help me ? , Hard4You
Captain Cody Posted September 1, 2016 Posted September 1, 2016 ShaderElement has to be paired with the object in one way or another, try using tables.
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