Working with Matlab and tileedit

JMW

Aspiring Addon Developer
Joined
Aug 5, 2008
Messages
611
Reaction score
52
Points
43
Location
Happy Wherever
Have installed Matlab runtimes as per readme for tileedit (in Program files by default).
Tileedit runs, but what do I do now?
I want to use the "rudimentary editing capability for elevation data" Martins mentioned to level out runways etc.
I've tried loading a "surface" tile but nothing shows, only some data in the "Lat"/"Lng" range fields and loads of error messages in the command window.
Guess I need to load the "elevation" data somehow but don't have a clue....
Have I set up things right?
Any help appreciated....
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
Sorry, there isn't much documentation (yet).

Essentially, select 'Open' from the file menu, then pick the directory root of the texture tree you want to inspect (e.g. Textures\Earth).

This should then load the lowest resolution Earth tile (global coverage, 128x128 pixels for the surface texture). In addition, other layers of the same tile can be displayed beside it (elevation, water mask, night lights, if applicable).

Make sure that "Pan and zoom" is selected for mouse action. Move the mouse into one of the tile displays. The tile should then be surrounded by a red square. Click on it, and this should load the child of the root tile (level 2, still global coverage, 256x256).

Keep clicking, and at some point you'll see that the rectangle only covers half of the map (western or eastern hemisphere). This is the start of the quadtree. At the deeper levels, each tile will have 4 children. You can descend into the tree by moving the mouse into one of the quadrants (will be indicated by a red square) and click.

You can move up to the parent level by moving the mouse to the centre of the image until a red X appears, and click.

You can shift the view to a neighbour tile by moving the mouse towards the centre of one of the edges, until an arrow appears, and click.

You can visit any part of the quadtree even if no texture or elevation file exists for that tile. tileedit then interpolates from a subrange of an ancestor tile, just like Orbiter.

You can see the 'logical' designation of the tile in the info block at the top left. The 'physical' address of a tile is shown below the tile display. When these differ, you know that you see an interpolated, synthesized tile.

By picking a different mouse action, you can edit elevation data (no other layers currently allow editing). If you edit an elevation tile, the modifications will not be written to the original elevation tile, but to a new file under 'Elev_mod' in the directory tree. The mod tiles will contain the differences to the original tile. By deleting a mod tile, you undo all modifications to that tile.

That's all I can think of at the moment. Most should be fairly self-explanatory. Let me know if anything doesn't make sense.

Note that currently there is no support for creating a new elevation tile that isn't yet present in the tree. I have a matlab script that generates a new tile by interpolating the parent, but that hasn't been incorporated into tileedit yet. You could always just copy an arbitrary tile file, and then use the mod function to completely replace it.

Edit: I should also mention that the elevation mod tiles only get written to disk when you navigate away from the edited tile.

Also, tileedit automatically propagates the edits to all the ancestor tiles (and the neighbour siblings for edits in the overlap areas), but not to the children. You should always make the edits on the tiles in the leaf nodes of the quadtree.
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
Thanks for the instructions martins, but I'm getting the exact same errors as mxk

Hello, I try to work with tileedit but without success because when I try to load the contents from Textures\Earth folder I getting the error messages in the command window.
Any idea from where the problem could be coming?

741186tileedit.png

any ideas?
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
tileedit doesn't currently work with compressed (.tree) texture archives. You have to unpack the archive with texpack -e (or Face's treeman utilities) before running tileedit.
 

jacquesmomo

Addon Developer
Addon Developer
Joined
Jun 14, 2008
Messages
611
Reaction score
449
Points
78
Location
FRANCE
Website
francophone.dansteph.com
tileedit doesn't currently work with compressed (.tree) texture archives. You have to unpack the archive with texpack -e (or Face's treeman utilities) before running tileedit.

Yes...

but the better way is to load the Complete high-resolution pack (6 files.7z )at this adress :
http://mirror.orbiter-radio.co.uk/orbiter/assets/earth.html

