Sign in to follow this  
rhumbaflappy

The resample method ??

Recommended Posts

I recenty posed a question on how I should apply ground texture bitmaps I have made and understand that the resampling method may be the best way to go about editing and applying the new textures. I have read the replies and followed through as best I can reading the terrain SDK, downloading all the utilities and reading their docs but I am still a little confused as what FIRST !!I guess I need to find the specific textures bmp's used by FS to display the grass and surrounding area around my project airport. What utility does this ? I'm guessing it just gives bitmap names ?I have all the programs and utilities but it would be very helpful to know which order to use them ? Another words, us this first to do this, then this to do this, etc.. Then I'll read there docs to use them. I know what to do to edit those textures but I'm a little lost as to how to get them and how to put the new ones back. :-)Assuming this is all correct ? :-)I know many around this forum have spent countless hours figuring this all out and I ask please if you can help me get over this hump I would be very thankful. I have got off to a good start gmaxing but gee some of this stuff can slow you down. :-lolSteveCYYZ

Share this post


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

Alright Steve...ready?Here is the method I used/am using for my scenery.1. Get USA PhotoMaps and learn how to use it. It is very easy and doesn't take a lot of effort. This will allow you to dowload the satellite (terraserver) images of your airport area. The key to this is that you have to get a good portion of the area, because when you resample, you have to have at least one complete LOD13 quadrant with imagery in it (I think this is right...you'll see later).2. Once you get your area downloaded, assemble a complete picture of what you are going to resample. I ended up with 4 large 8m/pixel pictures from USA PhotoMaps and just merged them in PhotoShop.3. Now you have a large .bmp that you are going to resample using the resample.exe from the Terrain SDK. Resample.exe requires an inf file which is documented in the SDK. There is a program out there called FSTerrain Caculator. GET IT. It needs a reference point from your big picture (in Paint or PhotoShop move the cursor over a point you can find in FS2k2 easily - like the corner of a runway and record the x and y values). Now get the Lat Long of the corresponding point in FS. Plug these values into the Terrain Calculator using the scale of 8m/pixel and it will give you an inf file. I don't use the automated batch file that comes with the Calculator - I do stuff manually after this. The calculator will set up a folder and files will be placed in here - just look for them.4. From a command prompt type: resample your_file.inf. This will produce a tmf file and a bunch of bmps. The bmps are the 256 x 256 texture slices of the area. 5. From a command prompt type: tmf2bgl your_file.tmf your_file.bglThis will produce the bgl file you need. By the way, I am not mentioning folder placement or where tmf2bgl is found and all of that because I assume you know that.6. Get the Convdxt program from MW Graphics web site - I think it is in the beta area. Run it and convert all the bmp slices to DXT1. Make a new scenery (MyScenery) folder structure in your choice of places. Add the bgl to the scenery folder. Add the converted textures to the texture folder. Add this like any other scenery in FS2k2.If nothing shows up, you might not have produced a large enough area. Like I said, I am using 4 big pictures and am covering a large chunk of land. My airport (which is pretty big) is about one fifth the size of the total area. 7. Once you get this to work, now you are free to alter the images any way you see fit. Just change the un-converted (193k) slices using PhotoShop or whatever and the convert them again and put in your MyScenery texture folder. You can see your progress as you SLOWLY color each file and start FS againand again and again and again and again,etc, etc.I am pretty happy with the results I am getting. I use default textures in some places and just paint in others. My PhotoShop skills are limited, but I can get some decent results. That is another how to.If you have any more questions email me directly.I hope this helps. I would post a picture of my scenery if I could upload it, but I can't. It comes back as an error.Oh yeah, the Terraserver images are probably old. The ones I used were from 1993. MapQuest has updated images (at least for me). I have had to merge these newer images with my old texture slices in PhotoShop to add important things - like a whole highway system, parking facilities, basically a lot of stuff. This had been an A #1 pain in the hassle. If you don't care about detail like that then don;t worry, but I am anal so I wanted to be a accurate as possible. I guess it is possible to create your main resample photo from the MapQuest site, but you would have to find a way to get the scale. I might have done this if I had a fast connection or if I hadn't already used the Terraserver one to do all my Airport layout. They are in color too. I found that the images were the same old ones I had until you zoom in to the second or third level. Constructing a huge picture out of this would be a pain too.Ramble Ramble....

