Jump to content
Sign in to follow this  
Guest sgreenwood

Elevation BGL

Recommended Posts

Guest gorchi

Hi!Looking into Christian's tutorial I am trying to make some simple mesh in my coast and have problems. I have got charts from freely available atlas of Slovenia and using elevation lines I have made raw file of elevations (using PhotoShop). The highest hill has approx 250m so I made couple of layers: 0 with RGB 0 0 0 for sea, 2m with RGB 2 2 2, and so on for some more layers (60m, 100m, 120m, 200m, tops). Then I flattened these layers and made Indexed file. Then I saved this as RAW file and using this inf file

<Source>Type = ELEVS16LSBSourceDir = .SourceFile = "Elev.raw"Lat = 45.5491666667Lon = 13.5498333333NumOfCellsPerLine = 1913NumOfLines = 1519CellXdimensionDeg = 5.3521617887E-5CellYdimensionDeg = 3.6231884058E-5<Destination>DestDir = .DestBaseFileName = "Elev"NorthLat = 45.5491666667SouthLat = 45.4941666667WestLong = 13.5498333333EastLong = 13.6521666667LOD = Auto

old resample (using TMF compress and TMF2BGL) made a nice 93kB long BGL. But when I look at these coordinates in scenery, scenery is the same :-( Is there anything I have forgotten??P.S: Arno allready responded to me that Christian was talking about 16 bit divided to 2 layers. Ok, I have read that so that means I should have one RAW file for heights up to 256m, and another for higher elevations? Please help! Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

Hi Goran,I think the problem is that the DEM data needs to be 16 bit (as Christian explained in the tutorial, he talked about the two channels there). I think when you save it as RAW it will become 8 bit. So I guess that is the problem.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest gorchi

Hi Arno!Thanks for Your answer and I was afraid of that. But how can I then make this small mesh? I am not quite certain how to use "Photoshop technique" in making mesh...Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites
Guest christian

>Then I flattened these layers and made Indexed >file. Then I saved this as RAW file and using this inf file Just think about that step a bit more. Why do you flatten the image into one channel? My tutorial said you need 2 channels so your data is 16 bit. If you flatten it it'll be 8bits again! You have to save the 2 channels into the raw file.Christian

Share this post


Link to post
Share on other sites

See Christians answer :). And you name that your altitudes are below 255 meters, so I think with just an empty second channel it should work for you.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest gorchi

Hi Christian!I am aware that what I got was 8bit RAW file. But the problem is if I change from RGB mode to Indexed color, Photoshop automatically flattens layers and I can't have 2 layers. Maybe there is a solution to make 2 RAW files, one for ELEVS16MSB and the other for ELEVS16LSB. Now I am wondering, if I am interested in heights up to 256m, that means, that MSB RAW file should have those needed elevations, the LSB RAW is full of gray with RGB 1 1 1? Should I then make two INF files, then make 2 TMF's and then merge them together, compress and make BGL? Or there is another way?Best regards and thanks in advance!Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

I don't think it will work with two RAW images and merging the TMF file later on.When you have an RGB images (or more RG probably, because you only need two channel). And you say save as RAW does it want to flatten then automatically (can't remember that)? If that is the case I think it is hard to make an elevation BGL with the PhotoShop method.Don't know if you have another program. I would try to make the file with MatLab or an hex editor.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest gorchi

Hi Arno!Thank You for Your answer. Unfortunatelly it is true, that Photoshop automatically flattens layers :-( But if Christian says that Photoshop (or Paint Shop Pro, I don't mind) can be used this way, I would like to know. Getting elevation map from official institution for Slovenia is just too expensive (some hundreds of EUR, I think around 2000)...Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites

Same here in the Netherlands, it really expensive if you want to buy the stuff. We are talking with a company at the moment to get it for free. Sometimes that works, if you get them entousiastic for your project and explain you do it as freeware (non profit) etc. We have gotten some other data already in this way.But back to the question, are you sure flattening means it becomes index color (8 bit). When I have a RGB image with more then one layer I can also flatten it, but it stays RGB. So the layers are flattened, but not the channels. Maybe something similar happens when you want to save RAW? I'll test it tonight when I get home.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest gorchi

Hi Arno!Thanks for Your answer. It would be great if You can find "a recipe" to make mash :)Thanks and best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites
Guest christian

Hi Goran,Sorry, my mistake. I of course meant 'channels' not 'layers'. You'll have to work with 2 CHANNELS and then it works. Sorry for the confusion.Also, make sure that you cover a whole LOD quadrant, which means a lot of work using this method...Cheers, Christian

Share this post


Link to post
Share on other sites
Guest gorchi

Hi Christian!My apologizes, I overlooked through whole post that You talked about channels and I understood as layers. Sorry, my mistake. But I still haven't got my micro mesh in FS. Interestingly though, TMFViewer does show altitudes and values on correct place with correct elevations. I ask You or somebody else if You can look in PSD file found at http://slovenia.avsim.net/HIDDEN/elev.psd (122kb) what can be wrong. The most recent code for INF is here:

<Source>Type = ELEVS16LSBSourceDir = .SourceFile = "Elev.raw"Lat = 45.5491666667Lon = 13.5498333333NumOfCellsPerLine = 1913NumOfLines = 1519CellXdimensionDeg = 5.3521617887E-5CellYdimensionDeg = 3.6231884058E-5 <Destination>DestDir = .DestBaseFileName = "Elev"NorthLat = 45.5491666667SouthLat = 45.4941666667WestLong = 13.5498333333EastLong = 13.6521666667LOD = Auto

Thank You for help!Best regards,Goran BrumenFS Slovenija 2002 teamhttp://slovenia.avsim.net

Share this post


Link to post
Share on other sites
Guest

For my mesh I used Paint shop to make the grayscale raw file(picture).Then I used Grises50 to convert to DEM.And finally tmf2bgl to make the bgl.I used this bat file to automate the process:---grises50 Mesh10.raw mesh11gr.dem 8 0resample meshgr.inftmfcompress mesh11.tmf meshc11gr.tmftmf2bgl meshc11gr.tmf meshc10.bgldel mesh11gr.tmfdel meshc11gr.tmfpauseexit---And this inf file:---[Destination] LOD = 10 DestDir = "G:TestsceneryMesh_scenery" DestBaseFileName = "mesh11" UseSourceDimensions = 0 NorthLat = 62.40234375 SouthLat = 61.962890625 EastLong = 6.796875 WestLong = 5.859375[source] Type = ElevS16LSB SourceDir = "G:TestsceneryMesh_scenery" SourceFile = "mesh11gr.dem" CellType = S16LSB NullCellValue = -9999 SampleIsCentered=0 Lat = 62.40234375 Lon = 5.859375 NumOfCellsPerLine = 1340 NumOfLines = 1278 CellXdimensionDeg = 0.000699626865672 CellYdimensionDeg = 0.000343860035212 ScaleInMeters = 1.0---I also had some problems with finding the coordinates and the correct LOD-square.

Share this post


Link to post
Share on other sites
Guest christian

If TMFViewer shows your data then the bgl is fine...You must be doing something wrong when adding the bgl to FS2002. Are you sure it's loading in FS2002? Maybe your elevation changes are so small that they are hard to notice?Christian

Share this post


Link to post
Share on other sites

Bit late, but last evening I had a look at making a 16 bit RAW file in PhotoShop.When I start with a RGB image it has four channels listed, the R, G , B channels and the combined RGB channel. After I deleted the B channel the combined one also dissapeared and I had two channels left.When I exported them to RAW I got no message about flattening or so and the resulting file was 128 kB for a 256x256 RAW, so that seems correct :).Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...