Sign in to follow this  
rhumbaflappy

Water Mask Problem

Recommended Posts

Here is some text from the resample part of the Terrain FSX SDK....."quote"Channel_BlendMask integer.integer Source number and band number used for the blend channel.This 8-bit blend mask channel for aerial imagery controls the transparency of the image when pasted onto the terrain. As an example this is used around the edges of the St. Maarten island image to blend gradually between the aerial photo water and the generic water. The blending channel is read from the 4th (zero-based) band of TIFF or GeoTIFF images, unless this parameter is used to change it. "unquote"Fine...I read this to mean now we can see through coastline water at a coastline

Share this post


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

Hi John.This INF should work:; ===================================[source]Type = MultiSourceNumberOfSources = 3[source1]Type = BMPLayer = ImagerySourceDir = "Photoreal_Images"SourceFile = "Image5abmp.bmp"ULXMAP = -73.249688888888ULYMAP = 44.4923166666667XDIM = 0.00000692801211705565YDIM = 0.00000494488172961523Variation = DayChannel_LandWaterMask = 3.0[source2]Type = BMPLayer = ImagerySourceDir = "Photoreal_Images"SourceFile = "Image5a_lm_bmp.bmp"ULXMAP = -73.249688888888ULYMAP = 44.4923166666667XDIM = 0.00000692801211705565YDIM = 0.00000494488172961523Variation = NightChannel_LandWaterMask = 3.0[source3]Type = TIFFLayer = NoneSourceDir = "Photoreal_Images"SourceFile = "Image5alphatif.tif"ULXMAP = -73.249688888888ULYMAP = 44.4923166666667XDIM = 0.00000692801211705565YDIM = 0.00000494488172961523SamplingMethod = Gaussian[Destination]DestDir = "Photoreal_Images"DestBaseFileName = "Image5waterlandbgl02"UseSourceDimensions= 1; ==================================="Channel_LandWaterMask = 3.0" means your INF's Source3 ( layer 0 ) is added to both day and night version as a LandWaterMask. What the Resample expects for a mask is a 8-bit, black and white image for the mask.I think the "SamplingMethod = Gaussian" is needed only for the added 8-bit Sources. The day and night Sources don't need that specified.Dick

Share this post


Link to post
Share on other sites

Dick...many thanks. It worked (of course)!...then I swapped Channel_LandWaterMask to Channel_Blend and feathered my tiff file white out over the shoreline and now have the shallow shoreline water transparent with all the real underwater artifacts visible. A marvelous upgrade in FSX, IMOP. Unfortunately he choice of colors FSX made for Lake Champlain is not at all realistic and I would like to change it. I can't reasonably do it with photoreal pictures because of the large hundred plus miles of shoreline. I am told I can do it with EZ-Landclass and I wonder if there are any other alternatives for FSX?

Share this post


Link to post
Share on other sites

Hi John.EZ-Landclass will do the job in making the INF file, and use the new resample to process it.What you might want to do is to create a new set of waterclass textures to replace the colors you don't like, and use them as local textures ( twin texture folder ).Just make your waterclass bgl, with the numbers you like, then replace ALL the textures used in your WC BGL. For example, if you use 3 waterclass textures, then make sure those 3 are in the local texture folder... else there may be blurries, or worse in the sim. You can use value 254 as a NULL value in the INF, and then use that value to fill out the waterclass ( just like landclass ).Also, I think the waterclass numbers are assocciated with water depth, which might be important to watch for concerning water-going vessels. ( It was in CFS2 ).Dick

Share this post


Link to post
Share on other sites

>... to Channel_Blend and feathered my tiff>file white out over the shoreline and now have the shallow>shoreline water transparent with all the real underwater>artifacts visible. Is it possible to use RGB values of one of the 'normal' bands(i.e. not the alpha band) to define 'transparent' and 'solid areas' of land?I want semi transparent areas of water but cant change the alpha values because my workflow avoids using a graphics package so that Geotiff tags are maintained (allows fast cfg file writing)Im using Polygons to define/mask imagery within ArcGIS and then exporting the image(ie. I draw a polygon around an island, set the colour of the water to a ugly bright green and use this image as my texture. The green is set to the 'null' value in the cfg file) Can i then export another blendmask image using a slightly different 'shoreline' which will use different colours to define transparency (i.e. Black = No transparency on image, white = semi transparency)??Or can a blend mask only read from the aplha channel?

