Jump to content

clothes shader...


Arsilex

Recommended Posts

Hello i have this code..

pShader = dxCreateShader( 'clothestex.fx' ) 
if( pShader ) then 
    local pTexture = dxCreateTexture( 'bandgang3.png' ) 
    if( pTexture ) then 
        dxSetShaderValue( pShader, 'gTexture', pTexture ) 
        outputDebugString("yes") 
        engineApplyShaderToWorldTexture( pShader, 'cj_ped_glasses' ) 
    end 
end 

// Variable to fetch the texture from the script 
texture gTexture; 
  
// My nice technique. Requires absolutely no tools, worries nor skills 
technique TexReplace 
{ 
    pass P0 
    { 
        // Set the texture 
        Texture[0] = gTexture; 
         
        // LET THE MAGIC DO ITS MAGIC! 
    } 
} 
  

but not remplace the clothe... I have something wrong?

Link to comment

Client :

  
function replaceClothes() 
local theShader = dxCreateShader( "material/effect.fx", 0, 0, true,"ped") 
local theTexture = dxCreateTexture( "material/trackytop1pro.png" ) 
dxSetShaderValue(theShader,"gTexture",theTexture) 
engineApplyShaderToWorldTexture(theShader,"cj_ped_torso") 
end  
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), replaceClothes) 
function resetClothes() 
if theShader then 
engineRemoveShaderFromWorldTexture ( theShader, "cj_ped_torso" ) 
end  
end 
addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()),resetClothes ) 
  

FX :

  
texture gTexture; 
technique hello 
{ 
    pass P0 
    { 
        Texture[0] = gTexture; 
    } 
} 
  

Resource Example :

http://www.mediafire.com/download/bhks2 ... lothes.zip

-----------------------------

Resource Start replace the texture and resource stop restore the texture.

Link to comment
  • 3 years later...

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