Elvas Tower: Trackviewer and terrain - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Trackviewer and terrain Some initial Mosaic-like features Rate Topic: -----

#1 User is offline   JeroenP 

  • Fireman
  • Group: Status: Active Member
  • Posts: 179
  • Joined: 28-December 13
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 23 May 2015 - 10:31 PM

Dear all,
Upon request, I enabled a new feature in Trackviewer: showing terrain.
Attached Image: Trackviewer_with_tiling.jpg

It is enabled in the Menu->View->Additional views.

For some routes the loading of all terrain .ace files is taking too long. Therefore, when loading a route, terrain will never be shown initially. If you enable it, it will only load those tiles and their terrain that are visible at that zoom level. If you zoom out again, it will not automatically load the rest of the tiles. Only if you de-select viewing terrain and select it again, it will load new information when needed.

At least the following can be improved
  • I have not been able to test 2x2 tiles. Can anyone point me to a freeware route that uses 2x2 tiles?
  • It is possible to show boundaries between patches. This is not yet done very well.But I would like to have a 2x2 tile example before improving this.
  • Performance. TrackViewer's architecture is like a game: it redraws the screen up to 20 times per second. This makes it very responsive in general. But on older hardware this might not work very well with re-drawing all terrain. The current implementation already make sure that drawing is done texture-by-texture, and not tile-by-tile, and in indexed vertexbuffers. Unless someone has other idea's the only way I see to improve this is to draw say a tile to a Texture2D first, and then showing that texture. But getting this done right during zooming is tricky. The inset (top-right) already uses this technique. But you can also see issues with that during fast zooming.


It does not do the following (yet)
  • Colors of track is still black (or black.green). This is not very visible, so probably yellow (and an option to change it) makes sense. This addition is probably done pretty soon.
  • No lo-tiles
  • No water


I would appreciate it if someone could point me to documentation on the format of the .t files and other terrain-related files. Currently I was able to do this only by looking at the code and especially in-memory information during debug.

Jeroen.

#2 User is offline   JeroenP 

  • Fireman
  • Group: Status: Active Member
  • Posts: 179
  • Joined: 28-December 13
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 23 May 2015 - 11:02 PM

From http://www.elvastowe...623&qpid=180982

View PostGenma Saotome, on 23 May 2015 - 10:45 AM, said:

I also looked at the first edition of terrain display. Off to a good start! And... a bit of work left to do, so a couple of observations:

If you are zoomed in somewhere and toggle display terrain the only terrain that is loaded is what covers the displayed area. Back out a bit and the newly exposed area does not show terrain. Toggle the key and it all goes away. Toggle it again and once again the terrain for the current view is loaded. Might it be better to load all terrain at one go?

I tried to explain above what you were correctly observing. I tested on Bernina as well and noted that loading all terrain always is not a good option: it takes too long. So I came up with this solution.

View PostGenma Saotome, on 23 May 2015 - 10:45 AM, said:

Second observation is by a large margin, not all tiles w/ terrain will show the terrain w/o regard to the current view. I'm not sure if I want to call this a problem or not as the route I was looking at is very generous about tiles so as to provide viewing out to 10k. What is the criteria you use to choose not to display terrain in some tiles?

I am not sure I understand what the problem is you are seeing. As I now mentioned above, lo-tiles are not shown (at least not yet). I was not yet able to test 2x2 tiles. For the rest I use code from RunActivity to load a tile. It tries to load all tiles in the visible area, including tiles that are far out (which will then simply not succeed). So the code for loading 2x2 tiles is there, but my subsequent processing might not work.

Jeroen.

#3 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 15,341
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 24 May 2015 - 09:28 AM

When changing from viewing a small number of tiles to a larger number of tiles the loading time of terrain art would be reduced if you were able to use an add-more-terrain-art function instead of deleting all of the existing terrain art and then reloading it, plus the new files.

As for my question about not showing all tiles, it was just a question... just trying to understand the logic of why some show and others didn't. Seems the answer is tiles with track plus view distance, right?

#4 User is offline   JeroenP 

  • Fireman
  • Group: Status: Active Member
  • Posts: 179
  • Joined: 28-December 13
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 24 May 2015 - 12:21 PM

View PostGenma Saotome, on 24 May 2015 - 09:28 AM, said:

When changing from viewing a small number of tiles to a larger number of tiles the loading time of terrain art would be reduced if you were able to use an add-more-terrain-art function instead of deleting all of the existing terrain art and then reloading it, plus the new files.

I was not clear. When moving to a larger number of tiles and reselecting to draw, only the not-previously-loaded tiles + terrain will be loaded. So there should not be any double loading. But in case of Bernina or other photo-texture based terrain, that can still be a lot.

View PostGenma Saotome, on 24 May 2015 - 09:28 AM, said:

View PostJeroenP, on 23 May 2015 - 11:02 PM, said:

It tries to load all tiles in the visible area, including tiles that are far out (which will then simply not succeed). So the code for loading 2x2 tiles is there, but my subsequent processing might not work.

As for my question about not showing all tiles, it was just a question... just trying to understand the logic of why some show and others didn't. Seems the answer is tiles with track plus view distance, right?

My statement was wrong. I said I was loading all tiles in the visible area. But I was reusing code from 'Show world tiles'. And that code only considers tiles when there are .w files. So, I think currently only those tiles for which there are also .w files are shown in terrain. Which is wrong and needs to be corrected. So thanks for pointing this out.
Jeroen.

#5 User is offline   JeroenP 

  • Fireman
  • Group: Status: Active Member
  • Posts: 179
  • Joined: 28-December 13
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 25 May 2015 - 04:38 AM

I committed a fix. Now all tiles (except the lo-tiles/distant mountains) should be loaded. Please let me know if indeed this is as you expected now. Also, 2x2 tiles now should work and should be drawn beneath the 1x1 tiles if they are on top of each other.

Furthermore, track that is drawn upon the terrain (if you de-select the option for colored track) is now in a different color. And track colors have a preference.

Jeroen

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users