Jump to content
Sign in to follow this  
Guest christian

custom textures = landclass 253 !!!

Recommended Posts

Guest

Hi all,Comparing the TMF files generated by resample.exe with type = CUSTOM and Type=CLASSU8, i have realized that both have almost the same format. In "custom" TMF , only 2 codes are used for the data : X'FD' and X'FE'.An X'FD' ( decimal 253 ) is placed in the file where a custom tile is available, otherwise x'FE' ( decimal 254 ) is generated.It simplifies our life drastically. If you have already your phototextures well cropped, renamed, and converted, put simply a 253 at the right place in the input data file and resample it using type=ClassU8. It takes only a few seconds and that's it.!!Another interesting behaviour is with 254. It acts as a "don't care" flag. Putting it in the data file will force the terrain engine to display the default landclass from a lower layer. If you generates landclass files, you don't have to fill the whole LOD 5 quadrant with data. You can just use 254 as a filler and the terrain engine will do his job well. I used this method to generate a monster scenery for my country with abt. 30000 LOD 13 tiles. It covers 2 LOD5 quadrants and the generated BGL takes only 4kB after compression . regards, Jean-Pierre

Share this post


Link to post
Share on other sites
Guest

Schampi,That is good to know !! Thanks for the tip !!I have a question ??I have been playing around with the Classes a little lately, I understand how to compile it using type=classu8, but what in the world does a typical class data file look like in order to feed it all the information you would like. Just a little confused, since I could never really find any documentation on what goes in there ??Thanks again for the information !!Cheers Jackknife...........

Share this post


Link to post
Share on other sites
Guest

Hi Jackknife, I don't have many experience with landcover because my project is based on aerial orthophotos. I have some links on landcover and terrain model file documentation listed below. May be usefull for you.from Christian Stockhttp://ftp.avsim.com/library/esearch.php?D...hor=&CatID=Rootfrom Burkhard Renkhttp://www.fssharecenter.com/fslandclass/from Orlando Sotomayorhttp://mesh64.home.att.net/Cheers, Jean-Pierre

Share this post


Link to post
Share on other sites
Guest Claviateur

Very interesting but how do you place the 253 and where exactly? In the ini file? Can you give me an exemple please?ThanksMichel

Share this post


Link to post
Share on other sites
Guest

Hi MichelI suppose that your interest is in the custom texture placement with the landclass 253.First, the inf file is a "normal" one, like that: [Destination] LOD = 5 Destdir = DestBaseFileName = test UseSourceDimensions = 1[source] Type = ClassU8 SourceDir = SourceFile = test.dat Lat = 47.8125 Lon = 3.75 NumOfCellsPerLine = 256 NumOfLines = 256 CellXdimensionDeg = .0146484375 CellYdimensionDeg = .010986328125 SampleIsCentered = 1 The secret reside in the SourceFile. You must have your textures already prepared. Their names should be conform to fs2002 naming scheme, for example 011222313300102Su.bmp. In order to enable the displaying of a custom texture, we must put a 253 at the corresponding offset in the source data file. It is a hard job to compute this displacement.I have written a quick and ugly programm in Qbasic to do it.it generates an .dat , .inf and .bat fileyou just have to run the .bat file in order to get a valid bglAs input you need an ASCII list of your textures, one name per line,like that :011222313300333Su.bmp011222313300003Su.bmp011222313300010Su.bmp011222313300020Su.bmp011222313300030Su.bmp011222313300031Su.bmp011222313300032Su.bmp011222313300033Su.bmp011222313300101Su.bmp011222313300111Su.bmp011222313300112Su.bmp011222313300120Su.bmp011222313300121Su.bmp011222313300122Su.bmp011222313300123Su.bmp011222313300131Su.bmp011222313300202Su.bmp011222313300210Su.bmpthey don't have to be sorted.Here is problably the dirtiest programm of my poor existence, sorrydon't hesitate to contact me for additionnal info'sregards, Jean-Pierre

Share this post


Link to post
Share on other sites
Guest christian

I was on holiday for a week, thus the late reply.Let me congratulate you to this findig. This is great! 255 should be a very useful value even for people that only use landclass. This way you can avoid having to make LOD8 quadrants.Cheers, Christian

Share this post


Link to post
Share on other sites
Guest

Hithat's some great things you experienced.I'm a roughly newbie to teh landclass source code writing, so maybe you can tell me some details of how to make these custom things in Landclass.To be concret, I want to make an airport look like LAX or other default MS satellite pictures airport, that seemlessly fade into the surrounding. trhe dround textures have the same naming then the textures you mentioned.So maybe you can give a step-by-step insructions on how to make these custom texturs landclass files,t he pint that mostly interest me is how to exactly name the textures, and how to find the point where the custom textures are in the sourcecodeTHANKS A MILLION FOR YOUR HELPMario

Share this post


Link to post
Share on other sites
Guest

Hi Mario,well.. First you should have a good aerial picture of your area ( those taken from aircraft are the best but rare, alternative are satellite pictures available on the net ). To get the best results, it should have an original resolution of not more than 10m. The best resolution available in FS2002 terrain is abt. 4.8m.The second requirement is having exact coordinates of your picture ( for example Upper-left corner and Lower-right corner in longitude and latitude degrees. Now you should resize your pictures with any good graphical tool to get a pixelsize of abt. 4.8 m. I did it with Irfanview available for free at www.irfanview.comThe next step is to crop your picture into FS2002 LOD13 tiles. If your area is not too big, try Terrabuilder LITE from Misho Katulic with the option Phototerrain. The result will be a set of BMP's with the correct names, placed in the "texture" folder you defined and a .bgl file in the scenery folder.The names of the textures are derived from their position. A good explanation was available on this forum but now i am unable to find it again. Each digit represent a subquadrant from lod 0 to lod 13the subquadrants are recursively numbered0 12 3example : 000 001 010 011 002 003 012 013 020 021 030 031 022 023 032 033 and so forth ...Now your scenery should be well flyable you move it into fs2002 If you dont want all tiles beeing visible, you can exclude some of them by deleting them from the texture folder. The result will be a grey square instead... Not exactly what we want ...And now... take a file list of the remaining textures in your folderfor example with the dos command dir *.bmp /b >filelist.txtthis will be the input for my qbasic program posted as attachment sooner in this thread.The output of this programm is a set of files to resample with the terrain SDK tools. Using the landclass code 253, it generates a .BGL to place you textures at the right position.But.. There is still 2 bugs in my programm...1) the default folder won't be set in the generated .inf file You should manually complere the .inf file before resampling2) you may experience a grey border on the right and bottom of your scenery. It is due to the fact that each byte in the landclass .bgl controls exactly 4 adjacent tiles. as workaround, i propose you to restore the prevoiusly deleted textures. You will have too many textures in your folder but only those controlled by the .bgl file will display.have fun, cheers, schampi

Share this post


Link to post
Share on other sites
Guest

Thanks schampi!!That tutorial was great!! Waiting for your program!!Mario :-)

Share this post


Link to post
Share on other sites
Guest

Oops, no longer available in my older post !!here attached once again !Cheers, Schampi

Share this post


Link to post
Share on other sites
Guest

Do you mind if I create a Windows version of your QBASIC program using Delphi? It would of course be free for all to use.Leland Steffensen

Share this post


Link to post
Share on other sites
Guest

Hi Lee,Yes, do it ! I will be happy to use it for my own needs :-jumpy Cheers, Schampi

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...