Question Modification to ELE2PNG

paddy

Addon Developer
Addon Developer
Joined
Jul 14, 2012
Messages
80
Reaction score
0
Points
0
Let me first start by saying I am so grateful that people ( I really mean Mr. Face) with skill way way above mine having shared their efforts.
I am starting to use ELE2PNG to produce elevation PNG files which are then cut up to fit into the higher (more detailed) levels.
As many of you will know, (I say it here to allow other people to follow the train of thought) ELEPNG produces a 259 by 259 pixel tile. (not 256 by 256)

256 of it is the "Core" Data, Rows 2 to 257. The top row (258) is a copy of the bottom row (2) of the file above. Meanwhile my bottom row (1) is a copy of the top row (257) of the file below. Same idea for the sides {more on row zero later}

So I have a 256 core surrounded the first and last of its friends. This is done to make the join seamless. Just what the "devil row zero" does is beyond me, but it is not directly Core data.

At last we come to the issue. To make 4 higher level tiles I slice the 256 x 256 into four 128 by 128 tiles. Blow each them up to 256 and start to make the changes I need for landing pads and the like. A single level 12 has become 4 layer 13 tiles.

Wait a minute I do not have a 256 but a 259 to slice!!!
I could get "fireworks" to export row 2 to 129 and 129 to 257 and blow them up. So far so good
When I come to save the finished product I have the issue of adding a single strip from 4 other files to left, right, top, bottom AND putting that Zero row back.

Could there be a switch to ELE2PNG to give/take just the core 256.
Or does anyone else have a way of doing this.

I have looked at Imagemajik and while it seems to say it COULD do this I just could not get on with the documentation.
 

jangofett287

Heat shield 'tester'
Joined
Oct 14, 2010
Messages
1,150
Reaction score
13
Points
53
You seem a little confused.
Point indexes 0 and 258 are cloned from adjacent tiles.
Point indexes 1 and 257 are shared 'edge' points.
Point indexes 2 and 256 are cloned to adjacent tiles.
Point indexes 1 to 257 are displayed as the actual 'tile'.
However, I do agree with you. Dealing with the overlapping stuff is definitely something that needs to be automated. I can deal with "share edge pixels" with existing terrain tools, I can't deal with "share edge pixels but also 1 more pixel of overlap"
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,390
Reaction score
577
Points
153
Location
Vienna
My idea on that is to have another tool named stitchnslice that can take several tiles as input and spits out a big area picture, then take that picture together with some metadata and spit out the individual tiles again. This one could also provide the base for a treeman feature where elevation tiles get integrated in the tree upwards, and perhaps another one where new high-level tiles are generated from low-level tiles.
In addition, it could also prepare pictures to contain layers with
  • the surface texture,
  • the water mask,
  • the elevation height-map and
  • optional elevation mod tiles
all neatly lined up and brought to the same resolution, so you can comfortably edit the elevation and mods for a greater area, while still having the relation to the surface texture and water mask. Modern graphics editors can easily use layer transparency/locking to make that a nice experience.
I could imagine to also render ground base elements (distorted) into this collage, so you'd even see where your objects are, in order to flatten the terrain around it.
It would also open the possibility to create height-map pictures as input to pltex to create old-style *.tex maps that can be used by OBM.
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Face, that would work and at least for me it would be useful. :thumbup:
Trying to help by suggesting some features / priorities:

» Some map GUI would help, to select and preview the area to extract. At least a preview option once you input coordinates for the 4 corners would be nice.

» Exporting 2010 style tiles (that you can import into OBM) would also be nice. We would also need to export a surftile list (to add to 2010 style bases).

» Marking base objects on the exported images is kind of redundant if you implement the feature above. The user would be using OBM to render and edit base objects.
 
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
» Some map GUI would help, to select and preview the area to extract. At least a preview option once you input coordinates for the 4 corners would be nice.

I agree. That's what the proposed treevis tool could offer.

» Marking base objects on the exported images is kind of redundant if you implement the feature above. The user would be using OBM to render and edit base objects.

But OBM can't edit the underlying tile in the undistorted view (the actual base object editor). In extreme latitudes you will not know what pixel of the underlying height-map tile needs flattening, because even if you launch the editor from OBM, you get the distorted source image.

