1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Stuck, Having problems with creating your mod? Let us help you: Mod Support
  3. The ingame repository is currently offline for maintenance. Downloading and installing the mods manually via our website will still work: Repository
    Dismiss Notice

[Tutorial] Adding heightmap roads with Blender V2

Discussion in 'Content Creation' started by LJFHutch, May 8, 2017.

  1. LJFHutch

    LJFHutch
    Expand Collapse
    Environment Artist
    Staff Member

    Joined:
    Aug 4, 2012
    Messages:
    645


    So the last version was a bit complicated. This is pretty much self contained; you can open the blender file up, make some changes, press render and it will generate everything for you. Substitute your own source heightmaps instead of the template island or reroute some wires and sculpt something from scratch.

    This file uses nodes to render the roads you create with bezier curves out onto a heightmap and includes a preview scene so you can quickly see your changes with the press of a [few] buttons.

    Let me know if you have any issues using this and feel free to ask questions. Hopefully this can help some of you get into making terrains a bit easier.









    If you're even a little interested in making maps I recommend you give the file a try, it's pretty easy and extremely fast. From the moment you hit render you might have to wait less than a minute to drive the road directly in the game.
     

    Attached Files:

    burilkovdeni likes this.
  2. ned228

    ned228
    Expand Collapse

    Joined:
    Jul 17, 2014
    Messages:
    243
    How do you line up the roads with the height map. For me the position of the roads are higher than the map
     
  3. LJFHutch

    LJFHutch
    Expand Collapse
    Environment Artist
    Staff Member

    Joined:
    Aug 4, 2012
    Messages:
    645
    It's hard to say without more info. How much higher? Can you post some screenshots of what you're working on?
     
  4. ned228

    ned228
    Expand Collapse

    Joined:
    Jul 17, 2014
    Messages:
    243
    Significantly. I am trying to line up the roads with an extra plane so I can see where the terrain is In the roads render layer. This could be the problem. Is there another way to see the terrain to line up the roads. I also noticed that the render settings where different between the terrain layer and the road layer. I can post screenshots later today
     
  5. austint30

    austint30
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    192
    I was having the same problem with my Mt. Nebo, Arkansas map that I have recently got into working again. Except in my case, the roads kept sinking into the ground towards the lowest points in the map. I successfully solved this issue by placing a plane at the exact same height of the base of the terrain and moved it to the road render layer. However, another issue arises. I could no longer get transparency for the roads to layer it on top of the heightmap. So, I created a linked duplicate of the road and moved it to another layer. So now, I have 3 render layers: the terrain itself; the road with the base plane (no alpha); and then just the road with the alpha. I then used the Set Alpha node to set the alpha of the non-transparent road using the transparent road's alpha and then layered it on top of the terrain. This fixed the sinking problem on all my roads.

    Terrain layer:


    Road with plane layer:


    Road used for alpha:


    Compositing nodes:
     
    #5 austint30, Aug 27, 2017
    Last edited: Aug 27, 2017
  6. Raider

    Raider
    Expand Collapse

    Joined:
    Sep 23, 2013
    Messages:
    288
    I try this method, because I want smooth roads, but i can't import into BNG png generate by blender. I exported other map and i open png from other map in paint.net and i paste my map and it's working, but something like this happens. I change resolution of render in blender, but it doesn't change a lot
    1.png 2.png
     
  7. austint30

    austint30
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    192
    This staircase effect is caused by your color depth being too low. In the Blender output settings, change the color depth from 8 to 16 and choose BW rather than RGBA. Then try importing it to BeamNG again. 8 bit color depth can only go up to 255 value, which is simply not enough for smooth terrain. 16 bit, though, can have values as high as 65,535 which is far better for terrain.
     
    #7 austint30, Sep 27, 2017
    Last edited: Sep 27, 2017
  8. Raider

    Raider
    Expand Collapse

    Joined:
    Sep 23, 2013
    Messages:
    288
    It was already set to 16bit, i choose Bw, but it doesn't help much
     
  9. austint30

    austint30
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    192
    Are you sure? I only get the staircase effect when I export to 8-bit, not 16. Otherwise, you could try using the smooth tool in the terrain editor to smooth the slopes.

    Try this:
    Make sure the output is set to 16-bit BW in the output; re-render; then in the image preview window, click image > save as image.
     
    #9 austint30, Sep 27, 2017
    Last edited: Sep 27, 2017
  10. Raider

    Raider
    Expand Collapse

    Joined:
    Sep 23, 2013
    Messages:
    288
    I can't import .png straight from blender, because this happens: Heightmap failed to load. Maybe this is a problem
    upload_2017-9-27_20-21-31.png
     
  11. austint30

    austint30
    Expand Collapse

    Joined:
    Aug 7, 2013
    Messages:
    192
    Hmm. I'm not exactly sure what's going on. I've never had this error before. Try renaming the image. Instead of using a dot, use an underscore for the name of the file. Maybe Torque3D doesn't like it for some reason.

    Instead of this:
    theTerrain10.ter.depth.png

    Change it to:
    theTerrain10_ter_depth.png
     
  12. Raider

    Raider
    Expand Collapse

    Joined:
    Sep 23, 2013
    Messages:
    288
    No, that's not it, i don't know, can you try yourself using this blend file render and import into beamng some map
     
  13. Nadeox1

    Nadeox1
    Expand Collapse
    BeamNG.Support
    Staff Member

    Joined:
    Aug 5, 2012
    Messages:
    9,956
    Usually happens when your heightmap is in the wrong place.
    The game will load heightmaps correctly if those are placed inside the game's directory (Steam/Steamapps/Common/BeamNG.Drive/levels).
    If your heightmap is in the UserFolder (Documents/BeamNG.Drive...) then that could happen.