Sign in to follow this  
rhumbaflappy

Photoreal Texture Naming

Recommended Posts

Hi all.Here's a rough explanation of the naming convention used for photoreal textures:First, I convert the string to a boolean True-False number set, then add up the degrees!003101031303212Sp.bmp====================================================== 0 0 3 1 0 1 0 3 1 3 0 3 2 1 2====================================================== x 1 0 1 1 1 1 0 1 0 1 0 0 1 0 North? ( Is it < 2 )13 + 0 * 0.01098632812512 + 1 * 0.0219726562511 + 0 * 0.043945312510 + 0 * 0.0878906259 + 1 * 0.175781258 + 0 * 0.35156257 + 1 * 0.7031256 + 0 * 1.406255 + 1 * 2.81254 + 1 * 5.6253 + 1 * 11.252 + 1 * 22.51 + 0 * 450 * ( + 1 )x + 0.010986328125 ( to find the North edge )------------------------------------------------------------------0 + 43.099365234375 degrees Latutude======================================================= 0 0 1 1 0 1 0 1 1 1 0 1 0 1 0 East? ( Is it Odd? )13 + 0 * 0.014648437512 + 1 * 0.02929687511 + 0 * 0.0585937510 + 1 * 0.11718759 + 0 * 0.2343758 + 1 * 0.468757 + 1 * 0.93756 + 1 * 1.8755 + 0 * 3.754 + 1 * 7.53 + 0 * 152 + 1 * 301 + 1 * 600 + 0 * 120x + 0 * 120-------------------------------------------------------------------180 + 100.927734375 = -79.07226565 degrees Longitude====================================================003101031303212Sp.bmp is Spring @ N43.08837890625* W79.07226565*LODCalc translates this to... N43* 5.9619' W79" 4.3358'

Share this post


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

Hi Dick,Sorry, you have completely lost me!What is a boolean true-false number set?Add up, What degrees?What is the significance of the two screenshots?Regards,Chris Wilkes

Share this post


Link to post
Share on other sites

Hi Chris.From the gigantic response this post got, I figured I lost everyone on the first turn!All CUSTOM textures are located by name, and the name describes the world location based on Microsoft's quadrant description, from the FS2000 Scenery SDK. This is the LOD system. A photoreal tile is an LOD13 tile. A quadrant has 4 parts:

-----------------|	   |		||   0   |   1	||	   |		|-----------------|	   |		||   2   |   3	||	   |		|-----------------

Boolean logic is pretty basic. You ask a question, and the answer is either true or false... represented by 1 or 0.So what I do first is decompose the name ( string ) in a boolean fashion by asking the question 'Is the number in the north part of the quadrant?' for each number in the name. 003101031303212Sp.bmp======================================================0 0 3 1 0 1 0 3 1 3 0 3 2 1 2======================================================x 1 0 1 1 1 1 0 1 0 1 0 0 1 0 North? ( Is it < 2 )If it's less than 2, than the answer is true... so starting at the rightmost number in the name ( 2 ) the boolean answer is false ( 0 )...The rightmost number is LOD13. So with a false answer to 'Is it less than 2?', we can't add 0.010986328125 to the Latitude, hence, '13 + 0 * 0.010986328125' ( position 13 = 0 ). Zero times anything is zero.The second number from the right is 1, and represents the position in the LOD12 quadrant. 'Is it < 2?' ... yes ( 1 is less than 2 ), so we will add an LOD12 span to the Latitude, hence, '12 + 1 * 0.02197265625' ( position 12 = 0.02197265625 degrees latitude ).What's throwing you is that I'm looking at it from right to left... LOD13 to LOD0.If any of the original numbers in the name is less than 2, it is in the northern part of the quad.Likewise, if any of the numbers is odd, it resides in the easternmost part of the quad, and from that, we can define the longitude. The quads start at W180* for longitude, so I added the resulting number of degrees to -180, to derive longitude.So that's how I changed '003101031303212Sp.bmp' to 'Spring @ N43.08837890625* W79.07226565*'The lower screenshot shows the crosshair at the computed location ( northwest corner of the LOD13 Area ). The bitmap pictured is 003101031303212Sp.bmp, as made by Resample. Yes, the screenshot is poor, but you should be able to see by the shape of the water, that the LOD13 in the topdown view matches the water's shape of the 003101031303212Sp.bmpSo the breakdown of the photoreal bitmap's name can give you the exact NW corner coordinates.By knowing where the texture goes, a programmer could devise a way to place the bitmap using a Landclass BGL ( with value #252 for seasonal CUSTOM texture ), or by using a TDF BGL ( VTP Method1 or Method2 ), or create accurate water/land by translating the watermask ( alpha ) to an LWM polygon.If I can decode the landclass structure ( or if Christian Stock tells me ), we can have a method to avoid Resample entirely, by using handmade landclass BGLs to place photoreal textures.The advantage to not resampling is better visual texture control, and the ability to place CUSTOM textures accurately anywhere in an LOD5 grid. Not just a block like resample does.. but scattered wherever we want, by using value #252 for photoreal tiles, and value #254 for transparent. I haven't yet found a landclass INF that can accurately place a single tile using resample. And, unless we merge the TMFs, we are trapped to placing lonely blocks of photoreal in a CUSTOM BGL. So I'm thinking resample should be avoided entirely, if we can do it!'schampi' had already worked this landclass approach out a few months ago, but I have not seen a description of how to convert the name to a location.Dick

