Featured TUTORIAL Race Track Builder - Inject elevation data and terrain texture

Discussion in 'Tracks' started by Wurstkoffer, Sep 17, 2017.

  1. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    175
    Likes Received:
    83
    Ah, this is good news! I was just looking for info on reading geotiff files....
     
    Pixelchaser likes this.
  2. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    175
    Likes Received:
    83
    Now here's a challenge... I've found a source for lidar data for the entire Isle of Man. My Snaefell Mountain Course track might be due for a major update... I'll open a new thread here once I have some more details and can have a good look at the data.
     
  3. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    175
    Likes Received:
    83
    So now I'm working on a plugin for RTB to read the data directly. So far the main problem is reading in the colossal amount of data... Each block is 4000 x 4000 points covering 2km square (50cm resolution) and anything up to 400MB each, and there are 188 of them at the last count.
     
    Pixelchaser likes this.
  4. Pixelchaser

    Pixelchaser Well-Known Member

    Joined:
    Jan 4, 2015
    Messages:
    1,538
    Likes Received:
    1,046
    making progress at all Les ?
     
  5. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    175
    Likes Received:
    83
    Hey, good to hear from you!

    Yeah, progress, not bad at all. I've got a test app which figures out the right data file to open, and reads out the height data correctly. Just finished running through another conversion of the source files into the right format, this time to 3 decimal places (mm), rather than 17 (!) originally. I eventually worked out it was QGIS that was doing that in the conversion process.

    A few things still to do:
    Work out how to do some simple error checking (if a data file doesn't exist for example). I'm starting from scratch learning C#...
    Figure out how to do some data caching, though I'll probably skip that to begin with and cope with how slow it'll be, at least when starting a new project.
    Still to try building the prototype into the RTB template and see what happens (or doesn't)

    In the meantime I'm already thinking about how to make it more generically compatible with other data I already have. In theory any UK data should work...
     
    Pixelchaser likes this.
  6. Pixelchaser

    Pixelchaser Well-Known Member

    Joined:
    Jan 4, 2015
    Messages:
    1,538
    Likes Received:
    1,046
    how do you deal with trees though ?

    btw..Remember way back and you could extend the coverage of the project in general, can you still do that in a plugin ?
     
  7. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    175
    Likes Received:
    83
    Hmmm, not sure what you mean about trees... this just handles terrain data. Everything works as normal in RTB, only difference is where the height numbers are coming from.
     
  8. Woodee

    Woodee Member

    Joined:
    Mar 27, 2016
    Messages:
    31
    Likes Received:
    12
    Probably means the difference in DTM and DSM data? One is just terrain.... the other is everything including trees.
     
    Pixelchaser likes this.
  9. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    175
    Likes Received:
    83
    Ah, okay! I'll be using DTM, although DSM is also available. I tend to think dtm is more relevant for generating terrain although the post processing that gets used for removing stuff can be hit or miss. I'd still rather not have to do it myself...
     
  10. Pixelchaser

    Pixelchaser Well-Known Member

    Joined:
    Jan 4, 2015
    Messages:
    1,538
    Likes Received:
    1,046
    yeah, you dont want that trees data. i was under assumption the uk data in high resolution was just the basic all in one. i know there will be older simple terrain data etc....yeah filtering it in any way would be just futile. so there is hi res basic terrain available for this malarkey ? very out of touch with most stuff at the moment I am. and the memory is a sieve :lol:
     
  11. Woodee

    Woodee Member

    Joined:
    Mar 27, 2016
    Messages:
    31
    Likes Received:
    12
    From the UK website I used, there is both available.

    https://environment.data.gov.uk/DefraDataDownload/?Mode=survey
     
    Last edited: Aug 6, 2020
    Pixelchaser likes this.
  12. Pixelchaser

    Pixelchaser Well-Known Member

    Joined:
    Jan 4, 2015
    Messages:
    1,538
    Likes Received:
    1,046
    so DTM is terrain and DSM is surface data...:confused: feel silly not knowing that, was it always there ? :lol:
     
  13. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    175
    Likes Received:
    83
    Yes, both types are available as well as point cloud. I've just noticed there's a phase 3 for scotland that I didn't know about. In serious danger of getting sidetracked now...

    Lots of east lothian and borders... Jim Clark rally time!
     
    Last edited: Aug 6, 2020
    Pixelchaser likes this.
  14. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    175
    Likes Received:
    83
    Okay, so I've got a basic prototype plugin working, with Brendon's help. It's very slow at the moment, so I need to unpack some of the stuff that's being done by a Visual Studio addon package. But the source code for it is available, so it should be fairly simple to add in. I should be clear that you still need to do a bit of work to sort out data files to use this; changing file formats and renaming the data files so that the plugin knows where to find stuff. But I think the results will be good enough... I'll try to post some screenshots soon
     
    luchian and Pixelchaser like this.
  15. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    175
    Likes Received:
    83
    Good news! The plugin is now working pretty well. It's producing everything Wurstkoffer's hack produced without the need for xampp, geoserver etc etc. As I said in my last post, it still needs a bit of work on the data files for now, but with some work I might find a way to simplify it. It only works for UK data, because it's based around a conversion of lat/long coordinates to OSGB grid references
     
  16. Pixelchaser

    Pixelchaser Well-Known Member

    Joined:
    Jan 4, 2015
    Messages:
    1,538
    Likes Received:
    1,046
    So... did Brendon help or was he as useful as a chocolate tea cup ? :lol:

    btw have you seen the bing map data in flightsim20 yet ? i flew around the eiger last night. fucking marvellous if i may say so... maybe we grab data from FS game next :lol:

    but lets face it, we be driving the whole world very very soon guys.

    [​IMG]
     
    Last edited: Aug 22, 2020
    Les Neilson likes this.
  17. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    175
    Likes Received:
    83
    Oh yes, he rewrote a piece of code for me that speeded everything up by at least ten times. I needed to add a few more lines myself after doing a bit more research, but now it seems pretty much spot on.

    And rest assured I'll be downloading MSFS as soon as I can find enough disk space for it...
     
    Pixelchaser likes this.
  18. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    175
    Likes Received:
    83
    Still bug fixing my plugin. It works beautifully on smallish areas where I can manage with a single datafile. If I need to load in new files it tends to get into a loop which it can't get out of. There's also a separate project being done by a norwegian guy to read geotiffs, which is good news
     
    Pixelchaser likes this.
  19. Les Neilson

    Les Neilson Active Member

    Joined:
    Sep 21, 2016
    Messages:
    175
    Likes Received:
    83
    Hey Ali, how's it going? I've been meaning to ask if I could pick your brain about something... You remember when I was doing that little loop in the Yorkshire dales called Glaisdale? At a certain point I discovered I had a mesh with too many triangles to process in kseditor, and you did some magic with it so that it would work. Can I ask how you did that? I know you use 3dsmax, and I imagine there's some mesh optimisation stuff in there. I was wondering about the workflow... I assume the modification is applied to the terrain mesh only, right? And it would need to be reapplied any time the project is updated in RTB, right?
     
  20. Pixelchaser

    Pixelchaser Well-Known Member

    Joined:
    Jan 4, 2015
    Messages:
    1,538
    Likes Received:
    1,046
    no... the problem was either your one continuous road, so i split it up. or maybe scenery was split through max too. but that's all, just object separation adhering to the limits.

    i doubt rtb will let you work in chunks like would be good for kseditor. but i duno. not best pleased with the rtb dev and his program these dats. he got quite nasty online recently after being proven just how lacking in knowledge he is about the actual game engine.
     
    Last edited: Sep 10, 2020
  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