Then unzip ("un7zip"...) the 6 archives (in a separate folder is better) and verify you have the good architecture (path) :
Textures\earth\surf\01 etc (and 01\mask etc...)

then select with Tileedit the root folder (named "earth") and... that's it.

You MUST have all the tiles from folder (resolution) from 01 to 19.

Try this and tell me...
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
How do those hi res textures relate to the 'official' 2016 hi res ones from the main orbiter download page?

Yes...

but the better way is to load the Complete high-resolution pack (6 files.7z )at this adress :
http://mirror.orbiter-radio.co.uk/orbiter/assets/earth.html

Then unzip ("un7zip"...) the 6 archives (in a separate folder is better) and verify you have the good architecture (path) :
Textures\earth\surf\01 etc (and 01\mask etc...)

then select with Tileedit the root folder (named "earth") and... that's it.

You MUST have all the tiles from folder (resolution) from 01 to 19.

Try this and tell me...
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
They are probably not quite the same. In particular some of the high-res elevation data around KSC will be missing in the older beta textures. Also the release textures contain some areas with SRTM-30 elevation data (mostly North America) which are not present in the beta textures.

These are relatively minor differences, but it is still not a good idea to mix the release and beta textures. And if you have already downloaded the release textures, it seems silly to download them again just to get them in a different format. Note that unpacking the beta textures from the .7z archives will probably take a similar time to unpacking the release textures from the .tree archives.
 

jacquesmomo

Addon Developer
Addon Developer
Joined
Jun 14, 2008
Messages
611
Reaction score
449
Points
78
Location
FRANCE
Website
francophone.dansteph.com
These are relatively minor differences, but it is still not a good idea to mix the release and beta textures.

It's true. That's why I was saying : " in a separate folder is better".

It is just for model to make others tiles with these as Template.


 

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,813
Reaction score
640
Points
188
Must admit I'm struggling with the new "surface tile" system. I'd like to get into it, and modify some old bases I made, but completely stumped by the new system.

Any chance some one will do an idiots guide to it?

N.
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,390
Reaction score
577
Points
153
Location
Vienna
Must admit I'm struggling with the new "surface tile" system. I'd like to get into it, and modify some old bases I made, but completely stumped by the new system.

Any chance some one will do an idiots guide to it?

I would like to see that, too. While I understand it pretty well, I find it hard to explain it to others. I can express it technically, sure, but then some Italian folks already think I'm talking my own language, so that obviously doesn't help much :lol: .

---------- Post added at 11:33 ---------- Previous post was at 06:37 ----------

Perhaps it is best to start with the reasons why it is so hard to understand. From my point of view, base developers previously had the following situation:

  • There is some base you want to create, layout and deploy.
  • You know the coordinates, so you can convert it to Orbiter coordinates.
  • You know where what buildings should be, so you can place them there with the configuration file syntax.
  • The terrain was flat, so height data for buildings was optional.
  • Better textures for surroundings were done by placing one or more DDS tiles into Textures folders, named by a well-known coordinate-to-name scheme.
  • Gather meshes, textures and config files of the addon in question, ZIP it up, deploy it, done.
Now there is the following situation:

  • There is some base you want to create, layout and deploy.
  • You know the coordinates, so you can convert it to Orbiter coordinates. Question 1: what about that texture tree resolution and coordinate system? How and when do I need it?
  • You know where what buildings should be, so you can place them there with the configuration file syntax.
  • Yikes, there is terrain now! Question 2: how do I know where my buildings come out in terms of height?
  • Old texture placing doesn't work anymore! Question 3: how should I place my tiles now? Can I even use them again?
  • Gathering meshes, textures and config files of the addon did not change much, but what about those texture tree things? Question 4: how should I deploy my texture and/or terrain work?
I could give answers to this, but it would be a developer's answer, and not a tutor's one. No matter how hard I try, it seems.


