Jump to content

Custom group skin shaders


Recommended Posts

First. I need this. If i am in the AF group i can get 285 skin but 285 skin have a shader. But normal people get 285 skin no shader. Why i can do this? Sorry for my bad english. I try this

shader.lua

addEventHandler( "onClientResourceStart", resourceRoot, 
    function() 
    
        texture = dxCreateTexture ( "swat.png" ) 
        shader, tec = dxCreateShader( "swat.fx" ) 
        
        --bit of sanity checking 
        if not shader then 
            outputConsole( "Could not create shader. Please use debugscript 3" ) 
            destroyElement( texture ) 
            return 
        elseif not texture then 
            outputConsole( "loading texture failed" ) 
            destroyElement ( shader ) 
            tec = nil 
            return 
        else 
            engineApplyShaderToWorldTexture ( shader, "swat" ) 
            dxSetShaderValue ( shader, "Tex0", texture ) 
        end 
        
    end 
) 

swat.fx

//-- Declare the texture. These are set using dxSetShaderValue( shader, "Tex0", texture ) 
texture Tex0; 
  
technique simple 
{ 
    pass P0 
    { 
        //-- Set up texture stage 0 
        Texture[0] = Tex0; 
  
        //-- Leave the rest of the states to the default settings 
    } 
} 

swat.png

8csfj7w.png

swat png is testing.

meta.xml

<meta> 
    <info author="Ahmet Eren Bilgili" name="Shader" version="1.0" type="misc"/> 
    <script src="shader.lua"/> 
    <file src="swat.png"/> 
    <file src="swat.fx"/> 
</meta> 
  

Link to comment
  • MTA Team
engineApplyShaderToWorldTexture ( shader, "swat" ) 
            dxSetShaderValue ( shader, "Tex0", texture ) 

So let's think about the calling order.

Your blank shader with a blank "Tex0" variable is trying to apply the blank value to the world texture "swat".

After that pointless call you are setting the shader variable "Tex0" and pass the loaded texture to it.

And are you sure that the world texture you have to replace is called swat?

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