So the work-flow I imagine is like so:
  • user would use treeman + ele2png + stitchnslice to create a level 8 heightmap
  • user would use pltex to get an old-style *.tex from that
  • OBM uses this as background, making locating and editing base objects easier
  • once the base is there, you want to edit the heightmap, but of course in more detail
  • for that, you use treeman + ele2png + stitchnslice to create e.g. level 14 heightmap around the base coordinates
  • since stitchnslice also renders the distorted base objects into the image(s), you see in a graphics editor (on some different layer, perhaps) the objects and therefore the pixels you need to manipulate
  • after editing the big level 14 map, stitchnslice + ele2png produces elevation tiles again, and treeman could even integrate them upwards, if needed
  • launch Orbiter, check, repeat

Once the underlying tools are there and work as expected, the workflow can be put into some GUI-tool.
 

paddy

Addon Developer
Addon Developer
Joined
Jul 14, 2012
Messages
80
Reaction score
0
Points
0
WOW so much to think about
Sorry about my mis-understanding of the pixel points.

The "Bent" tiles have a known fixed size for any given Latitude. Some time back I had a spreadsheet which could take an X/Y position from OBM and work out the exact pixel in the fixed 515 by 512 tile.
Knowing my Runway starts at i.e. 137 by 408 and ends on -437 by 408 (in OBM) I would have little issue finding the relevant Pixels in the 256 by 256 PNG.
Even the placing a mesh which according to OBM sits at x57 y57 and is 245 square is easy mapped to the right pixels.

The PNG may look a bit wrong, it may look very wrong but OBM will sort it out.

I may be making this seem very very simple but is it not just a case of streching row 1 by X per cent row 2 by Y per cent......... row 256 by Z percent.
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,390
Reaction score
577
Points
153
Location
Vienna
The PNG may look a bit wrong, it may look very wrong but OBM will sort it out.

So what exactly is OBM sorting out there? If I understand you right, you have to manually map points of objects on the undistorted view of OBM to the distorted source PNG, right? Is this comfortable?

I thought that a monochrome rendering of the top view of the base objects to the distorted view of the source PNG will help in quickly locating the pixels that need flattening. If OBM makes that easy somehow, I can gladly skip that. From my tests with OBM, I don't see how that should work, though.

---------- Post added at 15:53 ---------- Previous post was at 15:47 ----------

I may be making this seem very very simple but is it not just a case of streching row 1 by X per cent row 2 by Y per cent......... row 256 by Z percent.

No problem, I know how to do the proper projection calculations.

---------- Post added at 16:47 ---------- Previous post was at 15:53 ----------

EDIT: Interesting. It seems like OBM is unable to create pole bases. :hmm: Every time I try to create one, it tells me that it is to close to the "edge".
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
"stitchnslice also renders the distorted base objects into the image(s)"

Preferably, have it output just an image(s) with the base objects footprints + alpha transparency.

On a photo editor the user can then paint them with the right levels (altitude). After than he can paste the footprint image over the elevation one, getting instant flattening.


(You are right about OBM and distortion. Better do it all using the same tool and re-projection system.)
 
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
Preferably, have it output just an image(s) with the base objects footprints + alpha transparency.

Indeed that's the idea, in a sense implementing the previously stated idea of "pencil drawing".
 

4throck

Enthusiast !
Joined
Jun 19, 2008
Messages
3,502
Reaction score
1,008
Points
153
Location
Lisbon
Website
orbiterspaceport.blogspot.com
Add to feature list: an option to extend base object footprints beyond their actual size.
Sure, it can be done in image editing software, but better have it from the start.

That would almost automate base flattening procedures, and reduce the need for hand-painting.
 

paddy

Addon Developer
Addon Developer
Joined
Jul 14, 2012
Messages
80
Reaction score
0
Points
0
Prove of concept, and hope to other budding designers, used a PNG converted to an ELV file in the elev_mod directory. I do now have flat roads by the way.

picture.php
[/IMG]
 

NukeET

Gen 1:1
Addon Developer
Donator
Joined
Oct 16, 2007
Messages
1,035
Reaction score
93
Points
63
Location
UT_SLC
Website
sites.google.com
Prove of concept, and hope to other budding designers, used a PNG converted to an ELV file in the elev_mod directory. I do now have flat roads by the way.

Just curious. What are the coordinates of the proof of concept base in the image? Maybe a "before" shot too?
 

paddy

Addon Developer
Addon Developer
Joined
Jul 14, 2012
Messages
80
Reaction score
0
Points
0
-4.965° Lon, 1.9116° Lat

It was quite flat to start with which is why I used it be fore I found out about ELE2PNG.
I put it up as much to show other folk that they can alter an area and so could make a base or two.
 
Top