It would be helpful if those struggling with the situation explain exactly what they do not understand, or at least formulate some questions.
 

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,813
Reaction score
640
Points
188
Thanks for all that Face.
Good points and questions, I for one will have a think and try and formulate some sensible
questions.

N,
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
So I spent a few hours yesterday playing around with the tileedit util, base config and had a gander at all the surface dds files...

Tileedit is pretty crude workflow wise, but fairly easy to actual edit the heightmaps with, at least to just flatten areas anyway. Although I did find there were a few quirks to the way the landscaped terraformed. Anyway I muddled through thoroughly ruining Ascension's natural beauty. ;)

But I think the surface tiles themselves are the hardest to understand so far. If I hadn't had marco's 2016 Ascension tiles to look at I would have been lost. Now I understand the principles of tree structures and subdividing squares and whathaveyou, and tileedit is a nice way to actually visualise how it works, but I have no idea how to actually create tiles from scratch. The different level files seemed to be a mix of 2048, 1024 and 512 resolution. I couldn't really make sense of why tiles were the size they were. In addition I don't know which ones I need to create, or at what resolutions, or what utils, if any, will do the calculation work for me from n number of original images. Also, why, when I edit the elevation files, does it only change the level 13 files for example. I feel poorly educated. :)

I have to use d3d9 client with 2016 and that has a few transparency issues with base meshes that have undershadows. That and the not truly flat flat terrain (unlike 2006/10) means using meshes as the floor is perhaps less preferable than editing the surface tiles themslelves now. So if I'm going to start altering surface tiles I'd like to know which ones and how to do this for the highest quality finish.

tl;dr I need a step-by-step idiot's guide for creating/editing surface tiles please
 
Last edited:

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,390
Reaction score
577
Points
153
Location
Vienna
Anyway I muddled through thoroughly ruining Ascension's natural beauty. ;)

Regarding base conversion, this is what you can already do with OT3 in about 5 minutes (no tileedit, just OT3 plus mspaint):
WIA2016.jpg


However, it will not help you understand the underlying system and how you can leverage the new features.
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
Cheers face, but that is not 2016 terrain is it? What are you actually showing me there, the 2010 Wideawake tiles and meshes remapped to 2016 on an area of zero elevation terrain?...

Regarding base conversion, this is what you can already do with OT3 in about 5 minutes (no tileedit, just OT3 plus mspaint):
WIA2016.jpg


However, it will not help you understand the underlying system and how you can leverage the new features.

p.s. I don't mind tools doing the work for me and hiding the complexity, as long as I understand what is fundamentally going on.
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
Ok, here are a few points:

The surface tiles contained in Surf.tree are all 512x512 pixels. I don't know where you spotted 2048 and 1024 sizes, but that should not be the case. (the only exception being the global level 1, 2, and 3 tiles, but we can ignore those for this discussion).

So if your Ascension base tiles are larger than 512x512, you need to cut them into 512x512 pieces. If they are smaller, you need to glue them together into 512x512 pieces (hopefully, they will already have power-of-2 size, otherwise it may get a bit messy).

Next, resolution. If you know the resolution of your Ascension tiles (pixel/degree), then it is easy to figure out at what resolution level they fit into the tile tree:

- level 4 (the base of the quadtree) has a resolution of 1024/360 pixel/degree.
- each subsequent level has twice the resolution of the previous level.

If you don't know the resolution of your tiles, it may be easiest to simply zoom into tileedit, until the view represents exactly the area of one of your 512x512 tile cuts (at a lower resolution, presumably). You can then read off the resolution, as well as the longitude and latitude indices, directly from the info box in the top left corner.

Inserting your tiles: This is actually quite easy. Assuming you found the appropriate tile location in tileedit corresponding to one of your 512x512 ascension tiles, you just have to convert the tile to DXT1 format if not already done, and then copy it to Textures\Earth\Surf\XX\YYYYYY\ZZZZZZ.dds where XX is the resolution level, YYYYYY is the latitude index, and ZZZZZZ is the longitude index you read off from the info box in tileedit. If you then navigate back to that tile in tileedit, it should show the new tile in all its high-res glory.