Share this post


Link to post
Share on other sites

Alternatively, can you just colour the water black and set the landwatermask to look at the one image? I.e.[source]Type = GeoTIFFLayer = ImagerySourceDir = "Raw"SourceFile = "Whale_mask_blackt.tif"Channel_LandWaterMask = 1.1[Destination]DestDir = "Output"DestBaseFileName = "BOPIslandsTest"DestFileType = BGLLOD = AutoThis compiles OK but im not sure if it works (unfortunately, FSX is on my home PC and im doing all the work at work...)It displays in TmfViewer with 'black water' so im assuming it will display as a black area in FSX too (rather than actual water)Ive tried setting the water colour as the null value (in the case above: Nullvalue = 255,255,255) but this isnt a solution either as the scenery im making includes islands and the default shoreline sometimes is displayed where my imagery differs.

Share this post


Link to post
Share on other sites

Hi Dick.I used EZ-Landclass to change the water texture to (10) something darker, but perhaps you (or someone else) can tell me why the FSX water texture looks nice and dark when you convert it from DXT format to a standard bitmap, but converts to something much lighter when used in the sim? I finally took the standard (10) water bitmap and with Paint Shop Pro mapped it directly onto the part of my bmp that was water so they almost blend in the sim. I'll fix the "almost" later. Sim water using texture 10 is still much lighter than the dark brownish water in the aerials I have from Google.I have not succeeded in reducing the size of my bgls by adding compressionquality, limiting LOD values, or Nodata = ,,,,0. I also have a bgl (it's 128000K) which appears in tmfviewer but won't display in FSX, even by itself. I can display larger bgl's than that.My experience base is someone limited with resample since I always used Terrabuilder which did all the work for me in building an inf that worked.I did discover that you can't leave a bgl loaded in TMFviewer and then run a resample that tries to overwrite the old loaded version. (In command line mode it says it can't open the bgl file)

Share this post


Link to post
Share on other sites

Wish I coiuld help but I am still a newbie at this are of scenery design.

Share this post


Link to post
Share on other sites

Ji John.You've got a lot of info here!Waterclass:Your problem is that you don't like the texture displayed in FSX for value 10. A good solution might be to replace the texture locally in a twin texture folder, rather than to blend it into the photoreal bitmap. If 10 is your only waterclass, than you you just need to locally supply that one texture.For the rest of the problems, those seem to be related to the INF file. Include it in a post, and I can see if there is something wrong.And the open file in TMFViewer? Yes, you need to close the viewer,as the file is considered "open", and nothing else can use it until you close it.Dick

Share this post


Link to post
Share on other sites

Hi Dick.I have a separate "better colored" number 10 water texture and I can include it in the Addon Texture folder. I'm not clear about where to go from there...I have a photoreal bitmap that covers a large area of water and the surrounding shore. I am assuming you are saying that that modified water texture in the addon folder takes global precedence over the one in the world scenery folder as long as it has the same name? That suggests to me that the system always looks for a texture there first?I could then mask away the water in the photoreal bmp..........? My bgl that showed in tmfviewer but not the FSX scenery was due to a missing - sign in my longitude value so I was sending the bgl to Europe somewhere. More later.

Share this post


Link to post
Share on other sites

Hi John.In FSX, as in FS9, an active waterclass BGL will have the sim look for textures first in the twin texture folder, before it looks in the default location. So as long as all the textures in the BGL are in the local folder, the local textures will show without problem in the sim.This is why you normally would not want a twin texture folder with waterclass or landclass... causes a memory leak in FS9. But if all the referenced textures are present, all is well. So you can have customised waterclass ( or landclass ) textures.Dick

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