Jump to content

[Help] Failed to load texture


TheBull

Recommended Posts

Helloo,I made a texture load script by looking to (engineApplyShaderToWorldTexture) in the wiki,but somehow it doesn't load the texture i want to load,it just becomes a clean white hydra,not customized or not even the original one,could you guys help me?

Here is the client.lua :

myShader = dxCreateShader( "replace.fx" ) 
engineApplyShaderToWorldTexture( myShader, "hydrabody256" ) 
----------------------------------------------------------------- 
myShader = dxCreateShader( "replace.fx" ) 
engineApplyShaderToWorldTexture( myShader, "hydradecal" ) 

Link to comment

I suggest you start reading more Lua tutorials.

The first argument is the shader you created, in this case it's 'myShader'. The third one is a texture, can be an image or a texture element created with dxCreateTexture. You need to specify a texture to replace the existing (GTA's default) one.

dxSetShaderValue(myShader, 'gTexture', TEXTURE 

If you didn't understand that then we probably can't help you.

Link to comment

I know what do you mean,but i dont even get any errors

addEventHandler ( "onClientResourceStart", resourceRoot, 
    function ( ) 
        local texture = dxCreateTexture ( "images/hydrabody256.jpg", "dxt5" ) 
        local shader = dxCreateShader ( "texture.fx" ) 
        dxSetShaderValue ( shader, "gTexture", texture ) 
        engineApplyShaderToWorldTexture ( shader, "hydrabody256" ) 
    end 
) 

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