Jump to content

[help] shader replace texture and setColor


raynner

Recommended Posts

Hello friends, i know the basics about shader so i need your help!

I would like to replace textures and define the color for them in addition to just sub-replacing it saves me the trouble of having repeated textures of different colors just add a single white!
but I don't know how to write this in the .fx file, I know that I should create variables like float red;
and use
dxSetShaderValue (theShader, 'red', 1.0)

but I don't know how to do it in the file.fx

 

my fx

texture tex;

technique TexReplace
{
    pass P0
    {
        Texture[0] = tex;
    }
}

my lua
 

myShader = dxCreateShader('shader.fx', 0, 0, false, 'object') 
terrain = dxCreateTexture("Cut_1.png")
dxSetShaderValue(myShader, "tex", terrain)

object = createObject(3355, 0, 0, 3)

teste = engineApplyShaderToWorldTexture(myShader, 'Cut_Color', ped)
outputChatBox(tostring(teste))

everything works perfectly but i would like to add white .png and set the color via shader
it's possible ?
I saw some similar things on the forum but none of them worked with replace so I don't know how to do it !!! :/

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