raynner Posted October 14, 2020 Share Posted October 14, 2020 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
nikitafloy Posted October 21, 2020 Share Posted October 21, 2020 take here: https://github.com/alcoholiclobster/drift-paradise-mta/blob/1bc6b1bf6520b1818c54b7fb9b75f97f9b290e69/[core]/dpWheelsManager/assets/shaders/wheel.fx 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now