Share this post


Link to post
Share on other sites

thanks for the explanation, I was so confused by what you wrote the first time, I didn't know where to start.Still not totally clear...if the rightmost number represents lod13, why are there 15 digits?B

Share this post


Link to post
Share on other sites

Hi Bob.You'd need 14 digits ( 0 thru 13 ), but the LOD0 longitude splits the world into 3 parts ( 120* each )... so the first world 'quad' isn't 4 parts, but 6! The explanation is in the SDK.So Microsoft just slapped an extra number onto the front of the name to handle the extra longitudinal part of LOD0.Maybe I can try some more programming, unless someone beats me to it ( hint, hint, hint ). It would be nice to have a little program to decode a photoreal name into coordinates, and into the LOD5 cell co-ords, ( and to derive the name from coordinates, as well ).Then, anyone that wants to experiment with using landclass for placing CUSTOM textures would have the info they need to write an INF... basically allowing you to have a landclass with custom textures... gee! That's photoreal, isn't it?Yup, same thing.:)Dick

Share this post


Link to post
Share on other sites

I succeeded at decoding the location of my "home" grid, which I had determined the location of using a simple (and darn near exact same logic) process of halving the interval of an LOD 1 quad and testing the quadrant for the point in question, as to whether it was n/s of the midpoint, or e/w of the midpoint.I just added the q column of n/s? and e/w?..recorded the answer, and replicated the code for the home grid...in fs that texture is known as 000333213112211Su.bmp.Here are the quadrants from my existing calculations, and the quad, based on nw=0, ne=1, sw=2, se=3LOD1 s e 32 s e 33 s e 34 s w 25 n e 16 s e 37 n e 18 n e 19 s w 210 s w 211 n e 112 n e 113 n e The missing digits are 000, in the beginning of the file. Are all textures starting with 000, probably to allow for a lod15 structure for other purposes.Thanks tons Dick, this was a complete mystery for me until today.

Share this post


Link to post
Share on other sites

Hi Bob.Some where you got out of sync with the numbers you posted...LODxtra w 0 needed because the world is initially split into 3 longitudinal parts 0 n w 0 1 n w 0 2 s e 33 s e 34 s e 35 s w 26 n e 17 s e 38 n e 19 n e 110 s w 211 s w 212 n e 113 n e 1... and you may need to add one LOD13 span ( 0.010986328125 ) to locate the NW corner, instead of the SW corner....The first number is the extra LOD0, second number is LOD0, the third number is LOD1, ......000333213112211Su.bmp

