iPanda Posted November 4, 2015 Share Posted November 4, 2015 (edited) Such a question. I replaced model new .dff and .txd files. But now I want to change replace the textures in the .txd file, using a script and .png image. For this I use a shader [texreplace]. I use engineApplyShaderToWorldTexture. But the texture is not replaced. There are some workarounds to achieve specific goals necessary to me? texreplace.lua texture gTexture; technique simple { pass P0 { Texture[0] = gTexture; } } client.lua [OOP] for example local texreplace = DxShader('texreplace.fx') texreplace:setValue('gTexture',DxTexture('newtexture.png')) texreplace:applyToWorldTexture('texturename')--'texturename' is name of texture from .txd file Edited November 10, 2015 by Guest Link to comment
Ren_712 Posted November 5, 2015 Share Posted November 5, 2015 Is that a ped model You have replaced ? You will need to specify that in DxShader. Link to comment
Saml1er Posted November 6, 2015 Share Posted November 6, 2015 Check my answer here: viewtopic.php?f=91&t=93901 If you did everything I said there then it should work perfectly. Link to comment
iPanda Posted November 9, 2015 Author Share Posted November 9, 2015 Is that a ped model You have replaced ? You will need to specify that in DxShader. I replaced the complete skin, suppose id 114. Now I want to replace the texture of the .txd file, using the shader. Which responsible parametr for this? Link to comment
Ren_712 Posted November 10, 2015 Share Posted November 10, 2015 Is that a ped model You have replaced ? You will need to specify that in DxShader. I replaced the complete skin, suppose id 114. Now I want to replace the texture of the .txd file, using the shader. Which responsible parametr for this? wiki says: https://wiki.multitheftauto.com/wiki/DxCreateShader dxCreateShader ( string filepath [, float priority = 0, float maxDistance = 0, bool layered = false, string elementTypes = "world,vehicle,object,other" ] ) For backward compatibility (MTA 1.1) you don't need to set anything else than filepath. However - after introducing ability to apply to ped models - it's a MUST to specify that you want to apply shader to "ped". Look at shader examples on wiki: like Ped morph. Link to comment
iPanda Posted November 10, 2015 Author Share Posted November 10, 2015 Everything worked out. Thank Ren_72. Сlose the topic! Link to comment
iPanda Posted November 11, 2015 Author Share Posted November 11, 2015 Ren_72, another question. Can I apply shader for a particular only model id? Link to comment
Ren_712 Posted November 13, 2015 Share Posted November 13, 2015 You can apply shader to an element (ped,vehicle,etc..). You create a ped (an element) and then: bool engineApplyShaderToWorldTexture ( element shader, string textureName [, element targetElement = nil, bool appendLayers = true ] ) Link to comment
iPanda Posted November 14, 2015 Author Share Posted November 14, 2015 You do not quite understand me. I have several models with the same name in the texture .txd file. These models have different ID. Can I apply the shader not only to the type of element, but also to clarify it going? How? 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