Jump to content

No Vehicle Taillights


chris1384

Recommended Posts

Hi there! For a while I have this strange issue with my taillights shader. I tried using a different texture but it seems it doesn't show up (it's black) and it stays like that even if the taillights resource is restarted or stopped. Is there a way I could fix it? Thanks.

Clientside

addEventHandler("onClientResourceStart", resourceRoot, function()
local shader1 = dxCreateShader("texreplace.fx")
local lightsoff = dxCreateTexture("vehiclelights128.png")
engineApplyShaderToWorldTexture(shader1,"vehiclelights128")
dxSetShaderValue(shader1, "gTexture", "vehiclelights128")

local shader2 = dxCreateShader("texreplace.fx")
local lightson = dxCreateTexture("vehiclelightson128.png")
engineApplyShaderToWorldTexture(shader2,"vehiclelightson128") 
dxSetShaderValue(shader2, "gTexture", lightson)
end)

Shader

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

 

Link to comment
addEventHandler("onClientResourceStart", resourceRoot, function()
  local shader1 = dxCreateShader("texreplace.fx")
  local lightsoff = dxCreateTexture("vehiclelights128.png")
  engineApplyShaderToWorldTexture(shader1,"vehiclelights128")
  dxSetShaderValue(shader1, "gTexture", lightsoff)

  local shader2 = dxCreateShader("texreplace.fx")
  local lightson = dxCreateTexture("vehiclelightson128.png")
  engineApplyShaderToWorldTexture(shader2,"vehiclelightson128") 
  dxSetShaderValue(shader2, "gTexture", lightson)
end)

Try this and make sure that the paths for the textures in the script are correct. Also, did you add the textures in the meta file? What does the debugscript say?

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