Paradoxon666 Posted August 1, 2020 Share Posted August 1, 2020 Hello, I'm planning to write a paintjob system. I already have a theory, and some of the work is already done, but I'm not sure that I'm doing it right. I involved the following stuff: - shader, engineApplyShaderToWorldTexture (on vehicle) - element data (for vehicle) - png files (the paintjobs) - render target + dxDrawImage When you select a paintjob (on client side, gui menu) it triggers a server side event (client sends the vehicle and the paintjob's id to server) Then server side sets an element data for the vehicle, the data is the paintjob's id. After that it triggers a client side event for all players, where the script applies the shader on the vehicle, creates a render target and uses dxdrawimage with on client render to draw the image/paintjob. It gets the paintjob's id by the vehicle's element data. Is this a correct method, or it's a mess? This is my first project that involves shaders, etc, i'm new in this. Will there be performance loss? how much? Link to comment
gubi Posted August 1, 2020 Share Posted August 1, 2020 Well, i wouldn't suggest to do it with rendertargets, because if you have lots of cars players can ran out of memory. Just create an texture with dxCreateTexture and apply it on the vehicle. If you need any help feel free to ask here or at our Discord. 1 Link to comment
Paradoxon666 Posted August 1, 2020 Author Share Posted August 1, 2020 Thank you! I'll check it out asap 1 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