Gaimo Posted May 13, 2021 Posted May 13, 2021 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?
Other Languages Moderators androksi Posted May 13, 2021 Other Languages Moderators Posted May 13, 2021 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. 1
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