I’m wondering if there’s a standard way to render the racing line on a race track, not like arrows, but the build up of rubber from the tires?
I’m thinking of making another lower poly spline/mesh that follows the racing line and then use a decal material of sorts. Do you think this would work or maybe it’s something else like a shader? Obviously I could add it to the texture but it’s then not the racing line and in the same position all around the track.
Does this matter though? Aside from being the most performant and easy to implement option, if the player is travelling at speed, they’re not going to be paying attention to that specific detail. If you want it to gradually build up over the course of the race, you could even do something like this:
R channel G channel B channel A channel
Then you just use a shader that uses the A channel as a ramp based on lap progress, use the RGB channels individually as the lines for the increment of laps.
They were doing it in games in the 90s where it was really just a matter of adding a polystrip over top and that’d look fine because the fidelity of 90s games was way lower, so you could get away with this sort of thing. On top of that, that was back in a time where putting in tech like that was something you could have as a promotional feature. “Look at our SUPER GRAPHICS,” y’know? But see, this misses the key part of what I said:
No player is going to be paying attention to if you used what really does amount to an overengineered solution to what is a relatively simple aesthetic problem that you can solve with a track texture and a gradient. Hell, you don’t even have to do it the way I did in my example. With proper UVs, you can get away with a more simple shader and a more simple texture pack.
On PC in 2024 I’d give each section of the track its own texture. Or I suppose you could generate and place alpha blended poly strips down ahead of the player and destroy them when they go out of view. I guess then it’ll be a question of whether you generate the strips on the fly using a bezier function or instantiate them from a selection of previously created strips, but this could get messy.
The textured approach would definitely be more performant provided the GPU has enough memory. It will also allow for a much more varied track surface.
It is just a strip of textured polygons above the road. In some early games the strip would be even untextured.
By default performance is not a concern, and by multiplying number of differently textured segments you increase amount of work that will need to be done building the track. I’d use decals and call it done, because decals can be adjusted without dealing with the entire asset.