Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter Beta
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Orbiter Beta Topics related to Beta releases of Orbiter and Orbiter development.

Reply
 
Thread Tools
Old 05-29-2019, 09:20 AM   #31
jacquesmomo
Kourou CSG addon Developper
 
jacquesmomo's Avatar
Default

Quote:
Originally Posted by 4throck View Post
 The center window should default to elevation. Otherwise, it CTDs on tile edit (if you put elevation on the left window).
I tried elevation on the left window: no ctd for me....

Quote:
Originally Posted by 4throck View Post
 How about an option to save / load a tile to PNG?
That seems like the most obvious feature to have
I agree with you :
it should be an excellent idea .... but is it possible ?

jacquesmomo is offline   Reply With Quote
Old 05-29-2019, 09:46 AM   #32
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by jacquesmomo View Post
 it should be an excellent idea .... but is it possible ?
It is possible to convert tile data to PNG and back again, as demonstrate before with ele2png.
Face is offline   Reply With Quote
Thanked by:
Old 05-29-2019, 10:20 AM   #33
martins
Orbiter Founder
Default

Quote:
Originally Posted by 4throck View Post
 The center window should default to elevation. Otherwise, it CTDs on tile edit (if you put elevation on the left window).
I'll look into that.
Quote:
How about an option to save / load a tile to PNG?
That seems like the most obvious feature to have
Quote:
Originally Posted by Face View Post
 It is possible to convert tile data to PNG and back again, as demonstrate before with ele2png.
Good idea - at least for the elevation data. I don't want to allow editing the surface layer, since it uses a lossy (DXT1) format, which means that every edit cycle potentially degrades the data. The surface layer should always be edited directly in the source data.

I think I remember that PNG supports 16-bit pixel values, correct? One potential problem I anticipate is the fact that the elevation tiles support a scale and offset parameter which I don't see how to preserve in PNG. What about TIFF instead? AFAIK that allows to store user-defined tags which I could use to encode those parameters. Also, we could then possibly store the tiles in GeoTIFF format, so they could be read directly into a GIS application.
martins is offline   Reply With Quote
Thanked by:
Old 05-29-2019, 11:25 AM   #34
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by martins View Post
 I think I remember that PNG supports 16-bit pixel values, correct? One potential problem I anticipate is the fact that the elevation tiles support a scale and offset parameter which I don't see how to preserve in PNG. What about TIFF instead? AFAIK that allows to store user-defined tags which I could use to encode those parameters. Also, we could then possibly store the tiles in GeoTIFF format, so they could be read directly into a GIS application.
PNG supports 16-bit pixel, but it is also possible to use a lossless LUT into the 8-bit RGB range.
PNG also supports meta-data strings that survive round-trips in certain editors (e.g. GIMP). For other editors, there is the option to write out a separate file with the meta-data. Worked just fine with e.g. Krita. This all is similar to the situation with TIFF regarding user-defined tags.
Face is offline   Reply With Quote
Old 05-29-2019, 10:14 PM   #35
4throck
Enthusiast !
 
4throck's Avatar
Default

Quote:
Originally Posted by martins View Post
 I don't want to allow editing the surface layer, since it uses a lossy (DXT1) format, which means that every edit cycle potentially degrades the data.
One use I see would be to completely replace the surface tiles, so no degradation.
For example, to have a 1980's shuttle pad at Vandenberg, created from original ground textures and edited terrain.

Last edited by 4throck; 05-29-2019 at 10:22 PM.
4throck is offline   Reply With Quote
Old 05-30-2019, 10:13 AM   #36
martins
Orbiter Founder
Default

Ok, I've started on the PNG export. Check out the 12-png_export branch if you want to follow progress. I'm exporting to 16-bit single-channel (greyscale) format, which seems to be read without problems by the latest Gimp.

I think for now I will implement the 2-file (PNG/meta) solution. It's a bit more cumbersome than embedding everything in a single file, but should make it easier to read the metadata, and hence interpret the info in the PNG, without the need of an additional tool to extract this info from the PNG. It might even make it possible to add metadata to an existing PNG file sourced elsewhere, to allow importing it into tileedit, thus replicating the functionality of plsplit64 for elevation data.

