Double, double toil and trouble... Mesh Work

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scottb613
    2500 Post Veteran


    • Apr 2003
    • 2848
    • Downeast Maine (soon)
    • ORTS

    #1

    Double, double toil and trouble... Mesh Work

    Hi Folks,

    Ever wonder what would happen if we doubled the terrain mesh resolution from [ 8m or 65,536 data point per tile ] to [ 4m or 262,144 data points per tile ] in ORTS?

    I have...


    4m ORTS terrain created from 1m LIDAR Geodata displayed in TSRE GenX v0.12



    You almost don't need to manipulate terrain - just place your road and track sections down and you're done.

    Just an experiment.


    Regards,
    Scott

    PS - I think I solved the LIDEX Terrain Mesh to Map Tile coordination issue.
    Last edited by scottb613; 08-11-2026, 05:43.
    <a href=https://www.trainsim.com/forums/filedata/fetch?filedataid=80663&type=full title=thumb_80663.png >thumb_80663.png</a>​ My Blender Models
  • pwillard
    3000 Post Veteran



    • Nov 1999
    • 3070
    • Cumming Ga
    • ORTS

    #2
    Oh man... Nice.
    http://www.railsimstuff.com
    Just Blender now, 3DCrafter only when I have to.
    Formerly The Keystone Works (All Permissions Granted)
    Things I work on: https://github.com/pwillard

    Comment

    • eric
      9500 Post Veteran and Administrator



      • Dec 2002
      • 9583
      • NS MP245.4 CNO&TP South District
      • English, SQL
      • General

      #3
      Scott and I discussed it a couple weeks ago as a "what-if".... I had a planned sit down with James and Chris from the ORTS team over the weekend, and this topic came up in the context of "we're finally getting a new shapefile and its associated capabilities... so why not better terrain resolution?"

      Fortunately they're receptive to it.

      . landnrailroader Jerry will need to stay tuned as this progresses, because I think it solves a lot of the issues you have around terrain accuracy.

      If you like what you see here at Trainsim.com, be it the discussions and knowledge in the forums, or items available in our library, I hope you'll consider a paid membership to help support keeping the site operating.... Thanks!

      Comment

      • scottb613
        2500 Post Veteran


        • Apr 2003
        • 2848
        • Downeast Maine (soon)
        • ORTS

        #4
        Hi Folks,

        Thanks Pete!

        It looks fantastic while moving around in TSRE - seeing detail I’ve never seen before.

        It would be amazing - to make some big revolutionary and/or evolutionary changes to ORTS.

        It’s all about teamwork.

        Regards,
        Scott
        Last edited by scottb613; 08-11-2026, 06:21.
        <a href=https://www.trainsim.com/forums/filedata/fetch?filedataid=80663&type=full title=thumb_80663.png >thumb_80663.png</a>​ My Blender Models

        Comment

        • EldoradoRailroad
          Senior Member

          • May 2010
          • 212

          #5
          Oh...what is the resource hit..memory wise..and performance wise?

          Steve

          Comment

          • eric
            9500 Post Veteran and Administrator



            • Dec 2002
            • 9583
            • NS MP245.4 CNO&TP South District
            • English, SQL
            • General

            #6
            Hard to say because it's not behaving in ORTS just yet. In TSRE, it's negligible on performance using the test route that Scott produced..
            If you like what you see here at Trainsim.com, be it the discussions and knowledge in the forums, or items available in our library, I hope you'll consider a paid membership to help support keeping the site operating.... Thanks!

            Comment

            • scottb613
              2500 Post Veteran


              • Apr 2003
              • 2848
              • Downeast Maine (soon)
              • ORTS

              #7
              Originally posted by EldoradoRailroad
              Oh...what is the resource hit..memory wise..and performance wise?

              Steve
              Hi Steve,

              In TSRE - without any performance adjustments - on an empty route of 67 tiles - with just a terrain mesh and every tile displaying a "Map Tile".

              Seemed to be no different in TSRE just moving around.

              I did make an adjustment to TSRE and how it handles "map tiles" - so we're not loading the entire route's worth into memory at once.

              I also have a leg in the Flight Sim community where 16gb to 24gb is the norm - to run the sim - and 64gb is recommended for "best performance". So, I don't think we'll be anywhere near that league.


              It's still just a test.

              4m Mesh:
              4mMem.jpg

              8m Mesh:
              8mMem.jpg

              Regards,
              Scott
              <a href=https://www.trainsim.com/forums/filedata/fetch?filedataid=80663&type=full title=thumb_80663.png >thumb_80663.png</a>​ My Blender Models

              Comment

              • scottb613
                2500 Post Veteran


                • Apr 2003
                • 2848
                • Downeast Maine (soon)
                • ORTS

                #8
                Hi Folks,

                If this ever moves forward - I would not foresee removing 8m mesh - just adding the ability to support HD 4m mesh - as a route builder’s prerogative.

                Regards,
                Scott
                <a href=https://www.trainsim.com/forums/filedata/fetch?filedataid=80663&type=full title=thumb_80663.png >thumb_80663.png</a>​ My Blender Models

                Comment

                • docmartin
                  Member

                  • Dec 2004
                  • 99
                  • Bossier City, LA, USA

                  #9
                  As a route builder, I would greatly welcome an enhanced terrain mesh. In many places in my Chiltern route the current mesh is just too coarse for the terrain effects I need and I have to substitute home-made terrain objects as a result. I well remember the days in MS Flight Simulator when a doubled mesh became available and the huge difference it made to the terrain. So I very much hope that this initiative goes forward.

                  I have been watching your work on TSRE, Scott, and am both amazed (not being a coder myself) and grateful for what you are doing (and this is not to denigrate the tremendous improvements that Eric has already made or the great value of Goku's original work). In particular, though, I suspect the Activity Editor needs a fair amount of work. A trainsimming friend of mine who has written a lot of quite sophisticated activities for Chiltern using the original MS AE tells me he has found the transition to the TSRE AE very difficult and has had to abandon his attempts to write further activities. As Chiltern has become too complex for MS AE and only opens now in TSRE, this is a great disappointment. If you want to send me a PM I can give you a few more details.

                  Keep up the good work and thanks!

                  Martin

                  Comment

                  • scottb613
                    2500 Post Veteran


                    • Apr 2003
                    • 2848
                    • Downeast Maine (soon)
                    • ORTS

                    #10
                    Originally posted by docmartin
                    As a route builder, I would greatly welcome an enhanced terrain mesh. In many places in my Chiltern route the current mesh is just too coarse for the terrain effects I need and I have to substitute home-made terrain objects as a result. I well remember the days in MS Flight Simulator when a doubled mesh became available and the huge difference it made to the terrain. So I very much hope that this initiative goes forward.

                    I have been watching your work on TSRE, Scott, and am both amazed (not being a coder myself) and grateful for what you are doing (and this is not to denigrate the tremendous improvements that Eric has already made or the great value of Goku's original work). In particular, though, I suspect the Activity Editor needs a fair amount of work. A trainsimming friend of mine who has written a lot of quite sophisticated activities for Chiltern using the original MS AE tells me he has found the transition to the TSRE AE very difficult and has had to abandon his attempts to write further activities. As Chiltern has become too complex for MS AE and only opens now in TSRE, this is a great disappointment. If you want to send me a PM I can give you a few more details.

                    Keep up the good work and thanks!

                    Martin

                    Hi Martin,

                    I am so impressed with the terrain produced. The LIDEX work for 4m terrain is basically done. TSRE needs a considerable amount of work - as I just made changes to make it capable of displaying 4m terrain - nothing more - all the tools will need to be tested and many modified. ORTS will have to make a decision if they wish to proceed down this path and then find a developer with interest. It's far from a certain path but my initial test looks promising.

                    Activity Editor requires a full rewrite - I just haven gotten back there yet. The underlying code engine upgrade was a major task I did not foresee - thankfully - I had a good map from those who went before me. What I truly need is careful methodical testing of the changes I have made - the list is quite long - and feedback. The Path Editor is done and a prerequisite for any AE - has anyone truly tested it and tried to break it - I don't know.

                    Yeah - this is what Open Source should be - building on the shoulders of giants. I have often wondered how Piotr felt on day one - "today I am going to make a Route Editor" - the task was monumental and overwhelming - far beyond anything I have ever attempted. Mindboggling. Probably very similar to Wayne's "today I am going to make a Train Simulator" moment - I have nothing but respect for both of them. Eric has faithfully maintained and improved the code for years - while wearing like a thousand other hats - and giving us a home. This is definitely a team effort.

                    Thanks for your comments.


                    Regards,
                    Scott
                    Last edited by scottb613; 08-11-2026, 07:56.
                    <a href=https://www.trainsim.com/forums/filedata/fetch?filedataid=80663&type=full title=thumb_80663.png >thumb_80663.png</a>​ My Blender Models

                    Comment

                    • EldoradoRailroad
                      Senior Member

                      • May 2010
                      • 212

                      #11
                      Originally posted by scottb613

                      Hi Steve,

                      In TSRE - without any performance adjustments - on an empty route of 67 tiles - with just a terrain mesh and every tile displaying a "Map Tile".

                      Seemed to be no different in TSRE just moving around.

                      I did make an adjustment to TSRE and how it handles "map tiles" - so we're not loading the entire route's worth into memory at once.
                      Scott,

                      So may I assume that you have instituted a modicum of memory management here? Tiles that were loaded but no longer in view are tossed out of memory?

                      Thanks,
                      Steve

                      Comment

                      • eric
                        9500 Post Veteran and Administrator



                        • Dec 2002
                        • 9583
                        • NS MP245.4 CNO&TP South District
                        • English, SQL
                        • General

                        #12
                        Originally posted by EldoradoRailroad
                        Oh...what is the resource hit..memory wise..and performance wise?
                        James Ross from ORTS did some benchmarking, and saw only negligible hit:

                        Using the test route without and with the change, GPU memory committed 1200 MB -> 1261 MB (+5%)
                        If you like what you see here at Trainsim.com, be it the discussions and knowledge in the forums, or items available in our library, I hope you'll consider a paid membership to help support keeping the site operating.... Thanks!

                        Comment

                        • scottb613
                          2500 Post Veteran


                          • Apr 2003
                          • 2848
                          • Downeast Maine (soon)
                          • ORTS

                          #13
                          Originally posted by EldoradoRailroad
                          Scott,

                          So may I assume that you have instituted a modicum of memory management here? Tiles that were loaded but no longer in view are tossed out of memory?

                          Thanks,
                          Steve
                          Hi Steve,

                          Yes—there’s a key difference between map imagery and terrain elevation data.

                          Map overlays only stay resident inside the current Tile LOD area. Once the camera moves and an overlay leaves that area, both its CPU image data and GPU texture are released. Unsaved Map-window images are intentionally kept so user work isn’t lost.

                          Terrain elevation tiles unload the same way, as long as they aren’t modified or selected. So the system is not designed to keep every 4 m tile you’ve ever passed over.

                          Your question pushed me to re-check the experimental 4 m destruction path. I found an old assumption in the terrain destructor: it frees 257 height rows—correct for 256‑sample/8 m tiles—but a 512‑sample/4 m tile allocates 513 rows. Result: roughly half of a 4 m tile’s CPU height array is currently left behind. That will be fixed to use the tile’s actual sample count.

                          For scale:
                          • 8 m tile CPU array: ~264 KB
                          • 4 m tile CPU array: ~1 MB
                          • Current unreleased portion of a 4 m tile: ~513 KB

                          This is separate from James’s Open Rails test, where GPU memory rose from ~1200 MB to ~1261 MB. That still looks promising, but more testing is needed.

                          The 4 m path is still experimental—meant to display higher‑res terrain and imagery, not a finished or optimized feature. I’m actively cleaning up issues as they surface, and this was a good catch.

                          Short version: TSRE already manages terrain and map-overlay residency, but the 4 m experiment exposed one hard‑coded 8 m cleanup rule. I’ll correct that before calling the 4 m path memory‑safe.

                          Thanks for raising it.

                          Regards,
                          Scott



                          <a href=https://www.trainsim.com/forums/filedata/fetch?filedataid=80663&type=full title=thumb_80663.png >thumb_80663.png</a>​ My Blender Models

                          Comment

                          • eric
                            9500 Post Veteran and Administrator



                            • Dec 2002
                            • 9583
                            • NS MP245.4 CNO&TP South District
                            • English, SQL
                            • General

                            #14
                            The latest unstable version does have the support for the 4m grid but the terrain patch mapping still looks like it’s off.
                            If you like what you see here at Trainsim.com, be it the discussions and knowledge in the forums, or items available in our library, I hope you'll consider a paid membership to help support keeping the site operating.... Thanks!

                            Comment

                            • scottb613
                              2500 Post Veteran


                              • Apr 2003
                              • 2848
                              • Downeast Maine (soon)
                              • ORTS

                              #15
                              Originally posted by eric
                              The latest unstable version does have the support for the 4m grid but the terrain patch mapping still looks like it’s off.
                              Hi Eric,

                              I don't think that's my end - that's for ORTS - right?

                              Regards,
                              Scott
                              <a href=https://www.trainsim.com/forums/filedata/fetch?filedataid=80663&type=full title=thumb_80663.png >thumb_80663.png</a>​ My Blender Models

                              Comment

                              Working...