Hi Felix:
IIUC, it is apparent that you are using FS Earth Tiles (aka "FSET") to generate your custom photo-real aerial imagery source files and multi-source INF file for FS SDK Resample.
BTW: It seems that FSET consistently uses the "SamplingMethod =
Point" rather than "SamplingMethod = "
Gaussian" parameter value in the INF files it automatically creates for the end user
I am not certain whether and how this may further impact Resample with regard to any Blend Mask / Water Mask behavior in FS at run time, as I have not yet personally tested use of that Resample parameter value option for
aerial imagery.
Also, I do not (yet) develop for P3Dv2.x / v3.x, so I can only comment on what one would see using the FSX run time rendering engine.
IMHO, the "bleed-through" of the underlying default terrain textures and CVX vector terrain objects (
ex: shorelines with- or without-linked Effect *.Fx for waves) may also be due to an obscure 'redundant' / 'additive' Alpha gray scale value "over-Bit-ness" anomaly imparted by overlapping Water and Blend Masks ...resulting in more transparency than expected / desired over the inland area adjacent to the shoreline.
You may wish to review the comments by Richard Ludowise (aka "rhumbaflappy") in a thread involving a related troubleshooting topic ...here:
http://www.fsdeveloper.com/forum/threads/watermask-and-blend-help-needed.3432/#post-28535
http://www.fsdeveloper.com/forum/threads/watermask-and-blend-help-needed.3432/#post-28535
Hi abckurt.
Is your source geotiff an image with one or more alphachannels? Or are you using separate images for watermask and blendmask?
Also, why not show your INF file?
Here's what you need to remember:
Anything you want to NOT show as photoreal, needs to be set with a blendmask... this includes default water and land. You can "blend" holes in the photoreal to allow default water and land to show through.
Any part of the photoreal image you wish to
behave as water, while still showing as photoreal, needs to be set with a watermask.
Note that the:
NoData = ,,,,0
only helps with the resultant compression of the BGL... it doesn't "define" anything as far as the blendchannel, as 0 is already a hole.
Also note, the "millenniumimage_water_blend.tif" has 2 alphachannels... #1 is the watermask which makes the photoreal water behave as water... and a #2 alphachannel that is the blendmask for the edge of the image.
If you had an image with a single alphachannel, which you would like to use as a blend ( with black as a hole to allow default water to show through ) then you need to put this in your SOURCE section of the INF file:
Channel_BlendMask = 3
...then
the single blendmask should allow black to be a hole for default water ( or land ) to show through.
Dick
IIUC, this means that you may
only need to use a single (Blend) Mask, provided that it contains the proper gray scale 'color' step values in the gradient overlying the respective Land and Water areas ...to enable the desired local terrain attribute display:
* Absolute White (RGB 255,255,255) over Land
...and:
* varying degrees of gray over the shoreline
water <
NOT the Land ! >, fading outwards
offshore, to absolute Black (RGB 0,0,0) at the position where you want only the default FS water
and associated local "Water Class" texture color to show through to the top ...
instead of the "under water" portion of the photo-real aerial imagery source texture.
Additionally, please refer to FS Terrain SDK Resample "worked examples", and consider making your own derived 'test' version of a FSET INF file using the "
SamplingMethod = "Gaussian" parameter value in that 'test' INF file:
https://msdn.microsoft.com/en-us/library/cc707102.aspx#Example5Multisource
https://msdn.microsoft.com/en-us/library/cc707119.aspx
[
EDITED]
PS: You may also wish to review the info I quoted in this thread:
http://www.fsdeveloper.com/forum/threads/resample-error.427351/
Note especially, Luis Feiz-Tirado's citation of Adam Szofran's explanation as to how the behavior of Water and Blend Masks has changed with regard to creating "holes" versus allowing terrain attribute display:
http://www.fsdeveloper.com/forum/threads/resample-error.427351/#post-649156
I'd forgotten where I originally saw this, but just found it again at ptsim's SBuilderX forum:
http://www.ptsim.com/forum/viewtopic.php?p=3478
"
Post by luisfeliztirado » Sat Jul 07, 2007 11:35 am
Resample accepts a limited number of image formats.
Here is some information from Adam Szofran, developer in charge of terrain at Aces:
Geotiff and Alpha channels
Photoshop can add an arbitrary number of alpha channels to TIFF images, but of course it strips out the GeoTIFF tags which isn't too wonderful. The listgeo tool can be used to save the GeoTIFF tags before loading the image into Photoshop and the geotifcp can be used to put the tags back after Photoshop works its evil.
If that proves to be too much of a pain, then you can actually read the alpha channels (water mask and/or blend mask) from one or more separate files. I've attached an example showing how to do this. It's a modification of the DayNight_Variations example in the Terrain SDK. Unzip it into the Terrain SDK directory because it references some of the source bitmaps included there. The key thing is the use of Channel_BlendMask=[<source>.]<band> and Channel_LandWaterMask=[<source>.]<band> to pull channel data from different source files.
The masks are just regular 8-bit grayscale TIFF files (not GeoTIFF, although those would work too). Unfortunately, you can't use 8-bit grayscale BMP files with Resample but TIFFs work great.
Here are a few things to keep in mind about the land/water masks. White (255) is land; black (0) is water. If you want the default water color to show through, you must paint entirely black (RGB=0,0,0) pixels into the the source image containing the color channels. Anything other than black will be used as is, but with reflective water effects. That's how we got the water colors from the satellite imagery of St. Maarten to show through near the shore. We used a blend mask to fade out the satellite image water colors and fade in the default water colors further offshore.
Water Mask
With the FS9 Resample tool, the water mask punched a hole in your image to reveal default water beneath.
With the FSX Resample tool, we wanted to allow more flexibility, so we changed how the water mask works and we also added a blend mask. Now the water mask triggers reflective and specular water effects, but it doesn't punch a hole in your image. The benefit of this is that you can now paint the water any color you want. For example, if your source imagery contains murky brown swamp water, you can now get the muck to show up in FSX with reflections and specular effects.
If you'd rather just see the default water colors, you have to use a blend mask to punch a hole in your image to reveal the default textures below. Note, however, that the default textures revealed by the blend mask might not be water; they could very well be land textures! Therefore, if you want to guarantee that the blend mask will expose default water textures, you need to create a water polygon (a big square one will do) that covers the area where you want water to appear. For information about creating water polygons, look for the documentation of the shp2vec tool in the FSX SDK."
"And this from the Terrain S.D.K. documentation:
Notes on Acquiring Raw Terrain Imagery
More than likely, the image you want to use will be an aerial or satellite photo. The raw image must be either a 24-bit per pixel Windows .bmp file or a 32-bit per pixel Targa .tga file."
NOTE: The above quoted thread was the basis for a subsequent excellent tutorial by Luiz Feliz-Tirado:
"
Make photo-real ground textures"
http://library.avsim.net/esearch.php?CatID=fsxsd&DLID=140539
...A pertinent quote from that tutorial:
"
Source image formats
Resample will accept a restricted number of image formats, for example:
- 24-bit bitmaps (BMP)
- 24-bit TIFF (TIF)
- 32-bit TIFF (TIF)
- GeoTIFF files, that have geo-referencing information included (TIF)
- 8-bit grayscale TIFF (TIF)
- 8-bit grayscale GeoTIFF (TIF)
- 24-bit TARGA (TGA)
- 32-bit TARGA (TGA)"
Hope this helps further explain how water may end up in a "
land area" in the visual part of one's aerial imagery.
Jim: In light of the above info, I'm baffled as to why SBuilderX creates
32-bit BMPs during its (-
internal-) work-flow.
GaryGB
Note as well, Jim Robinson's discovery of how PhotoShop behaves with regard to creation and saving of Alpha channels in
BMP files (...which inherently are able to only have {1} Alpha channel):
http://www.fsdeveloper.com/forum/threads/resample-error.427351/#post-649173
http://www.fsdeveloper.com/forum/threads/resample-error.427351/#post-649173
I'm not sure either Gary, it's odd. To be honest I have never used SBX as anything but a source for imagery and an .inf with regard to photoreal, beyond that I've always just snatched the .bmp and .inf out of the work folder immediately after downloading, converted them to .tifs in PS (not geotifs of course), edited the .inf to reflect the changes, and then all further resampling was done by sending the .inf directly to resample.exe.
I just did a quick test, with PS CS2 I opened one of the SBX-generated .bmps and stripped away the alpha channel (which was all white). I then simply saved it, and on re-opening I see PS had added back the alpha channel except this time it was all black - possibly that might account for the "flooded airport" mentioned above, although I have no idea if Gimp handles alpha in the same manner upon save.
I then stripped the alpha channel again and this time did
Save as where PS gave me an option of 24 or 32 bit with 24 ticked by default. Of course this time the alpha channel was not reintroduced, and I then opened the test project back up in SBX and successfully compiled the photoreal. I didn't check it in the sim but I did drag it into TMFViewer and it appears to be a normal photoreal like any other I've done and did not have a water mask.
Next I opened the .bmp back up in PS added the alpha channel back and did a quick water mask on it, saved as 32 bit, and recompiled again from within SBX. No problems, and in checking the .bgl in TMFViewer it appears you can indeed include your water mask as a channel within a .bmp - you just don't have the option of a secondary alpha channel for the blend mask. .tifs rule for that reason

.
Nothing above was really unexpected, pretty much exactly what I thought would happen, but the other day I was playing with one and I can't remember the exact scenario but for some reason I wasn't able to get SBX to give me a compile option - it kept telling me that nothing was selected when clearly the .bmp was selected and I know I had it positioned correctly according to the accompanying .txt file SBX generates when it generates a map. Maybe that test sample of imagery was just too small or something, I'm not sure. That
was odd behavior and I probably should retest someday and see if I can figure out what the problem was. Zzzzzz... With any luck I'll die before I get around to it, lol.
Jim
[
END_EDIT]
Hope this helps resolve your display anomaly.
GaryGB