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

FWTools - transparency?

Discussion in 'Terrain Design General' started by JRobinson, 16 Nov 2010.

  1. JRobinson

    JRobinson

    Joined:
    30 Aug 2007
    Messages:
    1,356
    Country:
    unitedstates
    Hello gents, I hope I'm not intruding but I've been following along here and trying to get one of these geotifs into FS9 myself. The problem I'm having is that my reprojected tiff always comes out partially transparent. It seems to work fine as far as processing it through resample.exe goes and I think it's laying the tiles down where they're supposed to be as the roads seem to match up pretty well with my UT roads but it looks awful in the sim obviously.

    the tif before reprojection:

    [​IMG]


    and after:

    [​IMG]

    Here's the command I used:
    Code:
    gdalwarp -of GTiff -co "INTERLEAVE=PIXEL" -t_srs "+proj=latlong +datum=WGS84" -r cubic "%remote%\doi1m2009_44116h1sw_usda.tif" "%remote%\kmyl_photo.tif"
    Any ideas?

    Thanks,
    Jim
     
  2. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,114
    Country:
    netherlands
    Hi Jim,

    That looks weird, seems like some channels got messed up or so. Does the input geotiff you use have any additional channels, like an alpha channel?

    I haven't seen before that transparency was added when it was not there in the original source.

    The "INTERLEAVE=PIXEL" option might be another area to look. It is required to make a GeoTIFF that the FSX resample can process. But since you are working for FS2004 you might not need this option. I am not sure if PhotoShop can get confused by this different way to store the information. Might be worth a try.
     
  3. rhumbaflappy

    rhumbaflappy Moderator Staff Member Resource contributor

    Joined:
    2 Jun 2004
    Messages:
    3,028
    Country:
    us-wisconsin
    I don't know how you got a geotiff to compile into an FS9 format... that would require a resample from FS9 or earlier, and that resample doesn't support the tiff format.

    Dick
     
  4. JRobinson

    JRobinson

    Joined:
    30 Aug 2007
    Messages:
    1,356
    Country:
    unitedstates
    Thanks Arno, yes this particular .tif does have an alpha channel, this is the first I've played with these so I thought that was normal. I'll fiddle with it and remove the alpha in PS and try it again. I never thought about it but I'm sure thats where the problem lies.

    Dick, I did a watermask on the reprojected .tif and saved it as a .tga before I ran resample on it in this particular case. Now that you mention it I did try once to run resample.exe on the .tif and found it didn't work. I thought it was something wrong with my .inf at the time, so I'm glad you cleared that up for me.

    I'll let you know how it works after I remove the alpha and try again.

    Thanks,
    Jim
     
  5. rhumbaflappy

    rhumbaflappy Moderator Staff Member Resource contributor

    Joined:
    2 Jun 2004
    Messages:
    3,028
    Country:
    us-wisconsin
    Hi Jim.

    For FS9's resample, I'd convert the tiff to 24-bit BMP... and you can give the bitmap the alpha channel to control the water.

    You need the NSEW lat's and long's for the INF file, and compute the cell dimensions.

    Dick
     
  6. JRobinson

    JRobinson

    Joined:
    30 Aug 2007
    Messages:
    1,356
    Country:
    unitedstates
    Hey, it works!

    Yep, that's what the problem was, I killed the alpha channel, stuck the geodata back in and reprojected it and the transparency is gone now. BTW Dick, I caught your thread on the Metrix color matching filter, thanks a million, that's a lifesaver. I used Metrix on this geotif and matched it to the GEPro textures I'm using. My landclass is a little off where it matches up with the photoscenery but you can see part of a "cool irrigated cropland" tile just off the end of the runway in the first shot which matches up with the photoscenery pretty well. This was just a quick test since I got home from work, I think it could be improved a lot with some fiddling.



    [​IMG]


    [​IMG]



    I guess I just assumed since maps2bgl used .tga's that's what I was supposed to use. I guess the niagra.bmp sample in the terrain SDK should have been a dead giveaway :) . That's actually what I did, but since I did the water mask I saved it as a 32 bit .bmp in PS and just opened it up in Imagetool to convert it to .tga. An unnessary step as it turns out. :cool:

    On the cell dimensions I actually did up a spreadsheet a while back that apparently works (now that I've got the reprojection to WGS84 figured out) judging by the way the photo roads & water line up with their Ultimate Terrain counterparts. I've been messing with this for days actually on and off, I didn't understand the reprojection thing and I kept placing pushpins in google earth for lat & lon and cropping the .tif where the pushpins were and then recording the coords in the .inf. I tried a bunch of GIS apps and didn't have any luck with those either. What a mess. Don't read the instructions Jim, whatever you do. I must have tried 20 times but I couldn't get those friggin roads to line up no matter what I did :) . My .tif was NAD83 projected. I got tired of the math during that comedy of errors so I made the spreadsheet. I've attached it in case anyone wants to use it, apparently it works?

    Thanks for the help guys,
    Jim
     

    Attached Files:

Share This Page