Jump to content

Problem with CJ clothes texture names


McDeKi

Recommended Posts

Hello!

I'm trying do shader, which will replace CJ clothes texture, but...

in wikipedia it says I need change textureName to CJ(https://wiki.multitheftauto.com/wiki/En ... rldTexture), also I found in MTA code that I need change world texture to "cj_ped_..."

  
//////////////////////////////////////////////////////////////// 
// 
// CRenderWareSA::AppendAdditiveMatch 
// 
// Add additive match for a shader+entity combo 
// 
//////////////////////////////////////////////////////////////// 
void CRenderWareSA::AppendAdditiveMatch ( CSHADERDUMMY* pShaderData, CClientEntityBase* pClientEntity, const char* szTextureNameMatch, float fShaderPriority, bool bShaderLayered, int iTypeMask, uint uiShaderCreateTime, bool bShaderUsesVertexShader, bool bAppendLayers ) 
{ 
    TIMING_CHECKPOINT( "+AppendAddMatch" ); 
  
    // Make previous versions usage of "CJ" work with new way 
    SString strTextureNameMatch = szTextureNameMatch; 
    if ( strTextureNameMatch.CompareI( "cj" ) ) 
      [b] strTextureNameMatch = "cj_ped_*";[/b] 
  
    m_pMatchChannelManager->AppendAdditiveMatch ( pShaderData, pClientEntity, strTextureNameMatch, fShaderPriority, bShaderLayered, iTypeMask, uiShaderCreateTime, bShaderUsesVertexShader, bAppendLayers ); 
    TIMING_CHECKPOINT( "-AppendAddMatch" ); 
} 
  

I have tried this, but it isn't working.

  
local pShader = dxCreateShader( 'shader.fx' ); -- change this to the shader file name 
if( pShader ) then -- check if shader was created successfully 
    local pTexture = dxCreateTexture( 'tracktrblue.png' ); -- create texture || change here to the texture file name 
    if( pTexture ) then -- check if texture was created successfully 
        dxSetShaderValue( pShader, 'cj', pTexture ); -- set shader texture to the texture we created 
        -- 
        engineApplyShaderToWorldTexture( pShader, 'cj_ped_torso'--[[, TARGET [ not needed ] ]] ); -- apply texture to the world || change here to the clothe texture name you want to replace and maybe fill target with an element if you don't want it to be applied to all world textures with this name 
    end 
end 
  

shader

  
texture cj; 
  
technique clotheTexRep 
{ 
    pass P0 
    { 
        Texture[0] = cj; 
    } 
} 
  

Any help will be appreciated.

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