I also noticed that Gimp now supports floating point image formats. This could be a way to get around the problem of including the scale/offset information, by using the true elevation values directly in the image data. However the image formats supporting floating point data that I know of tend to be quite specialised, such as NIFTI or ANALYZE. They may not be very useful in this context, and I don't know if Gimp can read those anyway.
martins is offline   Reply With Quote
Thanked by:
Old 05-30-2019, 11:09 AM   #37
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by martins View Post
 I think for now I will implement the 2-file (PNG/meta) solution. It's a bit more cumbersome than embedding everything in a single file, but should make it easier to read the metadata, and hence interpret the info in the PNG, without the need of an additional tool to extract this info from the PNG. It might even make it possible to add metadata to an existing PNG file sourced elsewhere, to allow importing it into tileedit, thus replicating the functionality of plsplit64 for elevation data.
I'd like to suggest a format like so: https://www.orbiter-forum.com/showth...&postcount=208 . If we keep it compatible, people could use ele2png and the tileedit-export/import together. That said, I don't know if there are even users for ele2png anymore .
Face is offline   Reply With Quote
Thanked by:
Old 05-30-2019, 01:30 PM   #38
martins
Orbiter Founder
Default

Quote:
Originally Posted by Face View Post
 I'd like to suggest a format like so: https://www.orbiter-forum.com/showth...&postcount=208 . If we keep it compatible, people could use ele2png and the tileedit-export/import together. That said, I don't know if there are even users for ele2png anymore .
Does your format allow to be extended by additional tags (e.g. by adding more lines after the first)?
I might want to add more info, such as resolution level, latitude and longitude indices (or index ranges, if the PNG is a mosaic of multiple tiles), name of the PNG file, etc.
martins is offline   Reply With Quote
Thanked by:
Old 05-30-2019, 01:36 PM   #39
Nikogori
Donator
Default

Sorry for the noob question... but I don't understand how to use this.

This is what I did so far:

Open tileedit. Select specific region on the map.
Click Action button. Dialog shows up. Click yes.



Draw something on the map... I'm not sure what I'm supposed to do from here.



It seems .elv files have been created. But I couldn't find any differences in game.


Nikogori is offline   Reply With Quote
Old 05-30-2019, 02:07 PM   #40
martins
Orbiter Founder
Default

Quote:
Originally Posted by Nikogori View Post
 Sorry for the noob question... but I don't understand how to use this.

This is what I did so far:

Open tileedit. Select specific region on the map.
Click Action button. Dialog shows up. Click yes.

Draw something on the map... I'm not sure what I'm supposed to do from here.

It seems .elv files have been created. But I couldn't find any differences in game.
The elevation edits are written as soon as you navigate away from the edited tile. If you switch to a different tile after your edit, then switch back to the edited tile and the edits are still visible, they will have been written. I'll add some visual cue to indicate if a tile contains unsaved edits.

