Jump to content

Colored Search Lights


Rottey

Recommended Posts

Hello everyone,

i am trying to tint multiple search lights in a different color.

I successfully managed to tint one searchlight, by applying a shader to its world texture. Then i tried to specify a target element to the engineApplyShaderToWorldTexture function, but this does only work with objects, peds and vehicles. So currently i cannot apply different shaders to different search lights.

local searchLight = createSearchLight(0, 0, 50, 0, 0, 0, 0, 10)

local shader = dxCreateShader("client/shaders/tint-shader.fx", 0, 0, false, "all")
dxSetShaderValue(shader, "red", 1)
dxSetShaderValue(shader, "green", 0)
dxSetShaderValue(shader, "blue", 0)
dxSetShaderValue(shader, "alpha", 1)
engineApplyShaderToWorldTexture(shader, "unnamed")

-- does not work:
engineApplyShaderToWorldTexture(shader, "unnamed", searchLight)
Spoiler

spacer.png

Does anybody know a different way, to tint multiple searchlights?

Or a different way to create colored light beams? I already tryed to use material lines, but they do not look as bright as a search light, so it does not really look like a light beam...

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