Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addon Development
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addon Development Developers post news, updates, & discussions here about your projects in development.

Reply
 
Thread Tools
Old 10-03-2016, 06:39 AM   #46
fort
Orbinaut
Default

Hello,

I chose to experiment at level 16 which corresponds to 'tiles for bases' at level 4 (Earth_4 _...) containing here unicolor images (green 256x256 pixels) and by the fact with own material and standard values.

The Orbiter 2016 tiles (in Earth / surf), assumed at similar position on the map, are in red.

At level 16: 8192 tiles (4096 x 2) from east to west and 4096 (2048 x 2) from north to south.

North west: the VAB locally. tile 002260.dds / 1397 folder.
South east: Woomera locally. tile 007209.dds / 2756 folder.

Be carefull: as my explanations starts - inconveniently i know - from the 2016 tiles values, one have at the end to reverse the conclusion and adjust the red tiles on the green and not the opposite ( see annotations in bold ) for the demonstration but the conclusions are nevertheless valid i think.

In longitude, if i only consider to calculate the values of x and the number of tiles to the level (2 ^ 4 + 8), a base tile to cover the VAB could be set to:
4096 - 2260 (Nx) = 1836 (Earth_4_w1836 ...).Canaveral.cfg.
For w1836 the tile in longitude corresponds visually to the VAB 4096> (2 ^ m + 8) - 1836> (x) is correct ( pdf is correct ).



In longitude, the tile for Woomera could be set to:
7209 (Nx) - 4096 = 3113 (Earth_4_e3113 ...).Woomera.cfg.
For e3113 the tile in longitude corresponds visually to Woomera 4096> (2 ^ m + 8) + 3113> (x) is correct ( personal formula is correct ).



It's different in latitude yet the reasoning should be identical. Paper and pencil and research in the surftilecalculator bring answers.

In latitude the tile to cover the VAB could be set to:
2048 - 1397 (Ny) = 651 (Earth_4_e ...._ n0651)
For _n0651 the tile is located just above (north) the VAB. 2048 (2 ^ m + 7) - 651 (y) seems insufficient.


If i want that the red tile cover my green tile:

Ny> 2 ^ m + 7 -1 - 651 is right ( pdf is correct ).

That of Woomera could be set to:
2756 (Ny) - 2048 = 708 (Earth_4_e ...._ s0708)
For _s0708 the tile is still just above (north) from that of Woomera. 2048 (2 ^ m + 7) + 708 (y) seems insufficient.

If i want that the red tile cover my green tile:

i should also remove 1.
Ny> 2 ^ m + 7-1 + y is good ( personal formula is right ).

It will be interesting to see if i made errors or not. I can't test actually treeman.

Don't open the zip directly in orbiter 2016. It is not exactly made for that.
Attached Files
File Type: zip Convert_base_tiles.zip (272.3 KB, 13 views)

Last edited by fort; 11-10-2016 at 06:57 AM.
fort is offline   Reply With Quote
Old 10-03-2016, 08:37 AM   #47
Ripley
Tutorial translator
 
Ripley's Avatar
Default

Quote:
Originally Posted by fort View Post
 ...I can't test actually treeman...
Eh eh, oldish 32bit Operating System in use?
Ripley is offline   Reply With Quote
Old 10-03-2016, 08:50 AM   #48
fort
Orbinaut
Default

Quote:
Originally Posted by Ripley View Post
 Eh eh, oldish 32bit Operating System in use?
Eh non

Or plus or less.

By the fact - it's not exactly the same theme - but now that the D3D9 seems match orbiter 2016, i was looking for a XP 32 version. Did you see something about that ?

No, i wanted to understand and use tileedit ( and now treeman), and as tileedit is a 64 bits prog, i spend a part of my holidays to find a 64 bit version of win 7 and put it on another hdd, with the dual boot wich looks well. But my principal activity stays on my XP 32 and as many old mens ( and not only ), i have my habits ( Alzheimer ? )

But for the moment, switch to the second hard drive and learn and load treeman, when i'm on nightlights nights an days...

good day Ripley

( je suis une communauté en déclin )

Last edited by fort; 10-03-2016 at 08:53 AM.
fort is offline   Reply With Quote
Thanked by:
Old 10-03-2016, 11:01 AM   #49
jacquesmomo
Kourou CSG addon Developper
 
jacquesmomo's Avatar
Default

Quote:
Originally Posted by fort View Post
 
No, i wanted to understand and use tileedit
Now, I know how to use tileedit !!! I am happy !!!
jacquesmomo is offline   Reply With Quote
Old 10-03-2016, 11:46 AM   #50
Face
Beta Tester
 
Face's Avatar

Default

Progress: ele2png can now convert PNGs to ELV.

Round-trip is possible by means of PNG meta-data support. I simply serialized info into the "Comment" string and read it back again. If no meaningful data is in there, it simply assumes a 1x1 padded 16-bit elevation data with full 16-bit range. Conversion will then take a bit longer, as it needs to guess the off-colors into the OT3-colormap range.

This way you can even import non-OT3-colormapped images. I've imprinted my avatar into the vicinity of Ascension Island for the lulz:
=> \Textures\Earth\Elev\10\000034\000058.elv

Result is this rendering:


So with this you can convert a tile to PNG, edit it (e.g. flatten some area), then convert it back to ELV.
Face is offline   Reply With Quote
Old 10-04-2016, 02:52 AM   #51
igel
Addon Developer
 
igel's Avatar
Default

This is so-o spooky, jut in time for Halloween! :-)
igel is offline   Reply With Quote
Thanked by:
Old 10-04-2016, 05:16 AM   #52
Loru
Moderator
 
Loru's Avatar


Default

We had face on mars. Now we have Face's face on the ocean.
Loru is offline   Reply With Quote
Old 10-04-2016, 07:53 AM   #53
4throck
Enthusiast !
 
4throck's Avatar
Default

Looks like the Shroud of Turin

Good news on the PNG import.
In theory makes it possible to import data from grayscale images, converted to the right palette. I've see such data for some places on Titan for example...
4throck is offline   Reply With Quote
Old 10-04-2016, 08:36 AM   #54
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by 4throck View Post
 In theory makes it possible to import data from grayscale images, converted to the right palette. I've see such data for some places on Titan for example...
You don't need to convert it to OT3 colormap, because the guesser also takes grayscale mapping into account. Take any grayscale image, convert it to RGBA8 PNG, then use ele2png. It will take the 8-bit grayscale value and spread it from -32768 to 32767 linearly. You will lose precision that way, though.

With a round-trip, you can also re-scale the image: convert ELV to PNG, edit the comment string to change emin and emax, then convert it back again. GIMP can do that under Image->Image Properties->"Comment" tab.

I will certainly implement an option to use pure 16-bit grayscale PNGs, but since many editors don't support that format, I went with the common format (RGBA8) first. Fortunately, the 16-bit grayscale PNG export/import is more straightforward than the complicated color-mapping.
Face is offline   Reply With Quote
Old 10-05-2016, 06:18 PM   #55
fort
Orbinaut
Default

Hello,

In spite of the good report of Igel and Loru (?), conversions made by treeman ( 03-09-2016 20h40 ) in terms of coordinates vis à vis of Orbiter 2016 are false.
fort is offline   Reply With Quote
Old 10-05-2016, 07:07 PM   #56
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by fort View Post
 In spite of the good report of Igel and Loru (?), conversions made by treeman ( 03-09-2016 20h40 ) in terms of coordinates vis à vis of Orbiter 2016 are false.
Well, AFAIK Igel made a report for the version posted here: http://orbiter-forum.com/showthread....4&postcount=33

That post has a timestamp of 01-10-16, 20:56, not 03-09-2016 20h40. Seems like you've tested the wrong version.
Face is offline   Reply With Quote
Old 10-05-2016, 07:32 PM   #57
igel
Addon Developer
 
igel's Avatar
Default

Confirming: My last test (success) was done with version from post http://orbiter-forum.com/showthread....4&postcount=33. treeman.exe, size 215,552 bytes.
igel is offline   Reply With Quote
Thanked by:
Old 10-05-2016, 09:53 PM   #58
Face
Beta Tester
 
Face's Avatar

Default

Progress: ele2png can now create and round-trip 16-bit grayscale format by means of using option "-g" when generating the PNG.

In addition (and in contrast to previous versions), ele2png will now create (and populate) an alpha channel only if Elev-mod layer is used. The following formats are created/supported in the appropriate direction:
Code:
  ELV Mode   | -g| Output format
-------------+---+------------------------------------------------------------------------
    Elev -16 | - | 8-bit RGB no alpha colormapped with 16-bit HSV Hue/Value Blue to Cyan
    Elev -16 | X | 16-bit Grayscale no alpha
    Elev  8  | - | 8-bit RGB no alpha colormapped with 10-bit HSV Hue Blue to Cyan
    Elev  8  | X | 16-bit Grayscale no alpha
Elev_mod -16 | - | 8-bit RGB with alpha colormapped with 16-bit HSV Hue/Value Blue to Cyan
Elev_mod -16 | X | 16-bit Grayscale with alpha
Elev_mod  8  | - | 8-bit RGB with alpha colormapped with 10-bit HSV Hue Blue to Cyan
Elev_mod  8  | X | 16-bit Grayscale with alpha

Input mode | Alpha | Depth | Output ELV mode | Comment
-----------+-------+-------+-----------------+---------------------------------------------------------------------------------------
    Color  |  no   |   8   |     Elev -16    | Guessed on 16-bit colormap, roundtrip possible
    Color  |  no   |   16  |     Elev -16    | Color-intensity used as 16-bit value
    Color  |  no   |   8   |  Elev_mod -16   | Guessed on 16-bit colormap, maximum value is transparency
    Color  |  no   |   16  |  Elev_mod -16   | Color-intensity used as 16-bit value, maximum value is transparency
    Color  |  no   |   8   |      Elev 8     | Guessed on 10-bit colormap, roundtrip possible
    Color  |  no   |   16  |      Elev 8     | Color-intensity used as 16-bit value, precision is lost
    Color  |  no   |   8   |   Elev_mod 8    | Guessed on 10-bit colormap, maximum value is transparency
    Color  |  no   |   16  |   Elev_mod 8    | Color-intensity used as 16-bit value, maximum value is transparency, precision is lost
    Color  |  yes  |   8   |     Elev -16    | Guessed on 16-bit colormap, alpha info is lost
    Color  |  yes  |   16  |     Elev -16    | Color-intensity used as 16-bit value, alpha info is lost
    Color  |  yes  |   8   |  Elev_mod -16   | Guessed on 16-bit colormap, roundtrip possible
    Color  |  yes  |   16  |  Elev_mod -16   | Color-intensity used as 16-bit value
    Color  |  yes  |   8   |      Elev 8     | Guessed on 10-bit colormap, alpha info is lost
    Color  |  yes  |   16  |      Elev 8     | Color-intensity used as 16-bit value, alpha info and precision is lost
    Color  |  yes  |   8   |   Elev_mod 8    | Guessed on 10-bit colormap, roundtrip possible
    Color  |  yes  |   16  |   Elev_mod 8    | Color-intensity used as 16-bit value, precision is lost
 Grayscale |  no   |   8   |     Elev -16    | Scaled to 16-bit
 Grayscale |  no   |   16  |     Elev -16    | Roundtrip possible
 Grayscale |  no   |   8   |  Elev_mod -16   | Scaled to 16-bit, maximum value is transparency
 Grayscale |  no   |   16  |  Elev_mod -16   | Maximum value is transparency
 Grayscale |  no   |   8   |      Elev 8     | 
 Grayscale |  no   |   16  |      Elev 8     | Roundtrip possible, precision is lost
 Grayscale |  no   |   8   |   Elev_mod 8    | Maximum value is transparency
 Grayscale |  no   |   16  |   Elev_mod 8    | Maximum value is transparency, precision is lost
 Grayscale |  yes  |   8   |     Elev -16    | Scaled to 16-bit, alpha info is lost
 Grayscale |  yes  |   16  |     Elev -16    | Alpha info is lost
 Grayscale |  yes  |   8   |  Elev_mod -16   | Scaled to 16-bit
 Grayscale |  yes  |   16  |  Elev_mod -16   | Roundtrip possible
 Grayscale |  yes  |   8   |      Elev 8     | Alpha info is lost
 Grayscale |  yes  |   16  |      Elev 8     | Alpha info and precision is lost
 Grayscale |  yes  |   8   |   Elev_mod 8    | 
 Grayscale |  yes  |   16  |   Elev_mod 8    | Roundtrip possible, precision is lost
PNG with color palettes are not supported.
Face is offline   Reply With Quote
Thanked by:
Old 10-08-2016, 12:58 PM   #59
Face
Beta Tester
 
Face's Avatar

Default

Progress: OT3's ele2png now produces binary identical roundtrips, supports 4/2/1-bit PNGs, too, and prompts on file overwrites (just as treeman does).

In addition, I've added a range option in order to manually set the range the values should be in. This way, you can convert multiple tiles to the same range, so you can stitch them together in editors.

Example: I've wondered how the Elev_mod data actually overlays the Elev data in the KSC area. So I've convert the Elev and Elev_mod data of /16/001396/002259-002262 with the same range, stitched it together in GIMP, then laid Elev_mod over the Elev strip, then blended it in and out like so:


Here is also one of those 16-bit grayscale PNGs (central Europe with alps):


Updated conversion table:
Code:
  ELV Mode   | -g| Output format
-------------+---+------------------------------------------------------------------------
    Elev -16 | - | 8-bit RGB no alpha colormapped with 16-bit HSV Hue/Value Blue to Cyan
    Elev -16 | X | 16-bit Grayscale no alpha
    Elev  8  | - | 8-bit RGB no alpha colormapped with 10-bit HSV Hue Blue to Cyan
    Elev  8  | X | 16-bit Grayscale no alpha
Elev_mod -16 | - | 8-bit RGB with alpha colormapped with 16-bit HSV Hue/Value Blue to Cyan
Elev_mod -16 | X | 16-bit Grayscale with alpha
Elev_mod  8  | - | 8-bit RGB with alpha colormapped with 10-bit HSV Hue Blue to Cyan
Elev_mod  8  | X | 16-bit Grayscale with alpha

