[Tutorial] Making a simple distant terrain for your map

Discussion in 'Content Creation' started by Ouerbacker, Nov 15, 2015.

  1. Ouerbacker

    Ouerbacker
    Expand Collapse

    Joined:
    Aug 2, 2013
    Messages:
    463
    -Please mention anything that looks wrong.-

    What this tutorial shows you how to do-

    -Create the basic stuff in World Machine-
    -UV it in Blender-
    -Get the distant terrain in game with textures-
    _________________________________________________________________
    What tools and resources are needed-

    -Blender
    -World Machine, preferably not the free version that is capped at 513x513 pixels
    -the attached zip - medaifire link for those with attachment problems http://www.mediafire.com/download/af8cgl100zt1n5s/distant_terrain_stuff.zip

    What preexisting knowledge is needed-

    -no Blender experience
    -some World Machine experience
    -some Beamng map making experience
    _________________________________________________________________

    Examples of distant terrain-
    BeamNG 2015-11-14 20-25-19-39.jpg BeamNG 2015-11-14 20-25-56-75.jpg BeamNG 2015-11-14 20-26-00-47.jpg
    _________________________________________________________________
    First, we will start in World Machine.

    Instead of trying to explain this aspect, I believe that it would be best for you to look at how things fit together. Therefore, the World Machine file used to generate the distant terrain shown in the picture at the top of this post is included in the attached zip.

    However, some things should be noted. For a distant terrain, 3 files are needed from world machine.

    ---Please note the file names and formats shown in the pictures. If you would like for your textures to work with the material.cs included in the attached zip, you will need to keep the current names.

    -the first of these files is the mesh output.
    Dwm 2015-11-14 19-52-50-87.jpg
    -the second is a bitmap output of the image generated by the normal map maker.
    Dwm 2015-11-14 19-53-03-81.jpg
    -the third is a bitmap output of your terrain's texture. For the sake of simplicity, this tutorial simply uses the basic coverage macro to create this texture.
    Dwm 2015-11-14 19-53-11-20.jpg

    To generate the above files, you will need to build your world with two different resolutions.

    -First, build your terrain on a high resolution such as 4096x4096. You could build your terrain at 512x512, but you wouldn't get a very nice product. After your terrain has been built, export the second and third things mentioned above.
    Dwm 2015-11-14 19-53-53-91.jpg
    -Second, build your terrain on a low resolution such as 64x64. After your terrain has been built, export the mesh output mentioned above.
    Dwm 2015-11-14 19-54-05-81.jpg

    -Now, you should have a normal map, a texture, and and an .obj.

    _________________________________________________________________
    Secondly, we will run it through Blender.

    -Start by deleting the default Blender things and importing the exported .obj from World Machine.
    blender 2015-11-14 20-29-16-34.jpg
    -Usually, the imported .obj will be off by 90 degrees. Right click on the mesh, hit r, hit x, type -90, and hit enter. The .obj will now be level.
    blender 2015-11-14 20-31-09-59.jpg
    -Enter edit mode.

    -Change the viewing perspective to Ortho by clicking the view/view Perspo/Ortho.
    blender 2015-11-14 20-34-22-49.jpg
    -Change this windows view to "top."
    blender 2015-11-14 20-35-32-77.jpg
    -Open up a second screen in blender using the button shown in the picture.
    blender 2015-11-14 20-37-09-35.jpg
    -Change this new window to the UV/Image editor.
    blender 2015-11-14 20-41-40-07.jpg
    -Create new material in the upper right and name it "distantmacro."
    blender 2015-11-14 20-41-59-07.jpg
    blender 2015-11-14 20-46-55-78.jpg
    -Open the terrain texture created in world machine by clicking image/open image.
    blender 2015-11-14 20-49-37-50.jpg
    -Scroll out with your mouse to see it like this.
    Dwm 2015-11-14 20-50-15-43.jpg
    -Reenter edit mode in the left window.
    blender 2015-11-14 20-57-01-88.jpg
    -Bring up the texture in the left window.
    blender 2015-11-14 20-57-12-82.jpg
    -Click "A" on your keyboard over the terrain texture to select it. It should become a bright orange.

    -Now, on the left window, click mesh/ UV unwrap... /Project from View (Bounds).
    blender 2015-11-14 21-01-24-60.jpg

    -Change the shading on the mesh to smooth.
    blender 2015-11-14 21-01-54-17.jpg
    -Export the mesh in the .dae format. Select "include uv textures" and "copy." For now, the export location doesn't really matter. Just export it to some place that you can remember. My documents folder is a pretty bad example of such a place.
    blender 2015-11-14 21-03-18-67.jpg
    _________________________________________________________________
    Lastly, we will get our distant terrain into Beamng.

    -This section of this tutorial is based on the idea that your map is a wip. Therefore, your map should be sitting unzipped in documents/BeamNG.drive/mods/levels/yourlevel'sname

    -Create a file named "distant" under documents/BeamNG.drive/mods/levels/yourlevel'sname/art/shapes
    Dwm 2015-11-14 20-07-59-11.jpg
    -Place the Blender .dae, the normal from World Machine, and the texture that bender tossed out in this "distant" folder. Please note that my .dae is named "untitled."
    Dwm 2015-11-14 20-09-13-06.jpg
    -Also, place the material.cs and detaildistant.png that are included in the zip at the end of this tutorial in your "distant" file.
    Dwm 2015-11-14 20-09-32-70.jpg
    -Open Beamng and enter your level.

    -Place the .dae in your map. You will need to scale it up. Personally, I prefer up-scaling the distant terrain in Beamng, but this scaling could also done in Blender.
    BeamNG 2015-11-14 20-17-52-67.jpg
    -Be happy! You should have a distant terrain now.
     

    Attached Files:

    #1 Ouerbacker, Nov 15, 2015
    Last edited: Nov 15, 2015
    • Like Like x 9
  2. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    Thank you so much Ouerbacker. I can't wait to get home and give this a shot. The 90 degree thing was giving me fits!

    EDIT: As is normal I ran with a map I'm working on and the 64X64 mesh stops scaling
    well before even approaching the dimensions of a 4096 map:p. I presume the 64X64
    mesh was specific to this tutorial and I can go with a 256 or 512 mesh? I will also
    look into scaling up in Blender.

    Overall I like this and it's a great path forward for me.:cool:
     
    #2 Aboroath, Nov 15, 2015
    Last edited: Nov 15, 2015
  3. Ouerbacker

    Ouerbacker
    Expand Collapse

    Joined:
    Aug 2, 2013
    Messages:
    463
    The 64x64 is more of specific thing. However, it alone is around 7000 triangles. Keep in mind that the normal texture will fake most shadows and details. Could I see what your world machine file look like? I might be able to offer some better advice after I see it.
     
  4. LJFHutch

    LJFHutch
    Expand Collapse
    Environment Artist
    BeamNG Team

    Joined:
    Aug 4, 2012
    Messages:
    667
    If you want to go a step further I suggest you import your actual terrain into the blender file and then match up your distant terrain to the edges of it.

    You can also do a top down screenshot ingame and use that to blend the visuals together more.
     
    • Like Like x 3
  5. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    Got the T3D scaling figured out, not paying attention as usual. Diffuse and normal maps
    look quite nice at this point.:cool:

    Would collision on this mesh be a tax on performance?....not that it matters just curious.
     
  6. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    This does not directly answer your question, but at least one or more of the backdrop meshes used in Hirochi Raceway have collision turned on.
     
  7. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    Welp, I never thought of that. Suppose I could turn on visible mesh collision and see for myself eh?
    Thanks!
     
  8. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    You're welcome, but I mis-spoke. It's East Coast USA which I was thinking of. It may also be true that Hirochi Raceway is like that, but East Coast USA definitely has collision turned on for at least one backdrop mesh.
     
  9. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    I think they are the same mesh anyway If I'm correct, at least they look it.
     
  10. Occam's Razer

    Occam's Razer
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    1,152
    If you're interested in further optimization, you could look into using Blender's retopo tools to make the topology a little more sparing, and only add detail where you need it.
     
  11. gigawert

    gigawert
    Expand Collapse

    Joined:
    Sep 6, 2015
    Messages:
    2,029
    A much easier way to make a distant terrain is to import a heightmap, enlarge the terrain's square size, and move the terrain you want to be contactable to the bottom of the scene tree.

    However, this tutorial is very detailed and helpful. ;)
     
  12. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    This sort of thing can have it's advantages over using an additional terrain:
    1. no foolishness with the terrain manipulation tools deciding to edit/highlight the wrong terrain
    2. collision! (eg you can make bounding walls outside you terrain, city streets, whatever...)
    3. no heightmap restrictions means that you are free to create overhangs, tunnels, etc - stuff that's currently impossible with a heightmap terrain in BeamNG.drive.
    There are probably other good things that I haven't thought of. I'm excited and happy to see this tutorial. It covers many things I'm not familiar with.
     
    • Like Like x 1
  13. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    Man, many good ideas here.:cool:
     
  14. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    I'm pleased the distant terrain demising line can barely be noticed. Thanks again Ouerbacker!
    Having a ton of fun with this and I can't wait to test all the ideas others have posted.:D
    screenshot_00153.png
     
    • Like Like x 2
  15. DoullPepper

    DoullPepper
    Expand Collapse
    BeamNG Team

    Joined:
    Nov 15, 2014
    Messages:
    593
    This is a good tuto man! I do the same for mine... :D For the futur I must note what Hutch say too.:confused:
     
  16. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    The difference between 64K and 128K is jaw dropping. Both have the same 4096 maps.
    64K left-128K right.
    screenshot_00154.png
     
    • Like Like x 1
  17. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    How much larger is the filesize / polygon count?
     
  18. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    The 128K was purely an experiment and a fun one at that. Regardless, the file size
    is a ridiculous 133MB or so for that one object. That mesh is 32K (4.1MB) polies
    versus 7.9K (1.3MB) for the 64K (according to Blender).
    The big deal in my mind is the outrageous file sizes of the textures at 4096.
    As .png's the diffuse and normal maps are around 60MB EACH, I assume a
    conversion to .dds with compression could help? Noobing here.

    I do gotta' say though, that 128K distant terrain scaled to 16184X16184
    looks really nice.:p
     
  19. Scepheo

    Scepheo
    Expand Collapse

    Joined:
    Feb 10, 2015
    Messages:
    601
    I'm not too knowledgeable on these matters, but I'd imagine that 64K terrain could look a lot better with some good normal mapping.
     
  20. Aboroath

    Aboroath
    Expand Collapse

    Joined:
    Aug 25, 2013
    Messages:
    3,804
    The 4096 normal map is quite detailed and seeing how it handled a more detailed mesh (double in this case), was the goal with
    the 128K terrain. From what I've seen a 4096 normal map would be good enough to cover a mesh detail that matches or
    perhaps rivals the mesh density of a regular drivable 4096x4096 map. I have no idea what that density would be except
    to say a distant terrain could theoretically have the same detail as a 4096 Trynelgren and you wouldn't be able to tell the
    difference....except for the two IBM Watsons in the back yard running it.

    The 64K mesh is meant to hold down CPU usage while providing a basic look of distant terrain. Doing that with a 4096
    texture is excellent for long range vistas and quite adequate for the effect it provides. I just had to take it further and into
    'sillyville'.:p Hope this makes sense.
     
  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