Turbesz Posted March 4, 2021 Share Posted March 4, 2021 (edited) I have a paintjob system, and when a player choose a paintjob from the panel and then he put on the car, the all players FPS drops 10-20 always for a few seconds... How can i fix that? This is the add paintjob part of my code: function addVehiclePaintjob(vehicle, paintjobID) if vehicle and paintjobID then local availablePaintjobs = getAvailablePaintjobs(getElementModel(vehicle)) if availablePaintjobs[paintjobID] then removeVehiclePaintjob(vehicle) vehiclesWithPaintjob[vehicle] = {} vehiclesWithPaintjob[vehicle][1] = dxCreateShader("textureChanger.fx", 0, 100, false, "vehicle") vehiclesWithPaintjob[vehicle][2] = dxCreateTexture("textures/" .. availablePaintjobs[paintjobID][2]) if vehiclesWithPaintjob[vehicle][1] and vehiclesWithPaintjob[vehicle][2] then dxSetShaderValue(vehiclesWithPaintjob[vehicle][1], "TEXTURE", vehiclesWithPaintjob[vehicle][2]) engineApplyShaderToWorldTexture(vehiclesWithPaintjob[vehicle][1], availablePaintjobs[paintjobID][1], vehicle) end end end end Edited March 4, 2021 by Turbesz Link to comment
Haxardous Posted March 5, 2021 Share Posted March 5, 2021 it's probably related to the texture size & dimensions, for e.g. using a 2000x2000 will most likely demand huge amount of performance. 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