Share this post


Link to post
Share on other sites

yes, true, my lod13 number shows up on the lod12 line because its that line that does the division to show the lod12 halving lat/long...so its on that line that the decision is made for the next lod level.

Share this post


Link to post
Share on other sites

Hi pit.I've seen your spreadsheet, but I never had any luck deriving a texture number from it.What I'm hoping to develop, would be a program into which you could enter a Lat-Long coordinate pair, and get the landclass information, as well as the CUSTOM texture name, so we could write landclass BGLs to display CUSTOM textures. The advantage? One BGL could have many different areas of CUSTOM... not just a solid block as we have now, by use of the #254 transparent value to fill the 'holes'. And, with the correct name, we have no need of resampling... just process the textures on our own ( including slicing ). In fact, you could use the photos ( or maps ) as a template, use a copy of a default texture as a base, and add alterations ( water, roads, shores, parking lots, etc... ). Seasons would be developed pretty quickly with this method. And we don't need to worry how the final texture will look... we'll know.Dick

Share this post


Link to post
Share on other sites

I've written a spreadsheet that calculates the borders of the lod blocks that contain a given point. Because I used a halving routine and a logical test of the halving routine, I know how to convert this to spit out the quadrant code.I'll add that capability tonight and send you a copy if you wish. I just have to add a nested if statement that tests which lat/long quadrant and prints a given number based on the result. It already does this now, but instead of outputing the file name it chooses between the existing wall of the previous lod level and the midpoint for the new bounding wall of the next lod down.The input starting point for this spreadsheet is a coordinate pair point.I made this to provide inf information for custom photoreal, it dovetailed with my preference for a 2 point method of determining cellxdimension and cellydimension. Bob Bernstein

Share this post


Link to post
Share on other sites

so, now for any point, my spreadsheet can name the lod13 slice the point exists in. course it does lots of other calcs also, defining the lod13 boundarys in decimal degrees for that same slice, and calculating cellxdim and cellydim for 2 point method...and some other details, like distance from point one to the nw corner of the source photo.The equation was very simple: =IF($B$8>G8,IF($A$8>E8, 1, 0), IF($A$8>E8, 3, 2))in which b8 contains the latitude of your point in question, and a8 the longitude, g8 is a latitude eual to 1/2 the previous lod latitudes, and e8 is a longitude equal to 1/2 the previous lod longitude.Bob Bernstein

Share this post


Link to post
Share on other sites

Hi Bob. The spreadsheet idea sounds great. I'd love a copy.I think you can attach an xls file as a TXT attachment, in this forum.We'd only need to choose Save As, and rename the extension to .xlsDick

Share this post


Link to post
Share on other sites

hehe, started trying to send it before I check the forum...let me see if this works here..This spreadsheet will only work presently for northwestern quartersphere locations but the plumbing is nearly complete for it to work worldwide, just the column for interval halving right now assumes the given signs....I have to convert to absolute values, and then troubleshoot the impacts thru the rest of the wiring.for another dayBjust noticed something else, if anyone tries to use this for inf calcs, you'll find the cellydimension calc is fixed at the value you see there. That's cuz Bowerman is nearly e/w airport, so I wasn't confident in that value. I produced that number using a different spreadsheet from a n/s airport in the same latitude range.For general use change the cell H-5 on the first sheet to read:=calculations!B11/C22

Share this post


Link to post
Share on other sites

how to use "SDK Slice Number System" http://www.flightsimmers.net/airbase/peter.../slicecount.zip shows the principal spreadsheet. (for small areas)Let us take Dick's 003101031303212Sp.bmp 003101031303212003101031300000 Make last 4 numeral zero. So texture is inside spreadsheet003101031_________300000 Take out the last 6 numeral (or more)______I___A_____I___B_____1___I_300000__I____2___I_________I____ Insert the 300000 into field A / 1__3___I_________I_ And ReturnLook for field 303212 and set in front th '003101031'and 'Sp.bmp' behind.You have all the slices arround.pit

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