Once you have inserted the tiles at their highest available resolution, you should also add at least some of the lower resolution levels:

- glue an appropriate set of 2x2 tiles together to a single 1024x1024 tile, and interpolate it down to 512x512. All basic image processing tools (e.g. gimp) can do that.
- convert to DXT1, and insert again in the correct place in the tree directory structure.

You may have to repeat that for a couple of levels, but certainly not all the way down to level 1. Simply check that the jump from original texture to your texture is no longer very obvious, as you zoom across the transition.

You may have to adjust the water colour of your tiles to match seamlessly with the surrounding ocean (surface tiles don't support transparency, so you can't simply cut away the water areas).

Also, in addition to the surface tiles, you will have to edit the corresponding water mask tiles. I noticed that the water mask for Ascension island is really messed up.
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,390
Reaction score
577
Points
153
Location
Vienna
Cheers face, but that is not 2016 terrain is it? What are you actually showing me there, the 2010 Wideawake tiles and meshes remapped to 2016 on an area of zero elevation terrain?

Nope. It is just your old base as you've committed it to ORL. In order to show it there, it had to be remapped, integrated, alpha merged, masked and terrain flattened.
 

wehaveaproblem

One step closer
Addon Developer
Donator
Joined
May 18, 2008
Messages
913
Reaction score
0
Points
16
Location
London
Website
wehaveaproblem.wordpress.com
Great stuff martins, that helps a lot.

Ok, here are a few points:

I don't know where you spotted 2048 and 1024 sizes, but that should not be the case.
Look in marco's Ascension 2016 addon, their are 2048 in the level 14 folder and a 1024 in level 15 folder...?

Once you have inserted the tiles at their highest available resolution, you should also add at least some of the lower resolution levels:
...
You may have to repeat that for a couple of levels, but certainly not all the way down to level 1. Simply check that the jump from original texture to your texture is no longer very obvious, as you zoom across the transition.
So there is no hard and fast rule for how many resolutions you *need* to cover. Once you have set the highest it's just a matter of how smooth you want transitions to be?
That would be a very handy util, one that allows you to drop in your highest res with relevant long lat and let the util to do the combining and scaling process for you! too much to ask? :D :D

I noticed that the water mask for Ascension island is really messed up.
i noticed that too actually. Does that have any actual visual effect on the rendering, assuming, as is the the case with Ascesnsion, all the land is above see level?

Nope. It is just your old base as you've committed it to ORL. In order to show it there, it had to be remapped, integrated, alpha merged, masked and terrain flattened.
ah ok, so quite a lot has actually gone on there to get that pic. So is the only element missing the elevation data? For which I assume we would just use your hairy face!? :D :D
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
Look in marco's Ascension 2016 addon, their are 2048 in the level 14 folder and a 1024 in level 15 folder...?

That would be incorrect, since it messes up the LOD adjustment. The 1024x1024 level 15 tiles should be split into 512x512 tiles and added at level 16. After that, the level 14 and level 15 tiles should be interpolated down to 512x512.
 

jacquesmomo

Addon Developer
Addon Developer
Joined
Jun 14, 2008
Messages
611
Reaction score
449
Points
78
Location
FRANCE
Website
francophone.dansteph.com
I notice the same in "Ascension"... tiles 1024x1024 works...

That would be incorrect, (...) The 1024x1024 level 15 tiles should be split into 512x512 tiles (...).
I red this in your "tilemanuel" (planettexture.pdf) ... and I realize that in Ascension islands it seems to does not matter... Curious ???

Anyway, for my (future) tiles for kourou, all tiles are in 512x512 and mask etc...
i have understood how it works !!!

Kourou at night

968803kourou01.jpg
 
Last edited:
Top