Does anyone know of a way to make a car leave realistic tire tracks with actual displacement in unity terrain? i’m sure this could be done, but i have no idea how to do it, so i would really appreciate any info you guys might have on this.
someone was making nice plugin for that, but cant remember its name… (saw in madewith unity twitter i think)
or test with script, get tire position, set terrain height on that spot…
for inspiration,
That does seem really neat, but I’m actually going for a like an actual realistic looking tire mark that you would be able to see in very close range in the sand, do you know of any way to do it with like an actual height map that looks like actual detailed tire marks? maybe like the same way the systems you would use to create skidmarks in racing games would work, but with actual displacement on the terrain?
Anybody? isn’t there any solution to both deform the terrain and leave a normalmapped trail behind car wheels?
I tried something similar few years ago, and what i remember it was (modifying heightmap) pretty slow and the result was bad.
Only thing that comes to mind that can (maybe) be useful for this kind of effect, is this asset i have in my bookmarks: [RELEASED] Dynamic Decals - Community Showcases - Unity Discussions
I can’t say of something already working but the technique I would use would be parallax occlusion mapping or displacement mapping.
You could search about these. I think unitys sharers already support some of these.
You then generate a height map dynamically by rendering into it your tire track. Then either technique can use that height map.
Of course of all these have performance and memory requirements that you will have to work out.
There are some talks Crystal Dynamics did on their snow system that might be helpful to you, but I don’t know if any assets that do exactly what you want. I believe the game Spintires is doing what you want, but that’s not Unity, and that’s a game that is about pretty much only that one thing of tires leaving tracks in sand and mud.
I figured actual displacement at runtime would probably be tricky to do… is there an easier way to do this with just a normal map of tire tracks then?
anybody? could it just be with a normal map?
it’s a small vehicle controller that i’ll have driving over beach sand and i just have to give it some kind of realistic tacks in the sand… any thoughts?
Look at the parralax occlusion mapping. Its just some pixel shader code. And I think unity already supports it.
While displacement probably would require tessellation depending on your mesh density.
But if your mesh is already dense then displacement mapping is just a vertex shift.
You can just use a normal map with bumb mapping but it will just affect the shading. Again unity has this already so would be easy to try.
But you still need to render your tracks. You should render them into your normal map or height map using a render target. There are lots of ways to do this depending on your game.
Height map is a little easier since you can just accumulate changes. Normals you would have to figure out the right blend or just overwrite them.
You also need this texture mapped correctly to your terrain so things line up.
I have done this before with footprints in snow. Not on unity but all the tools are there.
If I’m not mistaken there is skid marks asset in standard assets. The other place to find such implementation is Edy’s Vehicle Physics. You just need to modify default shader to support normal mapping. If you need more advanced cases you can add parallax or tessellation, but it depends on your performance budget.
thanks for the comment, do you know if there is any ready made solution that you can think of that could help me achieve this with a normal map or with parallax mapping? i actually don’t know the first thing about writing shaders or dealing with their code, so do you think this could be done creatively with any system that you know maybe on the asset store, or with any solution anyone has made to affect such graphics changes on a terrain at runtime?
those sound like exactly the type of solutions i would need, but can i really use these systems for applying a normal mapped texture, or a parallax effect? i sent a question to the edy’s vehicle physics dev, but from the videos it doesn’t look like those skidmarks are normal mapped… can you remember the skid marks asset name? i couldn’t find anything anywhere on the asset store…
I don’t think it supports normal maps, so you have to implement it yourself.