Sign in to follow this  
Cactus521

Custom Textures = Landclass 253 !!!!

Recommended Posts

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 . Cheers, Jean-Pierre

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

>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. Hi Jean-Pierre,Wow, sounds like your really on to somthing here, Are you say that there is a way to re-do a landclass area smaller than LOD5?I am sorry, I am new at trying landclass, here is an example inf file is this where I would put the "254" code? then I can specify a smaller area? I dont understand! :(Please help explane.Here's a example INF for a RAW 8-bit datafile of 256 X 256:{Destination}LOD = 5NorthLat = 47.8125SouthLat = 45.0000WestLong = 7.5000EastLong = 11.2500DestDir ="C:WINDOWSlcdtest"DestBaseFileName = "test"{Source}Type = ClassU8SourceDir = "C:WINDOWSlcdtest"SourceFile = "test.raw"Lat = 47.8125Lon = 7.5000NumOfCellsPerLine = 256NumOfLines = 256CellXdimensionDeg = 0.0146484CellYdimensionDeg = 0.0109863Thanks,Paul

Share this post


Link to post
Share on other sites

Hi Paul,Hey, your inf file is actually pointing to the east part of Switzerland.Dou you have a special interest in my home country ?Back to my investigations: You are absolutely right. To do a partial scenery with landclasses-Choose a LOD 5 quadrant, fill the corresponding raw data file with X'FE'. It takes 256X256 bytes- At the desired place, overwrite this filling with your own landclasses.- resample , tmf2bgl and fly!Remarks: each byte in the input file and therefore also in the tmf file seems to control 4 adjacent LOD 13 tiles. As you actually define one byte for each tile, it gives a large amount of ovelapping. the terrain engine use it do merge the different landclasses together and get a smoother transition.Here a screenshot of a dummy ( funny ) city created over the standard NW europe scenerey. You can also see that lakes are subject to a special processing and have priority over my own scenery, which is set at the top layer.have fun, Jean-Pierre

Share this post


Link to post
Share on other sites

Thanks for the quick response, :)>Hey, your inf file is actually pointing to the east part of >Switzerland. >Dou you have a special interest in my home country ? No, sorry. I just "ripped" this inf file from someone else as an example to use as I havent gone through the process yet do to having problems filling the huge LOD5 grid with landclass info.In the area of my work, the LOD5 grid overlaps US/Canada and I am having a hard time matching up the two different data sets, thats why I am so interested in your technique. :)>-Choose a LOD 5 quadrant, fill the corresponding raw data >file with X'FE'. It takes 256X256 bytes OK, sorry this I dont get: how do I fill the raw data with X'FE? I dont know what that means. :(>- At the desired place, overwrite this filling with your own >landclasses. Again, I am sorry. I have no clue, are you saying I can now pick out an arbitrairy spot at any LAT and LON? And how do I "overwright"?>- resample , tmf2bgl and fly! I'm going to go out on a limb, are you saying that I open up my Landclass.bmp with an HEX editor and change all of the values or somthing like that, and then re-open it in my paint program and perform the work in the desired area?Probably not even close eh?Thanks for putting up with my dumb questions. :)Paul

Share this post


Link to post
Share on other sites

Hi Paul,sorry,For my tests, i only used my favorite hex editor. My intention was not to create a landclass scenery but to understand how it works and use it to generate photoreal sceneries having a not rectangular shape.It could be usefull to implement these two new landclass codes in the "FSLandclass" utility. I have also posted my message in the Mesh Scenery Forum. May be the right place ...regards, Jean-Pierre

Share this post


Link to post
Share on other sites

Hi schampi.Yes! It works! Thanks for sharing that information. I noted the AGN files are still subject to the rules for LandClass local folder structures with 'texture' sub-folders.You need to copy all required AGN files to the local 'texture' sub-folder from '...scenedbworldtexture', or they won't show in the LOD5 area. Many thanks.:-beerchug

Share this post


Link to post
Share on other sites

Can you expand on this please? (please see my last post above)Is this allowing or an area of custom landclass that is smaller than the LOD5? How? I am sorry this probably my seem simple, bu alas, I am dense! :-lolThank youPaul

Share this post


Link to post
Share on other sites

Hi Paul.schampi has discover a very useful trick for landclass. Without even getting into the possibilities of of localized landclass files, this is great news.You need an 8-bit binary array 256 X 256 for a source. This must be processed as an LOD5 area. That binary file can be made by a paint program ( Paintshop Pro is good ), as long as the paint program allows saving the file a 'raw' or binary type, or you have access to a converter program.In a paint program, create a 256 X 256 picture, fill it with the #254 color, and save the file. With a little modification, Orlando Sotomayor's LOD5 calculator can be used to ID the exact cell number of the 256 X 256 grid. So... for example:Let's say you hate the looks of a particular city. In FS2002, slew to the city you want to change to get the coordinates, then calculate the LOD5 area and the exact cell#. Within a paint program, create a tranparent 256 X 256 image. Alter the single offending groundtile of the city in that image array, then save as a raw or binary file. Then resample, tmf and bgl. Put it in a scenery folder and activate. Changed city!

Share this post


Link to post
Share on other sites

Hi allTake a look in the Mesh Scenery Forum,I just have posted an explanation how to generate the control filefor custom textures.Cheers, Schampi

Share this post


Link to post
Share on other sites

That's a great tutorial for custom textures... My test will be a bit different. I suggest these steps for others who want to try:1) Create a raw 256x256 file populated with the "mask" value of 2542) Isolate the specific area to be changed, then edit the byte offsets associated with that area with the landclass specific byte values as outlined in the SDK and/or Orlando's documentation.A question was also proposed in the other forum regarding the use of 512x512 byte raw files. I'm going to give that a try as well.If this works, I'll be happy. I've always been content with the default landclasses, but I find some of the cities in Latin America are much smaller than their real life counterparts. I've always wanted to be able to modify them without having to rework every landclass assignment throughout an LOD 5 grid. Maybe this will work...john, KPHX

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