TUTORIAL ROAD - How-to ? (physical and visual layer)

Discussion in 'Tracks' started by luchian, Jul 26, 2017.

  1. luchian

    luchian Administrator Staff Member

    Joined:
    Jun 3, 2014
    Messages:
    3,007
    Likes Received:
    1,493
    Courtesy of @LilSKi
    *******************

    Another topic that can be discussed a lot. But before that, it is always best to have a good start point. So Lilski laid down some steps of his best practice on how to go about building actually the most important part of your track: THE ROAD [insert holy music]

    Well here is another best practice post. In this we will discuss the difference between the visual road and the physical. There has been some confusion and misinformation going around I would like to clear up and set the record straight.

    First off years ago there was no difference between the visual and physical road. What you saw is what you were driving on. This was fine but with the advancement of the physics engines we needed more road detail to feel all the little bumps that every track has. The problem was if you added too much detail to the visual road the framerate suffered. So what developers came up with was to separate the physical road from the visual. This allowed a very high detail, and invisible, physical road to hide under the visual.

    Just to show the difference this is what they look like.

    Visual. The key here is the poly count needs to be just high enough so your turns looks smooth and not a bunch of straight lines. Notice the turn is of a higher detail than the straight.
    1.png

    Physical
    2.png

    Be reasonable with your numbers. For example Kunos Monza is exactly 400k triangles and the Nordschleife is around 730k triangles. The key is to make sure you set the renderable setting in the editor to false. Also obviously the the physical model should be called 01ROAD and the visual can be anything else like VISROAD

    The reason this is important is if the physical layer is low count like the visual you get this "notchy" feel to your track. If you have a hill instead of driving smoothly over it you are essentially driving over one flat plane after another.

    You want this
    3.png

    Not this. This is exaggerated for show.
    4.png

    There are many different ways to accomplish this so I will simply show you a few things not to do.

    First is a simple subdivide. You start off with something like this.
    5.png

    A simple subdivide looks like this. All you did was add to the poly count but didn't change the shape.
    6.png

    Then there is the Catmull-Clark subdivide. Notice it smoothed it out as well as adding to the poly count. This obviously also changes the shape somewhat and there are different ways around it. This is meant to show the basic concept.
    7.png

    One other thing to watch out for is the spline you build the track from. You have to make sure the spline resolution is properly set. Here are some examples.

    By default the resolution for the spline in blender is 10 or 12. Shown here it is set to 2 to better show what is happening.
    8.png

    You can see no matter how many sections you add to the road it will always follow the resolution of the spline. And remember it isn't just doing this on a turn. It is also doing this up and down hills causing the constant bumps we all know and hate from many conversions from older sims. What you want is this. Here the spline resolution is set to 64 and the road is now smooth with the same poly count as before.
    9.png

    The next part will show how to apply different displacement modifiers assigned to different vertex groups to create bump details in your now higher poly road surface. After that we will apply decimate and subdivide modifiers to get the triangles shown above in the second shot. If I have time later I will post it but not likely until Monday or Tuesday.

    PART 2, in next post.
     
    Last edited: Jan 16, 2019
  2. luchian

    luchian Administrator Staff Member

    Joined:
    Jun 3, 2014
    Messages:
    3,007
    Likes Received:
    1,493
    Courtesy of @LilSKi
    *******************


    Part 2.
    I am going to go into how to actually make the second physical layer out of the visual. First off I built my track from a Bezier curve and I wanted to mention one key thing that somewhat ruined my week a while back. Under the curve options make sure "Twisting" is set to "Z-Up". by default it is set to minimum which if you mess with the camber in one section it can slightly twist the whole track.

    OK so step one in track making is getting your layout. I'm not going to go into any detail on that as there is TONS of info about that. So we are going to start off that you already have a spline made and an array of planes applied to the curve like this.
    10.png

    The array modifier must be applied but do not apply the curve modifier.

    As you can see this is fairly low poly. I am going to exaggerate a bit on this so things are easier to see. This is the point at witch you can add some polys to make the turns smooth. What I do is select just the edges of the section that needs some more detail and then subdivide it. A simple subdivide works here since it will take the shape of the spline and smooth it out. Without the spline it will simply add polys without changing the shape. This is why it is important to always keep the curve modifier intact.
    11.png

    Do this as many times as needed to get the curves to be smooth. The straights are less important but they can be fairly detailed. If you go too low you will see the straight lines going over a hill if there is an elevation change.

    Now remember you can drive on this for testing by simply calling it 01ROAD. In the beginning it is easier to keep things simple and make sure everything is as you want it. Once you are happy with it or have it pretty darn close you simply duplicate it. I moved it up on this for show but when dealing with things like this it is best to send it off into another layer with the M key.

    Now I simply subdivided 3 or 4 times. You can use the tool for this or the modifier it is up to you. The tool is somewhat of a one way street where using the modifier can simply be deleted at any time. Also remember if you do need to make changes BOTH still have the curve modifier active. So simply change the curve and both will be identical.
    12.png

    Now comes the fun and tricky part. Adding bumps to your surface. Bumps are only applied to the physical layer. When you are done you shrinkwrap the visual over the physical and it matched the bumps as close as it can.

    If you don't know how to use vertex groups then read up on it. I'm not going to go into detail on how to do it since it is fairly simple to learn on your own. But basically you create a vertex group and select the verticies you want assigned to the group.

    I made two groups in this. One will be a rough bump and one more of a wave. Go ahead and assign a displacement modifier to your physical mesh. You will see a section for texture and vertex group. First select the group you want it assigned to. Then click "new" under the texture section. It would be a good thing to name this texture at this time. Next you want to click the little icon that is circled in red below. It sends you off into the texture section automatically. Below that is the texture section. It is the red and white checker board icon.
    13.png

    Play with these settings all you want. I like clouds as it is very versatile. Here are the two sections both done with the cloud texture. These are both set to extremes for show. My largest bumps on Bridgehampton are .065.
    14.png

    Also they do not have to be fully separated like this either. If you want a small amount of noise throughout the whole track you can have a vertex group with the whole track as well as the separate sections. A vertex can be applied to multiple groups.

    So now we want to make that irregular surface as shown in my shot int he first part of this. This is as simple as applying a decimate modifier and then a subdivide modifier.
    15.png

    Play with the numbers as you see fit and subdivide as much as you need.

    And there you have it. As always I hope this helps someone in their track making ventures. And if anyone has anything to add please do.
     
    Last edited: Jan 16, 2019
  3. luchian

    luchian Administrator Staff Member

    Joined:
    Jun 3, 2014
    Messages:
    3,007
    Likes Received:
    1,493
    In order to test each of the versions, one has to apply all modifiers and split the road into <65k sections, right ? But since you always seem to have some ace up the sleeve @LilSKi did you use any trick to avoid applying the modifiers ? (I can't think at any).

    Also, when referring to defining different vertex groups, you'd do that arbitrary (like, knowing one section is bumpier - make one group only there) or are you using some randomizer thingy ?

    (In my case, since I do not know of any bumpier sector, I've just applied it to the entire track).
     
  4. LilSKi

    LilSKi Well-Known Member

    Joined:
    Apr 6, 2015
    Messages:
    370
    Likes Received:
    329
    make a single piece road that you put your noise onto. Then you shrink the road that is already split into pieces down onto the single high res road with the noise. So all you have to do is tweak the single piece road and the pieces should follow and you only export those.

    As for vertex groups I would study video and note which sections look rough and assign the groups manually.
     
    pl4sma2389 and luchian like this.
  5. Prototype

    Prototype Well-Known Member

    Joined:
    Dec 24, 2018
    Messages:
    329
    Likes Received:
    588
    Location:
    JHB / SF
    Thanks for sharing this guys. Makes a lot of sense.
    Will be implementing this technique for sure.
    Basically the collision mesh concept translated to roads. + 1
     
    luchian likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice