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 09-14-2016, 12:33 PM   #16
fort
Orbinaut
Default

Quote:
Originally Posted by Face View Post
 ... and for each of them it integrates the tile into low-level tiles taken from the *.tree archive, and saves them in the file system cache, not the surf.tree file.
I'm not sure that i understand if for example my initial level 16 finished as a low level or not, but i'll try to experiment by myself; i don't want to help you each minutes for things that i could maybe solve by myself. But thank you again for your help.

Quote:
Interesting. If Orbiter2010P1 supported this non-zero-filled format, treeman should of course support it, too. Did you try that naming scheme in 2010P1?
By the fact, i don't know. I made quickly, from an airport ( Mojave ), a cfg for my tile and give it the right coordinates for Orlando. But the abscence of the 0 in the north range for the dds is an error from me . Maybe coming from the fact that in the cfg file there was no 0 ( 629 and not 0629 ). I've not made bases since a long time and all that notations are not actually in my head.

This does n't mean that orbiter 2010 cant work with short notations ( 629 for 0629 ) but i don't remember to have seen that in the past. I'll try .
[/QUOTE]


Quote:
Error 193 is this:
However, according to the PE header texconv.exe is a 32-Bit tool. Perhaps there is some path issue, try to explicitly set the texconv path by means of adding the configuration "--texconv <path/to/texconv.exe>" to your calls.
I'll try, but. My system is 32 bit, if nevertheless, i've another system 64 bits on another drive.

"Texconv is not a win 32"...appear in a window when i click on it. Exactly as tileedit.exe.

Looking on internet to see if it was possible to download a texconv.exe 32 bits there was a page offering two versions for the exe: a 32 bits and a 64 bits. Simultaneously in my memory was an addon made by Tofitouf, Zorglub moon, with an util folder with texconv.exe.

If i click on it it open and close immediately. If i start from a cmd windows it open with it's menu.

I've no conclusions for the moment about that. I must made some experiment. But the fact is that they react differently.

I'll give you all my informations about all that points later.

And again, thank you.

---------- Post added at 12:33 PM ---------- Previous post was at 12:24 PM ----------

Quote:
If you have level 16, treeman can integrate them back to 15,14,13,etc. for you with the -i option.
This answer close one of my questions about low-levels. But i'm curious to see how this works. I turn and turn this im my mind and i don't see how this can be made so simply ( apparently so simply ).

good day.

Last edited by fort; 09-14-2016 at 12:27 PM.
fort is offline   Reply With Quote
Old 09-14-2016, 12:54 PM   #17
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by fort View Post
 By the fact, i don't know. I made quickly, from an airport ( Mojave ), a cfg for my tile and give it the right coordinates for Orlando. But the abscence of the 0 in the north range for the dds is an error from me . Maybe coming from the fact that in the cfg file there was no 0 ( 629 and not 0629 ). I've not made bases since a long time and all that notations are not actually in my head.

This does n't mean that orbiter 2010 cant work with short notations ( 629 for 0629 ) but i don't remember to have seen that in the past. I'll try .
My question was because in Orbiter's documentation, the following is noted: emphasis mine
Quote:
Originally Posted by /Doc/OrbiterConfig.pdf, p. 14
 <Surface tile list>

An optional list of high-resolution surface tiles covering the base area. Each tile is represented by a line in the list, with the format
<res> <lng-idx> <lat-idx> <flag>
where <res> is the tile resolution (integer >= 1), and <lng-idx> and <lat-idx> are the position indices. The position indices define the location of the tile on the global planet map at the given resolution. <flag> is a bitflag (bit 0 = 1: render tile; bit 1 = 1: tile contains transparency in the alpha channel).

For each tile entry, a corresponding texture file in DDS format (DXT1 or DXT5) must exist in the Textures subdirectory, with naming convention
<planet>_<res>_[W|E]<lng-idx>_[N|S]<lat-idx>.dds
where <planet> is the planet name, <res> is the tile resolution as defined in the list, and <lng-idx> and <lat-idx> are the position indices as defined in the list (zero-padded to 4 digits).
Quote:
Originally Posted by fort View Post
 I'll give you all my informations about all that points later.
I guess I'll just go ahead and compile my own version of texconv . The project is MIT licensed, and the SDKs are available.

Quote:
Originally Posted by fort View Post
 And again, thank you.
Valuable input is always welcome. Thanks for trying out treeman!

---------- Post added at 14:54 ---------- Previous post was at 14:44 ----------

Quote:
Originally Posted by fort View Post
 This answer close one of my questions about low-levels. But i'm curious to see how this works. I turn and turn this im my mind and i don't see how this can be made so simply ( apparently so simply ).
treeman takes each tile of the input list. For them, it plots the path in the tree towards root. For each level in this root, it creates a tile in the file system cache (either from the tree archive, or it uses what's already there). Then it converts the tiles there to PNG and loads the PNG. It also resizes the input tile (which should be integrated) to the target resolution by means of shrinking it and converts it to PNG.
E.g. if the current step is to integrate a level 16 tile into a level 14 tile, it shrinks it from 512x512 to 128x128 with cubic interpolation.
Then treeman places this small PNG image over the appropriate pixels in the target PNG. At last the PNG is converted back to DDS.

No magic there. You can get a rather detailed work report by using the "-vv" option with the "-i" action.
Face is offline   Reply With Quote
Thanked by:
Old 09-14-2016, 01:11 PM   #18
fort
Orbinaut
Default

Quote:
Originally Posted by Face View Post
 Then treeman places this small PNG image over the appropriate pixels in the target PNG. At last the PNG is converted back to DDS.
It's a copy past on the existing level 14 tile - in your example - and on a quarter or the quarter of a quarter - starting from the level 16 - of the level 14 and at the right place, if i undertstand. Well it's as i imaginate it but i didn't think that the procedure was that one in treeman. But what else ? There is not other possibility i think.

For the moment, i 've no time to switch to my 64 bit OS, and experiment, plus the texconv.exe 32 bits i think, from zorglub moon addon, that seems to work alone don't work with treeman.

A command line tool calling another command line tool ?

There:
Attached Files
File Type: zip texconv.zip (41.8 KB, 3 views)

Last edited by fort; 09-14-2016 at 01:16 PM.
fort is offline   Reply With Quote
Old 09-14-2016, 01:40 PM   #19
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by fort View Post
 For the moment, i 've no time to switch to my 64 bit OS, and experiment, plus the texconv.exe 32 bits i think, from zorglub moon addon, that seems to work alone don't work with treeman.
There are various versions of texconv.exe around. treeman uses syntax/options of the Microsoft open-source project one .

Quote:
Originally Posted by fort View Post
 A command line tool calling another command line tool ?
Yes. That's what I meant in the first post with "similar to the Unix mindset". Reading/writing/converting various DDS formats is not an easy job, so why should I use a huge library or a self-made algorithm, when the work has already been done in a tool that does that job perfectly fine?
Face is offline   Reply With Quote
Old 09-14-2016, 01:51 PM   #20
fort
Orbinaut
Default

If one day you can made treeman to work with a texconv 32 bits...or find a texconv 32 bits working with treeman....

I ve installed recently a 64 bits os for tileedit. So i will experiment later with treeman.
fort is offline   Reply With Quote
Old 09-14-2016, 01:57 PM   #21
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by fort View Post
 If one day you can made treeman to work with a texconv 32 bits...or find a texconv 32 bits working with treeman....
I'm currently trying to compile the sources for XP. It seems like texconv.exe really IS 32-bit, but doesn't run on XP. I think there is a DirectX problem, not an architecture problem.
Face is offline   Reply With Quote
Old 09-14-2016, 02:04 PM   #22
fort
Orbinaut
Default

Not only i am in 32-bit but in addition I use XP. Decidedly I accumulate a lot of troubles and maybe even all vices .
fort is offline   Reply With Quote
Old 09-14-2016, 02:30 PM   #23
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by fort View Post
 Not only i am in 32-bit but in addition I use XP. Decidedly I accumulate a lot of troubles and maybe even all vices .
No worries. I've found a working version for both 64- and 32-bit XP. I'll check if treeman is compatible with that and put it up as alternative downloads.
Face is offline   Reply With Quote
Thanked by:
Old 09-14-2016, 04:20 PM   #24
fort
Orbinaut
Default

I'll try to see this evening with the 64 bits.

In the meantime, the representation i had to realize that sort of work manually, and maybe what OT3 do. I don't want to say: exactly, but something on that model if i understand your explanations, well. This on three level. For more i have'n't take the time to conceptualize it ( Does that could contest that first approach ? I dont think so but... ).


This schema is, yes, very ugly and so vertical

Quote:
Originally Posted by Face View Post
 To make it complete, also add a blue arrow line from level 16 to the green level 14 tile...
Done

Last edited by fort; 09-15-2016 at 06:59 AM.
fort is offline   Reply With Quote
Old 09-14-2016, 05:02 PM   #25
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by fort View Post
 This schema is, yes, very ugly and so vertical
Looks good. One thing is missing, though. To make it complete, also add a blue arrow line from level 16 to the green level 14 tile, as this is what happens in treeman. It does not take the resulting level 15 and integrates it back into 14, but just 16 into 15, then 16 into 14, and so on. This is to minimize cascading shrink artifacts.
Face is offline   Reply With Quote
Thanked by:
Old 09-29-2016, 02:10 AM   #26
igel
Addon Developer
 
igel's Avatar
Default

Hi Face!

Thanks for a great tool, and looking forward for more to come :-)