Share this post


Link to post
Share on other sites

Try out my program Landclass Assistant here in Avsim's library. If you simply want to reassign textures, it will help you. Download the program and updates. Install them in this sequence:1) Main program (about 1 meg)2) 1.2 Update3) landclass.inf updateSoon, you'll be able to do exactly what you need. Landclass Assistant doesn't reassign textures within the airport--so keep that in mind. But you can adjust areas just outside of the airport to your heart's content. Included with Landclass Assistant is a batch file. You copy it to your folder where the Terrain SDK tools are installed, along with the output data (landclass.raw and landclass.inf) from Landclass Assistant. You run the batch file, and it builds a bgl ready for installation (I usually suggest installing the landclass bgl in the FS2002Scenery folder).Hope this helps, and yes, I do respond to support questions via email... Ohh...forgot the cost.I had a 5 percent price increase a week ago (just kidding). LC Assistant is freeware!-John

Share this post


Link to post
Share on other sites

Hi tlassiter.I'm so happy you're making progress! I hope you solve the screenshot upload thing. :(I usually get a screen shot by using "Alt-'PrintScreen'" key combo. Then I go to MSPaint, and 'paste' the image. I saveit as "filename.jpg", because the "Click here to choose your file" thing lists jpegs first...

Share this post


Link to post
Share on other sites

tlassiter has done a marvelous job describing this method. One or two comments, to enjoy the best quality in your finished product, modify the resolution of your big source image to 4.8m/pixel BEFORE running resample.exe.The semantics make this hard to say because the real term for this process is to "resample" the image, but you can see the trouble one gets into quickly, given that msoft called its utility resample.exe. Too bad, too, because resampling is one of the things resample.exe does most poorly.I tend to start with 4m/pixel images off terraserver. That way I only have to reduce it a bit before continueing to process (by 4.8/4).Also, you can have water in your scenery that behaves just like default water in fs2k2. Do this by making a copy of your main image. on it color your water areas black, color 0,0,0. And then color everything else white, 255,255,255.Once you get done, call it a different name, and then create a second .inf file. Slice this file, and save the new slices in a special folder. Then combine them into a format called dxt1 + alpha, this is possible using msoft imagetool, also easier using a utility called fstexconvert created by Elrond Elvish. Martin has so many wonderful utils at MW Graphics, you'll find something there also that will do this.Once you have your slices from both runs of resample.exe combined into one set of dxt1+alpha, you'll find the water is just like the default.Bob B

Share this post


Link to post
Share on other sites

Hey Bob,I never resampled before I used resample.exe. I had a big picture made of 8m/pixel shots and just used it like that. Did I lose a lot of detail in this process? I'm not too thrilled at having to do this over for more detail ( in fact, I won't - I'm pretty happy with what I am getting so far). Except some of the tiles take an hour or more to color and paint. I might try 4m/pixel shots and compare the quality. If it is a lot better, I might do things over. If that is the case I will try to pretend like I haven't spent hours on the present version!!Also, have you checked out Martin's batch compress tool. It takes a bunch of slices and converts them all at once into DXT1 + alpha. You can tell the program what the alpha color is. I use the default of the saturated green. All you have to do is load the unconverted bmps into Paint and paint all the water green. Then when you use the convert program it automatically makes the green transparent. It's as easy as that. Martin certainly has made things so much easier for us. Have use also seen his TV viewer? It allows you to look at thumbnails of a lot of textures at once. It supports all the DXT1 stuff so you can find you samples easily!See ya.I'll try screenies: I keep getting Script Errors when I try to upload! I have jpgs and I choose jpgs and point to my file and it works for a while and then stops with an error.I should probably try reading! I didn't notice the file size limitation!Here we go....please tell me what you think...is it enough detail or should I try the 4 m/pixel?

Share this post


Link to post
Share on other sites

Bob,I forgot to ask: how do you go about resampling? If I have a picture that I know is 4m/pixel, how can I resample in PhotoShop to make it 4.8?

Share this post


Link to post
Share on other sites

It looks very good to me. I'm sure Bob's right, in that the finer resolution will give greater detail... but if you're stamping snippits of default ground-texture bitmaps to build the final slices, the detail level may not be that important. Bob would know. I'm glad you two got connected on this project. It's nice to see it develop.I really like this approach to redesigning/correcting the default scenery. Bob had a great idea with this approach.

Share this post


Link to post
Share on other sites

yep, I've got nearly all of Martin's work. He's the best. TViewer is on my toolbar, use it all the time. I have used the green color for transparency, but I've gotten into a pattern using Elronds utility (which is just a shell for Martin's conversion routine) and you know how it is when its not broke, don't fix it.You may see a real difference when resampling before using resampler (lol).The problem with starting with 8m/pixel, is that resample.exe is forced to allocate the same number of meters of pixel data over many more pixels...to acheive the lod13 locked standard of 4.8m/pixel.Its a difficult job for any resample routine, but there are far better algorythms than msoft used. Elrond's "imagetool" (not msofts) gives us the best resample algorythms to choose from. This link still works for that utility.http://members.rogers.com/eelvish/ImageTool063Alpha.zipFor screenies, try to reduce the image size (resample...lol) til its below 125kb

Share this post


Link to post
Share on other sites

we're writing at the same time! Resampling is really just about having the graphic image contained in a different number of pixels.The link I gave you in the other post is a wonderful utility. If you need to go from 8m/pixel to 4.8m/pixel its the hardest, cuz you need to project the same graphics imagry over MORE pixels, and the resmapling has to make up what should be put on the extra pixels. Going the other way is more accurate, in which case, photoshop does acceptable. You said you have that, right? Just change the "image size" in pixels by the ratio.If you get confused, just remember what the units tell you....8m/pixel says that 8m shows up on every pixel. a 100x100 pixel file has 800x800m on it. Unless you add or subtract content from your photo, nothing will change how many meters are depicted on it, so to change resolution you have to change the number of pixels. If you used a 100x100 pixel image and the content was at 4.8m/pixel, you would only be able to show 480m x 480m. That's an easy thing to remember, so you can remember which way a resample needs to go. In the silly example here, 800m x 800m of info is portrayed at 4.8 m/pixel in (8/4.8)x100 pixels, or 167x167 pixels....so you'd take your file of 100x100 and change the image size to 167x167 and you've resampled it to 4.8m/pixel. Like I said thou, this is the unfortunate direction to go...better to start with a better res and go the other way, that's why I start with 4m/pixel..B

Share this post


Link to post
Share on other sites

Thanks, R...tlassiter is adding some real creativity...he's taking my thoughts beyond where I had left them...Isn't that cool, its one of my favorite parts of sharing on a forum like this. People give me lessons, I take them somewhere cool, others learn from me, and add their own contributions....on and on.As far as whether the improved resolution is value added is all about tlassiter desires. He can see the improvment by a simple set of steps and make his mind up. I sure understand that you can't always incorporate all learning in every upload.B

Share this post


Link to post
Share on other sites

Done and done,I did those simple (time consuming) steps and I realized that I don't think there is too much added depth/detail worth doing over what I have already done. That is a good thing considering how much time I spent trying to line up that stupid highway beltline!!Thanks for the comment on creativity Bob, but I was wondering how am I extending what you were doing? I was under the impression this is what you were doing. Oh well, I hope to be done with this part of the project by the time FS2k16 is available for virtual headset download. And then I get to model a couple of buildings in GMax...actually a lot of buildings! This might be a long project.........but at least I am learning right?Thanks guys for all the ideas and help. I still can't get over this method you taught me about and how relatively easy it is to make an airport look a lot better!!!Tom Lassiter

Share this post


Link to post
Share on other sites

Bob,Thanks for the feedback! I am glad I can finally contribute answers to some things instead of just questions, questions, questions. You have certainly been a contributor to that!See ya.

Share this post


Link to post
Share on other sites

HowdyWell, I have followed the process but it didn't show up in FS.Everything went well unless of coarse my coordinates are messed up ?It was mentioned that maybe I didn't cover a large enough area but unfortunately I don't think satelite imagery is available for Canada. :-(My original work was a large bitmap (3072x3072)which covered only the airport and immediate area (tarmac, taxiways and runways )of which I split into 9 1024x1024 bitmaps for applyng over my airport.But applying these and aligning them was tedious. Now in order to use the resample method it seems I had to reduce the large bitmap to 2048x2048 for FS Calculator to work. This I would think would also reduce resolution. Would not trying to cover a larger area reduce resolution even further ? After resampling the x 2048 bitmap I got 30 256x256 bitmaps that looked good. I coverted to DXT1 but as I say see nothing in FS. :-(Any ideas ?ThanksSteve

Share this post


Link to post
Share on other sites

<>Below you said you got <>I assume you meant you ran the program resample.exe on your inf file, and the output was one tmf file, and 30 bmps each about 193kb in size. Please check to see if this is what you got. If so you have either covered 30 lod13 grids or you've given some bad data to the inf file. <I heard there was some limit in FS Calculator...its artificial to that app, and I believe that was only a beta that Elrond never finished to my knowledge. There is no such limit in the reality of using the resample.exe toolset. Perhaps its time to suggest you go to a manual manipulation of the inf file directly. Its not hard. I made a spreadsheet in excel that does all the calculations you need for writing an inf file directly. As far as resolution goes, you would be best off to figure out what resolution your 3072x3072 pixel image was at. The resample.exe process will force your output to 4.8m/pixel. When I do this work I alter my image to 4.8m/pixel before resample. Thats the only logical way to determine preferred pixel count. <>Did you make a bgl file from your tmf file? Do this by running tmf2bgl.exe on the tmf file that should have been part of your output from resample.exe.Did you place your bgl in your scenery dir?Did you place your textures in your texture dir?Did you add your scenery area in fs2k2?Bob Bernstein

Share this post


Link to post
Share on other sites

Does Terraserver have Canadian images? I don't know. I had trouble when I first started too. My scenery wouldn't show up in FS either. I think I just had too small of an area, but it sounds like that is not your problem. Read Bob's post here about resampling using the imagetool he gave a link to. But definitely make sure you have a folder in your ADDON SCENERY folder named appropriately with the required scenery and texture sub folders. Then place all the converted bmps in the texture folder and the bgl you get from running tmf2bgl in the scenery folder. Add it in FS like you would any other scenery. I know this repeating simple things, but I think this could have been my problem. I just didn't do things just right. I ended up following all the steps very slowly and everything ended up OK.I hope you get it to work. As per the FSCalculator limit - I don't know. It has handled all of my images but I think mine were about 1500 x 1500 in resolution.

Share this post


Link to post
Share on other sites

Tom, its true that you are applying what I've discussed, but I see your work as a unique spin because you are heading toward a minimizing the photographic area, which will more simulate the appearance you'd get if you could "draw" a photoreal road onto the default.I'll post some screenies tonight and show you the difference, my approach has been to maximize the photo area and only use screenshot default painted areas in transition. Not any different technically, but different artistically.My newest terrain effort inludes a valley surrounded by high ground with two airports in the valley. I'm going to let the high ground "revert" to default and see if it looks cool.Cheers,B

Share this post


Link to post
Share on other sites

Thanks Bob and tlassiterYes, after running resample.exe on my inf file, the output was one tmf file, and 30 bmps each about 192kb in size. I also got a bgl file from running tmf2bgl on the tmf file.I installed it like I would any other scenery.FS2002Addon SceneryMy SceneryScenery and texture folders with the bgl in the this scenery and converted DXT1 bitmaps in the texture folder. Then I added the scenery to the scenery library.From what you say I was right in not simply putting the bgl to the FS2002 root scenery folder and the textures to the root texture folder so I don't know what could be wrong ?I guess I also need to ask how do I configure a bitmap for meters/pixel ? To get my bitmap I just took a screenshot from topdown view in FS and converted the 1024 x 768 bitmap to 3072 x 3072 thinking that after I painted over the large bitmap I would dice it to have 9 hirez 1024 bitmaps to work with.I was thinking this was the way to do it ? :-)Your help still needed :-)Thanks Steve

Share this post


Link to post
Share on other sites

The only way I know is to have some known distance portrayed on your photo. The runways offer the easiest landmark. www.airnav.com is a good reference for the lengths of most every runway, you learn what its length is in meters (feet * .3) and then you measure how many pixels are used to represent your runway. divide the two and you have resolution.Of course if you are using screenshots as your base photo, interesting notion, then you could put a temporary runway in place just as a test for resolution, if you do that make it as long as your photo allows. Less error that way. Best,Bob BPS...sometimes fs2k2 doesn't refresh very well. Restart the program and make sure that's not the problem.

Share this post


Link to post
Share on other sites

Great post, but I'm having trouble locating one of the tools you've listed as "FSTerrain Caculator" were might I find this program???>Alright Steve...ready? >>Here is the method I used/am using for my scenery. >>1. Get USA PhotoMaps and learn how to use it. It is very >easy and doesn't take a lot of effort. This will allow you >to dowload the satellite (terraserver) images of your >airport area. The key to this is that you have to get a >good portion of the area, because when you resample, you >have to have at least one complete LOD13 quadrant with >imagery in it (I think this is right...you'll see later). >>2. Once you get your area downloaded, assemble a complete >picture of what you are going to resample. I ended up with >4 large 8m/pixel pictures from USA PhotoMaps and just merged >them in PhotoShop. >>3. Now you have a large .bmp that you are going to resample >using the resample.exe from the Terrain SDK. Resample.exe >requires an inf file which is documented in the SDK. There >is a program out there called FSTerrain Caculator. GET IT. >It needs a reference point from your big picture (in Paint >or PhotoShop move the cursor over a point you can find in >FS2k2 easily - like the corner of a runway and record the x >and y values). Now get the Lat Long of the corresponding >point in FS. Plug these values into the Terrain Calculator >using the scale of 8m/pixel and it will give you an inf >file. I don't use the automated batch file that comes with >the Calculator - I do stuff manually after this. The >calculator will set up a folder and files will be placed in >here - just look for them. >>4. From a command prompt type: resample your_file.inf. >This will produce a tmf file and a bunch of bmps. The bmps >are the 256 x 256 texture slices of the area. >>5. From a command prompt type: tmf2bgl your_file.tmf >your_file.bgl >This will produce the bgl file you need. By the way, I am >not mentioning folder placement or where tmf2bgl is found >and all of that because I assume you know that. >>6. Get the Convdxt program from MW Graphics web site - I >think it is in the beta area. Run it and convert all the >bmp slices to DXT1. Make a new scenery (MyScenery) folder >structure in your choice of places. Add the bgl to the >scenery folder. Add the converted textures to the texture >folder. Add this like any other scenery in FS2k2. >>If nothing shows up, you might not have produced a large >enough area. Like I said, I am using 4 big pictures and am >covering a large chunk of land. My airport (which is pretty >big) is about one fifth the size of the total area. >>7. Once you get this to work, now you are free to alter the >images any way you see fit. Just change the un-converted >(193k) slices using PhotoShop or whatever and the convert >them again and put in your MyScenery texture folder. You >can see your progress as you SLOWLY color each file and >start FS againand again and again and again and again,etc, >etc. >>I am pretty happy with the results I am getting. I use >default textures in some places and just paint in others. >My PhotoShop skills are limited, but I can get some decent >results. That is another how to. >>If you have any more questions email me directly. >>I hope this helps. I would post a picture of my scenery if >I could upload it, but I can't. It comes back as an error. >>Oh yeah, the Terraserver images are probably old. The ones >I used were from 1993. MapQuest has updated images (at >least for me). I have had to merge these newer images with >my old texture slices in PhotoShop to add important things - >like a whole highway system, parking facilities, basically a >lot of stuff. This had been an A #1 pain in the hassle. If >you don't care about detail like that then don;t worry, but >I am anal so I wanted to be a accurate as possible. I guess >it is possible to create your main resample photo from the >MapQuest site, but you would have to find a way to get the >scale. I might have done this if I had a fast connection or >if I hadn't already used the Terraserver one to do all my >Airport layout. They are in color too. I found that the >images were the same old ones I had until you zoom in to the >second or third level. Constructing a huge picture out of >this would be a pain too. >>Ramble Ramble.... >

Share this post


Link to post
Share on other sites

I can't really remember where I found it, but it had to be mentioned in the Terrabuilder Forum b/c I found it while I was searching for help for someone new to the design work. I didn't have a clue how to do this so it has to be somewhere easy to find. Try a search for it or a search for "Newbie" or something like that.Hope it helps.

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