Jump to content
Sign in to follow this  
Guest bones

Photo terrain and coastlines

Recommended Posts

Guest Stormshadow

Hi all,I've finally managed to run a test of how photo scenery should look like on the default scenery I'm modifying. I've had to modify the coastlines of an Island and I incidentally ran a test on a sector which incorporates the new coastline, land and water. Everything worked to perfection except that obviously, the area in the photo image which represents water substituted the default water in FS together with the wave effects, ripples etc.My question is therefore the following:Is there a way to create a 24-bit BMP image, by first laying out a 'transparent' image then superimposing on this another image containing ONLY the land part of the sector I'm adding as phototerrain?Help very much appreciated!Storm

Share this post


Link to post
Share on other sites

Yes, I think so. It depends on how you are going to lay the textures down.If you are using the custom terrain textures method from the SDK, then the water area would be masked by the coastline (I'm pretty sure). You can modify the coastline to fit the textures using Ground2K.If you are using ground polygons, then you can mask out the water by using the alpha channel using the DXT-1 format.- Martin

Share this post


Link to post
Share on other sites
Guest Stormshadow

Hi Martin,Are you implying that the water area should have been automatically kind of 'removed'? (Im using MS's SDK).1 other question:After generating the BMPs using resample, ImageTool has to be run. This will create mipmaps. Easy. These .mip files must be renamed to .bmp however, in windows XP, simply pressing F2 to rename the file to .bmp doesn't actually rename the extension but rather adds an extra four letters to the filename.What I did then is to convert the .mip images to bitmaps again. The scenery was still generated though. When I check the file parameters in ImageTool, I get DXT1 format.Storm

Share this post


Link to post
Share on other sites

>Hi Martin,>>Are you implying that the water area should have been>automatically kind of 'removed'? (Im using MS's SDK).It depends on where the coastline is. I talking about the "real" coastline in FS, not the one in your bitmap. If the coastline does not happen to match your bitmap, use Ground2K to move it to where it should be. I'm not 100% certain about this, so if anyone knows different, please speak up.Another option would be to apply alpha-masks to you nitmap the same way you do for gourd polygons, but I'm not sure if this works at all (suspect it doesn't).>run. This will create mipmaps. Easy. These .mip files must be>renamed to .bmp however, in windows XP, simply pressing F2 toWell, I've never seen these .mip files, so I think maybe they are being saved seperately for some reason. The mipmaps are included in the DXT1 bitmap file. It should be 3 steps:Load bitmapCreate mipmapsSave bitmapBetter still - make a batch file.I recall that the SDK tells us to convert the textures using a special flag "terrain" or "terrainphoto", but I never knew what the point was. Maybe to keep them 256x256? Anyway, I noticed that this option was only available from the command line, not the menus.- Martin

Share this post


Link to post
Share on other sites
Guest Stormshadow

Not with you m8 -Let me briefly outline the steps in my scenery desing, probably I wasn't clear enough..I had to redesign the entire coastline for a particular Island in FS. I used coastline maker, great software.I read through MS SDKs custom terrain word file to create some test photo scenery. I used a LOD11 since the NW coordinate is needed in the info file and Ive had some experienece working with LOD11 cells. Although LOD11 parameter is not needed in custom terrain info files, I used such a level as a guide to which area I wanted to change.The particular test area contains, land, the new coastlines and water. The problem is that everything works well except that even the photo section containing water is pasted on the scenery (which obviously covers the actual FS water with all its effects etc). All I want is for the land in the photo image to be pasted on the scenery - the equivalent scenery land that is.I noticed that Niagra falls example has got water aswell but nothing is mentioned in the SDK bout how to treat this.Storm

Share this post


Link to post
Share on other sites

Ok, well, it sounds as if it should work the way you made it. I'm not sure about coastline maker, but if it makes proper coastlines according to the SDK, then all this should work. I hope someone else can help more with this, since I am as stumped as you are.- Martin

Share this post


Link to post
Share on other sites

Hi Storm."The problem is that everything works well except that even the photo section containing water is pasted on the scenery (which obviously covers the actual FS water with all its effects etc). All I want is for the land in the photo image to be pasted on the scenery - the equivalent scenery land that is."To force water you use the alpha channel for the textures. DXT1 + alpha.For a small area, you could load the textures into a paint program and add the alpha to each individual texture slice.For anything larger, you could use Terrabuilder to automate the whole process, or you can find a copy of Elrond Elvish's "FSTexConvert" to help with the merging of alpha channel mask to the slices.Check out http://terrabuilder.com/ for this app.Dick

Share this post


Link to post
Share on other sites
Guest bones

Once you get your bitmap water areas removed there is a secondary issue I would like to ask you about.I don't know if your island is hilly or not but could you tell me if the mesh is still limited by the original FS default coastline (which forces mesh to sea level) or whether it flow up to your revised coastline..It's a problem I have encountered with my own island sceneries - the offset between the two coastlines is about 500ft and I end up with inshore cliffs.boneshttp://fsaviation.net

Share this post


Link to post
Share on other sites
Guest Stormshadow

Cheers Rhumba and Shaka,So it seems I'll have to get my hands dirty with alpha channels - I'm using paint shop pro 6 and 7 - is the software capable of creating alpha channels as I can't seem to find the command. And is an alpha channel the same as transparency mode?Storm

Share this post


Link to post
Share on other sites
Guest Stormshadow

Probably this is the FS bug Rhumba refers to - default water polygons cannot be mesh altered, they're stuck at 0m. My Island has got cliffs at 250m max height and are awfully designed in the default scenery! To get the terrain raised in areas which were by default water, I had to locate the hypXXXXX.bgl file, de-compile it and manually edit the asm code to remove the 0m restriction. Recompile to get the bgl. I set the height parameter to -9999 and it works. Did I explain that correctly Rhumba? - I know you do not agree with this method but it seems thats the only decent solution and don't worry I'm careful at modifying the script :)Storm

Share this post


Link to post
Share on other sites

I think there is a tutorial out there somewhere on how to create alpha channels with PSP. However, I do it the hard way:- I create a mask on the bitmap of the area I want to exclude.- I save the mask, and then reload it as a bitmap.- I "soften" up the edges. You can use 256 shades of grey for the alpha to allow for different transparencies.- I save the mask/bitmapThen, I load up DXTBmp and load in my normal bitmap, and then load the mask-bitmap in for the alpha channel. I think imagetool.exe can do this too. Then I save as DTX3 with alpha.But, I think there is a more direct method using the mask directly for the alpha channel, I just prefer my way. There is a tutorial at the Architect 2002 home page at http://www.pouksim.com that briefly walks you through this. The trick is to learn to use the masks - it's not too hard.- Martin

Share this post


Link to post
Share on other sites

Hi Storm.Go to Martin Wright's website:http://www.mnwright.btinternet.co.uk/index.htmI think his DXTBMP program has batch capability to produce alpha keyed to a color. Some users use black, some use a green color ( but I heard there was a problem using green ).In other words, paint the water areas pure black in the base image, resample, then batch the texture slices through DXTBMP to mip and add the alpha channel as black.Martin also has a good forum relating to his programs. More than one way to skin a cat here, and I would let the computer do the work, rather than doing it by hand with a paint program.Dick

Share this post


Link to post
Share on other sites
Guest Stormshadow

Cheers Rhumba,'ll check out Martin's site tonight as I'm off to watch a soccer match!!Anyways, 1 question regarding mesh:- How high/low can mesh represnet elevations. I mean, I've got areas which are at 5/10m low and are not raised in FS albeit TMF shows the altitude to be 5 to 10m. Is there a limit?Storm

Share this post


Link to post
Share on other sites

Hi Storm.I never looked into the vertical resolution limits in the mesh files or the sim, but it would make sense that there would be some limits. I believe the mesh itself is restricted to integers ( but I do recall resample has a scale command ).The sim itself may have some controls in the FS9.cfg file to control vertical mesh resolution. Or there may just be somebuilt-in control. Or maybe not. :)To "override" the default mesh, you need to use a higher LOD, and I believe the default setup for FS9 uses LOD10 as it's upper display limit, with the lower LOD's used for a type of "mipping" of the mesh.Steve Greenwood would probably know the answer:http://fs-traveler.com/fs-traveler.htmlDick

Share this post


Link to post
Share on other sites
Guest bones

Very clever!I'd try that myself but I haven't touched ASM code and am equally worried about revising default files.Good luck with the Alpha rework. I use a combination of PSP and DXTBmp for both aircraft and scenery. DXTBmp gives you the Alpha channel and also creates the mipmaps automatically.boneshttp://fsaviation.net

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