I just tried treeman on the same Baikonur's tiles that I converted before with my Powershell script and ImageMagic. A small heads-up for you: I found a problem with Marin's formula for Longitude conversion for Eastern Hemisphere, and in my test verified that you use the same formula, Ex → 2^(m+8) + 1 + x. Here, +1 is wrong, not needed, as resulting tiles get shifted right by 1 tile.

In my script, until I fixed the formula, they were shifted by 2 - I did not downsample the 1024x1024 tile to a single 512x512 tile, but rather split it into 4 tiles of lower level, so lat-lon indexes had to be multiplied by two and then adjusted for four three new adjacent tiles out of four.
igel is offline   Reply With Quote
Old 09-29-2016, 04:49 AM   #27
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by igel View Post
 I just tried treeman on the same Baikonur's tiles that I converted before with my Powershell script and ImageMagic. A small heads-up for you: I found a problem with Marin's formula for Longitude conversion for Eastern Hemisphere, and in my test verified that you use the same formula, Ex → 2^(m+8) + 1 + x. Here, +1 is wrong, not needed, as resulting tiles get shifted right by 1 tile.

In my script, until I fixed the formula, they were shifted by 2 - I did not downsample the 1024x1024 tile to a single 512x512 tile, but rather split it into 4 tiles of lower level, so lat-lon indexes had to be multiplied by two and then adjusted for four three new adjacent tiles out of four.
Well, that's strange. I (thought I) knew that already from experiments with Loru's CSSC, and also removed the +1 in the code. If you now say that it is still off by one, I've either uploaded the wrong version here, or one of the coordinates is wrong. Would be interesting to hear what Martin has to say about your bug report.
Face is offline   Reply With Quote
Old 09-29-2016, 05:09 AM   #28
igel
Addon Developer
 
igel's Avatar
Default

I downloaded the version posted in the very first post of this thread. Hm-m... If it is the right version... maybe it should be -1 instead of +1? :-) i.e. shift by two, not one?

My formula in Powershell (corrected after a few experiments) was
$newLon = ([math]::pow(2,$oldLevel+8) + 1 + $oldLon) * 2 - 2
igel is offline   Reply With Quote
Old 09-29-2016, 07:32 AM   #29
fort
Orbinaut
Default

error

Last edited by fort; 11-12-2016 at 08:41 AM.
fort is offline   Reply With Quote
Old 09-30-2016, 09:35 PM   #30
Face
Beta Tester
 
Face's Avatar

Default

Little progress: I've worked on the elevation part and made a first cut of the ele2png converter: http://snoopie.at/face/pics/ele2png.exe

It has a similar interface to treeman, meaning that it takes the texture root as first argument, followed by the layer name (of course only Elev and Elev_mod is supported here), followed by additional options and arguments. One of these last arguments should be the name of the tile to be converted, e.g.:
Code:
ele2png ..\Textures\Earth Elev /08/000003/000016.elv -vv
If the tile is present in the cache (i.e. already extracted from the tree archive), this example will spit out a PNG on the same path with the same name, but extension *.png . As of now it is a pseudocolored R8G8B8A8 PNG of the elevation data.

The appropriate Surf tile shows this:


The corresponding Elev tile is this:


With GIMP, you can merge those together to get a neat overlay like so:


Next step is the round-trip, so edited PNG can be converted back to elevation data again.
Face is offline   Reply With Quote
Thanked by:
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 04:46 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.