Sign in to follow this  
Guest

Texture File Naming

Recommended Posts

Hi,Can someone tell me how the name field for scenery texture files (*.bmp) is determined from the physical location of it - i.e. how it's derived from the coverage of that texture.I remember seeing it somewhere - but cant find it nowThanks

Share this post


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

Hi Kess.CUSTOM bitmap texture numbers describe the world LOD13 location as a QMID name.QMID ( or CLOD, as Christian Stock has explained ), is a way of quartering the flat map of the earth. FS mapping is equilangular, which means the earth needs to have squared latitude and longitude to use standard GIS data. That's our format... but the earth is not expressed as square, but as 180* Latitude by 360* Longitude. So to fit the earth to a QMID system, we need to place the earth into a smaller sub-set of the QMID. That's why LOD 0 is actually QMID 2.The following pictures show the earth map location in green on the QMID grid. You can see that the earth wholely fits into square QMID cells at QMID2 ( LOD 0 ).http://forums.avsim.com/user_files/6880.jpghttp://forums.avsim.com/user_files/6881.jpghttp://forums.avsim.com/user_files/6882.jpgThe first 3 numbers of the QMID correspond to the first 3 numbers of the CUSTOM bitmap name. From that point on, each numeral of the CUSTOM name describes a further nested QMID quad location.003100023031312su.bmpThe last number describes the quad position of the QMID14. This is the splitting of the LOD12 into quarters... which just happens to be LOD13. That is the coverage of a groundtile in FS.To derive the name involves a bit of code. My Delphi source code for LandCalc2 has about 1000 lines of pascal code devoted to converting Lat-Long to this name. The code isn't very elegant, but seems to work alright. Basically, the code just derives the QMID by testing the Lat-Long with ' If...Then ' statements to build the name. Pretty boring stuff.Raster data ( texture bitmaps, landclass, waterclass, mesh ) are given a standard of being expressed as a QMID sub-grid of 256 x 256. Vector data needs to be expressed as a runtime generated raster in the sim, so it also needs to be expressed as a sub-grid of 256. Why 256? 0-FF hex is 0-255 decimal ( inclusively 256 bits ). It's just a handy way for the CPU to manipulate data.So, LWM and VTP are located on an LOD13 sub-gridded at 256 x 256.Landclass, waterclass, CUSTOM are LOD5, sub-gridded at 256 x 256.With mesh, we can choose an LOD, but it's implementation in the sim will be sub-gridded at 256 x 256.Why have I recommended a raster grid of 257 x 257 for landclass creation? Because the 256 sub-grid is bounded by 257 x 257 verticies... and the sim actually assigns the landclass to the vertex, not to the runtime-generated groundtile. That's done to allow the runtime blending of textures.LWM and VTP are not assigned to verticies, but actually describe the tiny sub-grids as being a certain color as determined by the landclass or line texture. So their assignment is 256 x 256. Loading a landclass BGL into TMFViewer, then overloading LWM BGLs onto this landclass will clearly show landclass assignment to the vertices of LWM 256 x 256 sub-grids.Dick

Share this post


Link to post
Share on other sites

Thanks for the information...Any chance of getting hold of the 1000lines? I'd like to convert to C and use to find out where texture files are located.

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