Jump to content

solved shader


iPanda

Recommended Posts

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 by Guest
Link to comment
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

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...