Jump to content

How to remove shadows from vehicles?


Gaimo

Recommended Posts

local function removeShadow(vehicle)

    local shader = dxCreateShader("files/replace.fx", 0, 0, false, "vehicle")
    local texture = dxCreateTexture("files/remove.png")

    dxSetShaderValue(shader, "gTexture", texture)
    engineApplyShaderToWorldTexture(shader, "shad_car", vehicle)
end

and

local function removeShadow(vehicle)

    local shader = dxCreateShader("files/replace.fx", 0, 0, false)
    local texture = dxCreateTexture("files/remove.png")

    dxSetShaderValue(shader, "gTexture", texture)
    engineApplyShaderToWorldTexture(shader, "shad_car", localPlayer)
end

Neither worked, I want to remove the shadow of a specific vehicle, not all.
The texture name of the shadow I know is "shad_car"

And this replace shader works because I used it in other things, I just don't understand why it didn't work for the shade.

Any solution?

Link to comment
  • Other Languages Moderators

Hello.

shad_car is a global texture, you can't apply it on a single vehicle.

I made a test and this works properly. This removes all shadows, including helicopters, the RC Baron, bikes and cars.

Spoiler

local shadowTextures = {
    "shad_rcbaron", "shad_heli", "shad_exp",
    "shad_car", "shad_bike"
}
local raw = [[
	texture tex;
	technique replace {
		pass P0 {
			Texture[0] = tex;
		}
	}
]]

local shader = dxCreateShader(raw)
local texture = dxCreateTexture("assets/images/pixel.png")
dxSetShaderValue(shader, "tex", texture)

for i = 1, #shadowTextures do
    local name = shadowTextures[i]
    engineApplyShaderToWorldTexture(shader, name)
end

 

pixel.png image.
before and after.

  • Thanks 1
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...