Jump to content

Custom vinyl on car


Awang

Recommended Posts

Hey guys,

I have another question for you! :D

I saw this video on the internet, but I haven't got any idea, how the creator did this custom vinyl system... I think he did some magice with shader, but I don't know :(

 

Thank you for any asnwer guys! :D

Link to comment

Yes, this is some "magic" with shaders, to get a little more detailed it works like this:

- Multiple shapes, etc. are used for the base, they can be seen in the video, the more shapes, the more options
- A render target is used for the different shapes to make a paintjob
- A shader is required, a common texture replace shader would work, however you can get more fancy adding reflections, etc.
- Cars that have a proper UV map are required, otherwise the placement will be very strange
- A pretty lengthy script handles placement of the shapes, applying the paintjob etc.

Depending on how you do it the paintjobs are created at one point and applied to the car using the shader. I did play around with a system like this over a year ago and you quickly get results, however you will have to make sure the paintjobs are properly loaded and unloaded, stored etc. I only tried my own system with a few people on a private server we used for fooling around but on weak PCs it caused quite the impact pretty quickly. That was likely caused by me using the render targets all the time, if I create something like this again I will definitely not do that again.
 

Either way, as I said before, the system is rather complex so I doubt that you will find a public one.

Link to comment

Thank you @3aGl3!
I also don't think, that I find a public one, but I interested, how it basicly work and how I can make my own one...
I wonder, how shaders can apply in real time and how to change their position and size, as we could se in the video? 

I just learn how shaders are working... :/

Edited by Awang
Link to comment

Actually there isn't that much to it, while the player is editing his paintjob you simply apply the render target to the shader and the shader will update in realtime.
Since you have to refresh the render target every frame, using dx draw functions this will also be in sync with the car.

For the shader itself I can't tell you to much, as I still don't get them fully. (In my opinion HLSL is a very strange language)
However as far as I get them they update in real time anyway, so there is no need to worry on that end either.

Link to comment
5 hours ago, Investor said:

I'm no expert but I guess it'll take a lot of maths to have the placement in 3D view rather than mapping out on 2D UV layout.

That is why I said you need a properly UV mapped car. If it's basically unfolded you don't need to do any maths, just move it around on the 2D UV map.
The one seen in the video looks probably like this:

Spoiler

R33_wire.png

Whereas an even better UV map would have the bumpers in front and behind of the car.
However you could of course also just do it like in the latest NFS incarnation and have bumpers etc. separated from the main body.

Worst UV maps look like the ones of the original SA cars, where parts are everywhere and the sides use the same texture, that will result in the paint job always being mirrored.

Edited by 3aGl3
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...