Input mode | Alpha | Depth | Output ELV mode | Comment
-----------+-------+-------+-----------------+---------------------------------------------------------------------------------------
    Color  |  no   |   8   |     Elev -16    | Guessed on 16-bit colormap, roundtrip possible
    Color  |  no   |   16  |     Elev -16    | Color-intensity used as 16-bit value
    Color  |  no   |   8   |  Elev_mod -16   | Guessed on 16-bit colormap, maximum value is transparency
    Color  |  no   |   16  |  Elev_mod -16   | Color-intensity used as 16-bit value, maximum value is transparency
    Color  |  no   |   8   |      Elev 8     | Guessed on 10-bit colormap, roundtrip possible
    Color  |  no   |   16  |      Elev 8     | Color-intensity used as 16-bit value, precision is lost
    Color  |  no   |   8   |   Elev_mod 8    | Guessed on 10-bit colormap, maximum value is transparency
    Color  |  no   |   16  |   Elev_mod 8    | Color-intensity used as 16-bit value, maximum value is transparency, precision is lost
    Color  |  yes  |   8   |     Elev -16    | Guessed on 16-bit colormap, alpha info is lost
    Color  |  yes  |   16  |     Elev -16    | Color-intensity used as 16-bit value, alpha info is lost
    Color  |  yes  |   8   |  Elev_mod -16   | Guessed on 16-bit colormap, roundtrip possible
    Color  |  yes  |   16  |  Elev_mod -16   | Color-intensity used as 16-bit value
    Color  |  yes  |   8   |      Elev 8     | Guessed on 10-bit colormap, alpha info is lost
    Color  |  yes  |   16  |      Elev 8     | Color-intensity used as 16-bit value, alpha info and precision is lost
    Color  |  yes  |   8   |   Elev_mod 8    | Guessed on 10-bit colormap, roundtrip possible
    Color  |  yes  |   16  |   Elev_mod 8    | Color-intensity used as 16-bit value, precision is lost
 Grayscale |  no   |   1   |     Elev -16    | Scaled to 16-bit
 Grayscale |  no   |   2   |     Elev -16    | Scaled to 16-bit
 Grayscale |  no   |   4   |     Elev -16    | Scaled to 16-bit
 Grayscale |  no   |   8   |     Elev -16    | Scaled to 16-bit
 Grayscale |  no   |   16  |     Elev -16    | Roundtrip possible
 Grayscale |  no   |   1   |  Elev_mod -16   | Scaled to 16-bit, maximum value is transparency
 Grayscale |  no   |   2   |  Elev_mod -16   | Scaled to 16-bit, maximum value is transparency
 Grayscale |  no   |   4   |  Elev_mod -16   | Scaled to 16-bit, maximum value is transparency
 Grayscale |  no   |   8   |  Elev_mod -16   | Scaled to 16-bit, maximum value is transparency
 Grayscale |  no   |   16  |  Elev_mod -16   | Maximum value is transparency
 Grayscale |  no   |   1   |      Elev 8     | Scaled to 8-bit
 Grayscale |  no   |   2   |      Elev 8     | Scaled to 8-bit
 Grayscale |  no   |   4   |      Elev 8     | Scaled to 8-bit
 Grayscale |  no   |   8   |      Elev 8     | 
 Grayscale |  no   |   16  |      Elev 8     | Roundtrip possible, precision is lost
 Grayscale |  no   |   1   |   Elev_mod 8    | Scaled to 8-bit, maximum value is transparency
 Grayscale |  no   |   2   |   Elev_mod 8    | Scaled to 8-bit, maximum value is transparency
 Grayscale |  no   |   4   |   Elev_mod 8    | Scaled to 8-bit, maximum value is transparency
 Grayscale |  no   |   8   |   Elev_mod 8    | Maximum value is transparency
 Grayscale |  no   |   16  |   Elev_mod 8    | Maximum value is transparency, precision is lost
 Grayscale |  yes  |   8   |     Elev -16    | Scaled to 16-bit, alpha info is lost
 Grayscale |  yes  |   16  |     Elev -16    | Alpha info is lost
 Grayscale |  yes  |   8   |  Elev_mod -16   | Scaled to 16-bit
 Grayscale |  yes  |   16  |  Elev_mod -16   | Roundtrip possible
 Grayscale |  yes  |   8   |      Elev 8     | Alpha info is lost
 Grayscale |  yes  |   16  |      Elev 8     | Alpha info and precision is lost
 Grayscale |  yes  |   8   |   Elev_mod 8    | 
 Grayscale |  yes  |   16  |   Elev_mod 8    | Roundtrip possible, precision is lost
Face is offline   Reply With Quote
Thanked by:
Old 10-23-2016, 06:43 PM   #60
NukeET
Gen 1:1
 
NukeET's Avatar

Default

Quote:
Originally Posted by fort View Post
Thanks for posting this fort.

I thought I was losing my mind when the documentation and treeman were giving two different latitude index results for the converted file, old surface tile to new.
NukeET is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Addons > Addon Development


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 08:17 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.