Edits are also propagated to ancestor tiles down to a given depth (currently hardcoded to 5 levels down from the edited tile resolution). However, I suspect that the propagation stops if an ancestor is missing in the chain (I haven't tested that yet). In your case, since you are creating a new tile at level 16, it is possible that the corresponding level-15 tile also doesn't exist, so the edit would be applied to level 16 only. You will only see it in orbiter when the LOD mechanism picks up that tile at exactly the correct resolution. Zooming in and out might trigger that.

Edits are currently not propagated to child tiles, since that could erase existing high-resolution content. I haven't quite figured out if and how to implement that (e.g. highpass-filtering the existing high-res tile, then adding the filtered high-frequency content to the low-frequency edit arriving from the ancestor tile).

Make sure that the tile load preference in Orbiter is set to "Try cache first, then compressed archive", since the edits are always written to the cache.
martins is offline   Reply With Quote
Thanked by:
Old 05-30-2019, 02:28 PM   #41
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by martins View Post
 Does your format allow to be extended by additional tags (e.g. by adding more lines after the first)?
I might want to add more info, such as resolution level, latitude and longitude indices (or index ranges, if the PNG is a mosaic of multiple tiles), name of the PNG file, etc.
In essence it is an arbitrary serialization of the elevation file header values. As such, I never took string values into account, so the name of the PNG file might be a problem. The idea is to have a space separated tag list in the "name=value" form, all in one line. The one-liner approach makes it more probable that editors that support PNG tags keep them alive during round-trips, like the "Comment" tag in GIMP. That same string is then simply written to a file.

"ele2png" only takes that first line into account, so the "format" (a huge term for it, really) is indeed extendable.

Small note on the min/max/mean values there: my goal was to make the ele2png round-trip consistent, so that the chain ele->png->ele will produce exact binary matches on unedited PNGs. To achieve this, I had to store the ELE min/max/mean values as presented in the original file ("smin" etc.), but also as calculated in the conversion algorithm ("emin" etc.), which did not always match in my tests. Therefore I also stored the calculated values alongside the original values, and if the re-calculation on import yields the same values as the stored calculated ones, I used the originals to create the imported ELE header.
Face is offline   Reply With Quote
Thanked by:
Old 05-31-2019, 11:45 AM   #42
Nikogori
Donator
Default

Quote:
Originally Posted by martins View Post
 The elevation edits are written as soon as you navigate away from the edited tile. If you switch to a different tile after your edit, then switch back to the edited tile and the edits are still visible, they will have been written. I'll add some visual cue to indicate if a tile contains unsaved edits.

Edits are also propagated to ancestor tiles down to a given depth (currently hardcoded to 5 levels down from the edited tile resolution). However, I suspect that the propagation stops if an ancestor is missing in the chain (I haven't tested that yet). In your case, since you are creating a new tile at level 16, it is possible that the corresponding level-15 tile also doesn't exist, so the edit would be applied to level 16 only. You will only see it in orbiter when the LOD mechanism picks up that tile at exactly the correct resolution. Zooming in and out might trigger that.

Edits are currently not propagated to child tiles, since that could erase existing high-resolution content. I haven't quite figured out if and how to implement that (e.g. highpass-filtering the existing high-res tile, then adding the filtered high-frequency content to the low-frequency edit arriving from the ancestor tile).

Make sure that the tile load preference in Orbiter is set to "Try cache first, then compressed archive", since the edits are always written to the cache.
Thank you. It is working now.




It seems elevation data will not be saved unless the resolution is exactly 13.
Nikogori is offline   Reply With Quote
Thanked by:
Old 05-31-2019, 01:50 PM   #43
4throck
Enthusiast !
 
4throck's Avatar
Default

One of the reasons I asked for PNG export and import is that it allows you to model terrain in Blender and then export as a height map.
Pictures are worth a thousand words:
https://blender.stackexchange.com/qu...tmap-from-mesh

Needless to say that the reverse is possible (import a heightmap and generate a terrain mesh in Blender).

Don't think that many users have access to GIF software.
So 16bit PNG is the best option I think. Just use 1 DN = 1 meter

Just my 2 cents
4throck is offline   Reply With Quote
Thanked by:
Old 05-31-2019, 03:17 PM   #44
martins
Orbiter Founder
Default

In addition to PNG, I am also thinking about adding an export option for FITS format. It's more versatile than png (also allows output to floating point images), and I think that Gimp may be able to read it (at least the image elements - FITS can also store other types of data). Plus it's quite popular in the astronomy community.

Does this sound like a good idea?
martins is offline   Reply With Quote
Thanked by:
Old 05-31-2019, 06:00 PM   #45
jacquesmomo
Kourou CSG addon Developper
 
jacquesmomo's Avatar
Default

Quote:
Originally Posted by Face View Post
 I'd like to suggest a format like so: That said, I don't know if there are even users for ele2png anymore .
I'm afraid you are right !!!
jacquesmomo is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Space Flight Simulator > Orbiter Beta


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 04:13 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.