• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v2 Are Blend Masks working properly in P3Dv2?

Messages
1,636
Country
unitedstates
I just spent the day trying to make one simple blendmask but was seeing some banding and never a final smooth transition into water, like the ocean. So after a lot of reading I discovered this was an issue when LM brought out P3dv2. But now we are on 2.5!?

So I am pretty sure it is just me making some dumb mistake but let me ask... is blendmasking working properly in 2.5?

Thx,

Clutch
 
Hello:

Would you please post a screenshot of an example scenery area showing this anomaly ?


Also, please state which of the following you are using as a blend mask layer: :scratchch

* 8-bit TIF gray scale in a separate source file

...or:

* One of the Alpha channels in a GeoTIFF source file with a 24-bit visual layer for the aerial imagery (in the same file)


Additionally, have you verified using a graphics application or utility, whether the "Black" color in the "Blend Mask" and/or 'Water Mask' is absolute (0,0,0 HEX) rather than a lesser shade (ex: 1,1,1 HEX) ...in the areas intended to be displayed as water in FS / P3D at run time ?

IIUC, one will not achieve 'complete' transition into exclusively the MSFS water class texture (regardless of the MSFS "active water" attribute itself being otherwise displayed 'on top of' intended water areas in ex: aerial imagery) ...unless the Blend Mask and Water Mask areas are both absolute Black (0,0,0 HEX).

To verify whether the color "Black" in your Mask actually is absolute (0,0,0), you may wish to try:

Get Colors from Image (BETA)

http://html-color-codes.info/colors-from-image/

"This is probably the only tool of this kind that doesn't upload your images on the webserver to do the magic. Because of the goodies in the HTML5 standard it's now possible to do all the image processing inside the web browser without uploading image.
(This is great for security reasons.)
"

http://www.color-hex.com/color/000000


PS
: In the 8-bit gray scale Blend Mask, are you using "Floyd-Steinberg dithering" ?

http://en.wikipedia.org/wiki/Floyd–Steinberg_dithering


FYI: MSFS / P3D SDK ImageTool includes a method of dithering via the -dither Use Floyd-Steinberg switch:

http://www.fsdeveloper.com/forum/th...s-follow-a-size-guideline.431618/#post-685850



NOTE
: Another method for working with "Masks" in preparation of ex: GeoTiff source files for MSFS / P3D was alluded to by Luis Feliz-Tirado in his FSX tutorials, and was further explored by Maurizio Giorgi in his freeware / payware scenery, and in a tutorial document available online; you may wish to review this linked info:

"The effects of using (RGB ?) colors as a means of achieving blending effects for various aspects of terrain scenery processing (ex: with water masks as a means of blending aerial imagery with FSX default water) ... is alluded to by "Maurizio G" (aka "Maurizio Giorgi" ?) ...author of several excellent freeware AussieX photo-real sceneries, and the payware Orbx FTX Canberra Cityscape":

http://www.fsdeveloper.com/forum/threads/geotiff-blending.431787/#post-687558

GaryGB
 
Last edited:
Yeah I had this too; some water was showing up through some land. Seems to be a P3D issue. I couldn't fix it, regardless of the water mask format.

Luckily it was not noticeable for my project.
 
Hi Shaun:

Which water mask format(s) did you actually try for normal display in P3Dv2.x ? :scratchch

And, would you also please state which of the following you used as a blend mask layer:

* 8-bit TIF gray scale in a separate source file

...or:

* One of the Alpha channels in a GeoTIFF source file with a RGB 24-bit "visual layer" for the aerial imagery (in the same file)

What was the total bit-depth of the ex: GeoTiff or separate imagery and mask source files ...when adding up the Visual RGB and (2) Alpha / Mask channels in the source imagery ?

For example
:

