Jump to content

SHADER CLOTHES


leozin99

Recommended Posts

This is my first shader code so sorry if it does not work:

Client-side:

local pShader = dxCreateShader( 'clothe.rep.fx' ); -- change this to the shader file name 
if( pShader ) then -- check if shader was created successfully 
    local pTexture = dxCreateTexture( 'clothtexture.png' ); -- create texture || change here to the texture file name 
    if( pTexture ) then -- check if texture was created successfully 
        dxSetShaderValue( pShader, 'clotheTexture', pTexture ); -- set shader texture to the texture we created 
        -- 
        engineApplyShaderToWorldTexture( pShader, 'clothe_text_name'--[[, 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 file:

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

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