1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

P3D v3 Blend mask not working

Discussion in 'Airport Design General' started by Ziltoid, 19 Dec 2015.

  1. Ziltoid

    Ziltoid

    Joined:
    17 Dec 2015
    Messages:
    1
    Country:
    netherlands
    I recently found some tutorials on photorealistic scenery design, and thought I'd give it a go. I decided to start with a small airport (Eindhoven Airport, EHEH), since it has just one runway and not too many taxiways. I got as far as creating a water and blend mask (even though the water mask is useless 'cause I decided to cut out the water in the blendmask..). Then I made the INF file, dropped that into resample.exe and it started working. However, when I copy the .bgl file to my scenery folder and add the area in P3D, it'll show all the photoreal scenery (as in, the full square I selected in SBuilderX), in stead of the parts of the image I left white. I've gone over the tutorial a few times, and I'm pretty sure I'm doing the right thing. What am I doing wrong? My INF file is as follows:
    [Source]
    Type = MultiSource
    NumberOfSources = 2

    [Source1]
    Type = BMP
    Layer = Imagery
    SourceDir = "."
    SourceFile = "EHEH-PH1.BMP"
    Variation = All
    ulyMap = 51.4651303853649
    ulxMap = 5.35446166992187
    xDim = 5.36441802978496E-06
    yDim = 3.34307973233591E-06

    Channel_BlendMask = 2.0

    [Source2]
    Type = BMP
    Layer = None
    SourceDir = "."
    SourceFile = "EHEH-PH1_Blendmask.bmp"
    SamplingMethod = Gaussian
    ulyMap = 51.4651303853649
    ulxMap = 5.35446166992187
    xDim = 5.36441802978496E-06
    yDim = 3.34307973233591E-06

    [Destination]
    DestDir ="."
    DestBaseFileName = "EHEH-PH1"
    DestFileType = BGL
    LOD = Auto
    UseSourceDimension = 1
    CompressionQuality = 85

    This are the two BMP files
    http://i.imgur.com/7uBNfq2.png?1 (had to take a screenshot of it because I can't upload BMP files, but you get the idea hopefully).

    Where am I going wrong?
     
  2. AndyCYXU

    AndyCYXU

    Joined:
    24 Dec 2015
    Messages:
    97
    Country:
    canada
    Blend mask has to be TIF image not BMP
    Well atleast according to tutorials i used to learn and most of them name it with xxx_B.tif that is I think info for sbuilderx only so maybe it doesn't matter when you make your own inf file and drop it directly on resample.exe, but the TIF file type might be important...
    I just started with it do not a pro by any means but it's working good for me
     
    Last edited: 30 Dec 2015
    christopherbritton and Michael21 like this.
  3. caleb

    caleb

    Joined:
    4 Oct 2016
    Messages:
    105
    Country:
    us-florida
    I have a similar situation with my blendmask not having any effect. I was using my blendmask as a .bmp, and then tried @AndyCYXU's suggestion about saving it as a .tif, but then when I try to compile it with reasample.exe, reasample opens for a fraction of a second, and then closes. No BGL was made. I see this here: http://www.fsdeveloper.com/forum/threads/problem-to-create-blend-mask.433852/#post-708545, if this even has anything to do with it. I was using Photoshop, not GMIP. Does it have to do with the options I chose when I exported the .tif file? This is what I chose:

    upload_2017-9-13_19-56-28.png

    Will these options work?

    Thanks in advance.
     
  4. christopherbritton

    christopherbritton Resource contributor

    Joined:
    11 Aug 2012
    Messages:
    164
    Country:
    us-florida
    Do as Andy mentioned above. Be sure that your Blendmask is a flattened (no layers or transparency) grayscale Tiff file. I would recommend exporting it with Gimp, as that seems to be the best program for compiling Tiffs. Photoshop sometimes fails to export the headers correctly. (although normally this doesn't pose an issue)
     
  5. caleb

    caleb

    Joined:
    4 Oct 2016
    Messages:
    105
    Country:
    us-florida
    I was following this tutorial: https://www.flightsim.com/vbfs/showthread.php?250762-How-to-create-photoreal-scenery-for-FSX, but the only thing I did different was I was using Photoshop instead of GIMP. When I saw @AndyCYXU 's message, I exported it as a TIFF from Photoshop, but that did not work with resample. Then when I saw @christopherbritton 's message, I used GIMP to open the PSD I saved with Photoshop, and then exported my blendmask as a TIFF from GIMP. That worked with resample, but there still was no effect in the sim.

    Any other ideas on this?

    Thanks
     
  6. GaryGB

    GaryGB

    Joined:
    23 Dec 2005
    Messages:
    3,633
    Country:
    us-illinois
    Hi Caleb:

    Open the BGL output by SDK Resample in SDK TMFViewer, and let us know if it visible; if it is, you need to post here in this thread, your "multi-source" INF file that you used with SDK Resample for inspection / troubleshooting. :pushpin:



    If you prefer to proofread your work-flow first prior to posting the requested info, you may wish to review this thread ...and the linked tutorials it cites: :idea:

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


    BTW: For further future discussion related to this 'type' of specialized terrain-specific topic, assuming that you created this custom photoreal aerial imagery BGL via SBuilderX, IMHO, this would be more appropriately posted as a separate thread in the SBuilderX forum: ;)

    http://www.fsdeveloper.com/forum/forums/ground2k4-sbuilder-sbuilderx.33/


    ...and if instead, you manually created the INF and compiled without using the provided compile feature in SBuilderX, you may instead wish to post this in the FSX Terrain forum:

    http://www.fsdeveloper.com/forum/forums/fsx-terrain.77/


    GaryGB
     
    Last edited: 6 Oct 2017
  7. caleb

    caleb

    Joined:
    4 Oct 2016
    Messages:
    105
    Country:
    us-florida
    Hi GaryGB,

    Thanks for the info. This is what my scenery looks like in GIMP:

    upload_2017-9-18_13-22-44.png

    And this is what the BGL looks like in TMF viewer after I have compiled it:

    upload_2017-9-18_13-23-38.png

    Attached is my inf file as a TXT file since I can't upload INF files here.

    Thanks
     

    Attached Files:

  8. GaryGB

    GaryGB

    Joined:
    23 Dec 2005
    Messages:
    3,633
    Country:
    us-illinois
    Hi Caleb:

    Before you exported your Blend Mask as a TIFF, did you activate GIMP's 'Grayscale' mode ?

    That will convert the image into a 8-Bit gray-scale Blend Mask (which is much smaller than a 24-bit color image)

    https://docs.gimp.org/2.9/en/gimp-image-convert-grayscale.html


    Before you exported your Water Mask as a TIFF, did you activate GIMP's 'Indexed Colors' < Black + White mode ?

    That will convert the image into a 1-Bit Black + White Water Mask (and is very much smaller than a 24-bit color image)

    https://docs.gimp.org/en/gimp-tutorial-quickie-change-mode.html


    Pending your reply to those questions, I shall post more info in a reply here tomorrow (Tuesday) morning afternoon. ;)


    [EDITED]

    For this to 'work', you must first convert the Blend Mask and Water Mask as described above; then:


    You must copy the
    :

    * 8-Bit gray-scale Blend Mask to a new file name: "x10_area_blendmask_B.tif"

    * 1-Bit Black + White Water Mask to a new file name: "x10_area_watermask_W.tif"


    You must perform these edits on your own INF file:

    * Change [Source1] and [Source2] Type =TIFF

    * Edit Blend Mask to add a _B suffix

    * Edit Water Mask file names to add a _W suffix

    ...so that it reads:

    [Source]
    Type = MultiSource
    NumberOfSources = 3

    [Source1]
    Type = BMP
    Layer = Imagery
    SourceDir = "."
    SourceFile = "x10_area_original.bmp"
    Variation = January, February, March, April, May, June, July, August,

    September, October, November, December
    Channel_BlendMask = 2.0
    Channel_LandWaterMask = 3.0
    ulyMap = 26.7112669135158
    ulxMap = -80.6884002685547
    xDim = 2.68220901489329E-06
    yDim = 2.3961911301253E-06

    [Source2]
    Type = TIFF
    Layer = None
    SourceDir = "."
    SourceFile = "x10_area_blendmask_B.tif"
    SamplingMethod = Gaussian
    ulyMap = 26.7112669135158
    ulxMap = -80.6884002685547
    xDim = 2.68220901489329E-06
    yDim = 2.3961911301253E-06

    [Source3]
    Type = TIFF
    Layer = None
    SourceDir = "."
    SourceFile = "x10_area_watermask_W.tif"
    SamplingMethod = Gaussian
    ulyMap = 26.7112669135158
    ulxMap = -80.6884002685547
    xDim = 2.68220901489329E-06
    yDim = 2.3961911301253E-06


    [Destination]
    DestDir = "."
    DestBaseFileName = "x10_area"
    DestFileType = BGL
    LOD = Auto
    UseSourceDimensions = 1
    CompressionQuality = 100

    In ex: NotePad, remember to save as file type: All files (*.*) to allow saving with a *.INF (NOT *.TXT) file extension. :pushpin:


    Try this procedure in a manually-compiled session using FS / P3D SDK Resample; let me know how this works for you. :)

    [END_EDIT]

    GaryGB
     
    Last edited: 19 Sep 2017
  9. caleb

    caleb

    Joined:
    4 Oct 2016
    Messages:
    105
    Country:
    us-florida
    Thanks GaryGB. I have tested it and it has worked. But inverted. Everywhere I have drawn a blendmask I see my scenery, but everywhere I have not drawn a blendmask I see the underlying scenery.

    Any ideas on how to fix this?

    Thanks very much in advance.
     
  10. christopherbritton

    christopherbritton Resource contributor

    Joined:
    11 Aug 2012
    Messages:
    164
    Country:
    us-florida
    Caleb,
    Remember, in a blendmask: Black=Exclude and White=Visible. Depending on how your blendmask it set up, you may be able to invert the colors in Gimp/PS to easily fix the problem. More complex blends may yield an undesired result with this method though.



    I don't mean to take away from the OP, but just out of curiosity, is there any specific reason other than file size that you recommend a 1-Bit Indexed Tiff (watermask) over an 8-Bit Gray-scale, Gary?
    I have always used the latter.
     
  11. GaryGB

    GaryGB

    Joined:
    23 Dec 2005
    Messages:
    3,633
    Country:
    us-illinois
    Hi Chris:

    IIRC, the TIFF format was recommended in latter versions of SDK documents for FSX, ESP and P3D to minimize risk for problems with end users having various popular graphics applications output BMP and other image files (with- or without- Alpha channels) ...which were not compatible with SDK Resample. :scratchch


    However, I do adhere to the criteria of ACES' Terrain Lead Developer Adam Szofran and Luis Feliz-Tirado, cited in this interesting thread:

    http://www.fsdeveloper.com/forum/threads/resample-error.427351/


    Luis Feliz-Tirado, in a PTSIM forum thread, and in his subsequent "Make Photo-real Scenery" tutorial, also alluded to an option to use a higher "Bit-ness" color mask image provided specific RGB values are used for Blending and Masking.


    CAVEAT: Be aware that color Mask files / layers, and SDK Resample source / output file sizes are huge ! :alert:


    FYI: Maurizio Gigli of OzX (AussieX ?) and OrbX had an entire system for using color Masking as discussed in these threads:

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

    http://www.fsdeveloper.com/forum/threads/photoreal-ground-grass-everywhere.75338/

    http://www.fsdeveloper.com/forum/threads/are-blend-masks-working-properly-in-p3dv2.433786/

    http://www.fsdeveloper.com/forum/threads/resample-error.427351/


    http://aussiex.org/forum/index.php?...gl-program/&page=3&tab=comments#comment-17284


    Bearing in mind that one should not use a "NullValue" INF parameter value when a Blend Mask is being used in a multi-source INF, a 1-Bit Indexed (2) color B+W Land-Water Mask and a 8-Bit gray-scale Blend Mask ...are an effective means to implement source and compiled BGL size reduction without also having used:

    * LZW (non-lossy) source file compression in TIFF files, that can slow down a Resample compile session

    ...or:

    * SDK Resample PTC compression of the output BGL file, that can affect visual display quality at run time in FS


    Hope this helps with exploring options for implementing Masks with custom photo-real aerial imagery Land Class. :)

    GaryGB
     
    Last edited: 13 Oct 2017
  12. GaryGB

    GaryGB

    Joined:
    23 Dec 2005
    Messages:
    3,633
    Country:
    us-illinois
    Hi Caleb:

    Was the PS "Mask" layer an originally an all-white color Alpha channel in a TIFF, that was 'painted' over with pure Black (RGB 0,0,0) ? :scratchch

    GaryGB
     
    Last edited: 13 Oct 2017
  13. caleb

    caleb

    Joined:
    4 Oct 2016
    Messages:
    105
    Country:
    us-florida
    I had it in white, because the tutorial I was using said that it could be black or white. So when I changed the color to black it seemed as if there was a Blendmask over my entire scenery. In other words I couldn't see my scenery at all.

    So then I simply drew white over all the areas that I wanted to see, and it worked. Thanks very much everyone for your time and help.
     

Share This Page