24-bits - RGB Visual Layer of aerial imagery (actually 3- layers: R,G,B at 8-bits each)
8-bits - Gray Scale Blend Mask (Alpha#2)
1-bit - Water Mask (Alpha#1)

[EDITED]

NOTE: Final output source file format for TIFF Masks must actually be 8-Bit gray-scale; see:

http://www.fsdeveloper.com/forum/th...-scenery-achievable.440912/page-4#post-789447

[END_EDIT]


FYI: Total bit depth of source imagery in a multi-source FS SDK Resample processing scenario may impact successful use of FS "Masks"

http://wiki.panotools.org/TIFF


Also, tools used to process source imagery may also impact successful use of FS "Masks", especially when TIFF files are involved:

"Baseline TIFF does not require support for any of this, however. Current versions of libtiff can read an interleaved alpha channel as generic ``extra samples,'' but it is up to the application to interpret the samples correctly. The library does not support images with channels of different depths, and although it could be manipulated into reading a secondary grayscale subfile (which the application could interpret as a full alpha channel), that would be a user-defined extension--i.e., specific to the application and not supported by any other software."

http://www.vias.org/pngguide/chapter08_06_06.html

http://www.gdal.org/frmt_gtiff.html

https://www.google.com/#q=libtiff

GaryGB
 
Last edited:
And here I was expecting a simple yes or no reply, ha! So I guess by your in-depth reply the answer is probable no, there is not an issue with P3D... it is probably me.

Attached is a sample shot. Hopefully you can see the banding but I also added a few lines to point them out. I use PS and did a pin-point test of the grayscale on both the water mask and the blend mask. The final black is 0,0,0, and checking each band in the blend mask I could see in crease in opacity, (1,1,1 - 2,2,2, etc.).

I am using the 8-bit TIF gray scale in a separate source file method. PS provides a Gaussian Blur option which is what I applied. Also tried the Feather tool technique but saw no difference. As far a total bits, I believe it is 24,8,8. Your total bit depth reply provokes a lot of "Mmmm... maybe I should try this". So I converted the _BM and _WM to bmps as an 8-bit and a 1-bit (I usually resample with all files in tiff or GeoTiff format. But resample whould just kick it out. It would not process?
 

Attachments

  • Banding issue.jpg
    Banding issue.jpg
    281.1 KB · Views: 567
Last edited:
And here I was expecting a simple yes or no reply, ha! So I guess by your in-depth reply the answer is probable no, there is not an issue with P3D... it is probably me.

Attached is a sample shot. Hopefully you can see the banding but I also added a few lines to point them out. I use PS and did a pin-point test of the grayscale on both the water mask and the blend mask. The final black is 0,0,0, and checking each band in the blend mask I could see in crease in opacity, (1,1,1 - 2,2,2, etc.).

I am using the 8-bit TIF gray scale in a separate source file method. PS provides a Gaussian Blur option which is what I applied. Also tried the Feather tool technique but saw no difference.

AFAIK, one may minimize 'banding' better by dithering, rather than blurring / feathering a 8-bit image ...such as used in a MSFS Blend Mask.

Use of Gaussian Blur, like Lanczos, may produce a 'halo' effect and may actually involve some 'edge detection' as an initial part of the filtering algorithm, which IIUC, may make it more difficult to eliminate perceptible banding.


An alternative method using both 'Gaussian Blur' and 'Refine Edge':

http://www.apogeephoto.com/march2011/watts32011.shtml



But, IMHO, "Dithering" is preferable, as most USGS aerial imagery is now distributed as "lossy" compressed JP2 / JPEG 2000 format.

http://en.wikipedia.org/wiki/JPEG_2000


< BTW: Where can one download the original ex: GeoTiff imagery from which the (IMHO, inferior !) USGS-distributed JP2's are derived ? :scratchch >


When utilizing a dithering algorithm on a 8-bit image, one may consider either Floyd-Steinberg, or the newer methods such as Atkinson.

http://www.tinrocket.com/hyperdither/comparison/


Reportedly the default PhotoShop "Diffusion Dither" uses a modified version of modified Floyd-Steinberg algorithm:

PhotoShop Menu > Image > Mode > Indexed Color > Diffusion Dither


Alternatives using Dithering plugins:

http://translate.google.com/transla...e.de/download/dither-1147657.html&prev=search

http://www.ximagic.com/g_index.html

http://www.ximagic.com/g_download.html

http://translate.googleusercontent....x.html&usg=ALkJrhi-R5n_fFIWSZRKDpkNUQXeaR97wg



As far a total bits, I believe it is 24,8,8. Your total bit depth reply provokes a lot of "Mmmm... maybe I should try this". So I converted the _BM and _WM to bmps as an 8-bit and a 1-bit (I usually resample with all files in tiff or GeoTiff format. But resample would just kick it out. It would not process?

What error message(s) did the LM version of the P3D 2.x SDK Resample write to the screen in CMD mode ? ;)


I don't personally use P3D (yet), but if you post an example INF for the Resample "failure to compute" scenario, and the workflow of what source imagery file format(s) was used, and what GIS utilities were used to convert from ex: JP2 to GeoTiff / re-project / restore Geo-rectification etc., someone more familiar with the quirks of P3Dv2.x SDK might be able to review it and reply ? :idea:


Hope this helps ! :)

GaryGB
 
Last edited:
Thx... still testing different ways. Can't seem to find a "dithering" tool in PS but will keep plugging away. Checking your links for additional info. Oh, I did not get any error messages but I did discover that resample will not accept 8bit bmps. Tiffs, yes, bmps no. According to SDK 8 bit BMs and WMs are ok.

Pluggin' away today...
 
Back
Top