Jump to content

Help Here


Brad96

Recommended Posts

Posted

I want to explain this, each line please ... try to understand

texShader = dxCreateShader ( "shader/texreplace.fx" ) 
vehiclelights128 = dxCreateTexture("img/generic/vehiclelights128.png") 
vehiclelightson128 = dxCreateTexture("generic/vehiclelightson128.png") 
  
dxSetShaderValue(texShader,"gTexture",vehiclelights128) 
engineApplyShaderToWorldTexture(texShader,"vehiclelights128") 
  
dxSetShaderValue(texShader,"gTexture",vehiclelightson128) 
engineApplyShaderToWorldTexture(texShader,"vehiclelightson128") 
  
  

Mi Nick En El Juego : Bs|Brad

Mi Skype : fer_va_96

Posted

You want to know what each line does?

texShader = dxCreateShader ( "shader/texreplace.fx" ) -- Creates a shader element 
vehiclelights128 = dxCreateTexture("img/generic/vehiclelights128.png") -- Creates a texture element 
vehiclelightson128 = dxCreateTexture("generic/vehiclelightson128.png") -- Creates a texture element 
  
dxSetShaderValue(texShader,"gTexture",vehiclelights128) -- Sets the value of a shader element 
engineApplyShaderToWorldTexture(texShader,"vehiclelights128") -- Applies a shader to one or more world textures. 
  
dxSetShaderValue(texShader,"gTexture",vehiclelightson128) -- Sets the value of a shader element 
engineApplyShaderToWorldTexture(texShader,"vehiclelightson128") -- Applies a shader to one or more world textures. 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Solid Thanks I appreciate that, but you could get more in detail - Sets the value of a shading member? I do not understand what you mean

and referred to when he says "gTexture"?

thanx :D

Mi Nick En El Juego : Bs|Brad

Mi Skype : fer_va_96

Posted

Is "gTexture" because the shader you are using assigned that parameter name.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Is on your shader file, I really haven't got knowledge about shader scripting.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

in the shader file (.fx) is a variable (like a "local value"). That variable is used in the shader to make it dynamic (like the color for the nitro).

So when you call "dxSetShaderValue" it will change the variable. (for the nitro you can pass the color, so when you set greend , the shander will be green, after that you set red =>> the shader will be red.)

In your case is "gTexture" witch in the shader is the .png file you wanna add for the shader (vehiclelights)

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

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