Jump to content
Sign in to follow this  
LuisFelizTirado

Custom ground textures: Null Value - Blend Mask

Recommended Posts

Some interesting results when creating photo-real ground textures. The source image has areas painted pure white as a Null Value. This means that they would be transparent and display the underlying default ground textures:http://forums.avsim.net/user_files/175467.jpgAnd here is the associated Blend Mask that gradually fades the custom ground out to the default textures:http://forums.avsim.net/user_files/175468.jpgIn the Blend Mask, of course, pure white is completely opaque and pure black is completely transparent. When compiled, this is the result:http://forums.avsim.net/user_files/175469.jpgThe transparent part of the Blend Mask over the Null Value in the source image has created a black border in the custom texture. By changing the area in the source file that is painted pure white to some other color:http://forums.avsim.net/user_files/175470.jpgthe Null Value is no longer active and the resulting ground textures appear normally:http://forums.avsim.net/user_files/175471.jpgAs expected, the source image is gradually blended out to pure transparency. What happens with other colors? For example, making the transparent (pure black) part of the Blend Mask opaque (pure white) on the crazy theory that then the Null Value in the source image would dominate:http://forums.avsim.net/user_files/175472.jpgThis gives an even stranger result in the custom ground:http://forums.avsim.net/user_files/175473.jpgNo idea why, but it seems that a Blend Mask and a Null Value do not go together very well, at least when the Null Value is white. I have not tested all possible variants of colors. Blend Masks will always be either white or black and gradations in between, so there is not really much to change there. And most people will use either white or black as a Null Value for reasons of convenience. So, I cannot come to any definite conclusions. Still, we could imagine that if using a Blend Mask, we should avoid Null Values in the source image, that is, let the Blend Mask handle the transparency instead of the Null Value. Best regards. Luis

Share this post


Link to post
Share on other sites

I've not had good luck with null values. I think the blend is better method anyway for imagery. Not so sure about other resample types. What file types are you using for the channel data? Note that the example in the SDK deals with a 5 channel tiff format, and the NullValue is used for the blend mask, not the color channels:; This treats all pixels with a zero in the blend mask as if it were missing.; This can result in better compression ratios (i.e. smaller .BGL files) if much of the image ; is fully transparent.NullValue = ,,,,0 scott s..

Share this post


Link to post
Share on other sites
Guest luissa

Hi Luis,You are using Blend Mask = Black in the parts where the Master Image = Null Value.Did you tried Blend Mask = White in the parts where the Master Image = Null Value? Reasoning: in parts where Master Image = Null Value the default landclass will show in the first place (if no blend is applied). Then you could make Blend Mask = White so that the blend does not change that part.This is just a hope!Luis

Share this post


Link to post
Share on other sites

Hello Luis,This is what I found:(Blend Mask = Black) + (Null Value = White) = Black(Blend Mask = White) + (Null Value = White) = RedI have not tried a Null Value of Black, or any other color for the Null Value.Scott, I have been using NullValue since the beginning of testing and have never had any problems. It works as expected. Now, I have started to use Blend Masks because Luis' SBuilderX makes it so simple, and that is when I found the problem with the interaction.Best regards.Luis

Share this post


Link to post
Share on other sites

Hi Luis,Just as Scott mentioned I never had trouble with using both a blend channel and a null value. But if I remember correctly my images has black as null color, so that might be a difference.At first I had some trouble that my blend channel was used as alpha channel (and thus became water), but once I configured that correctly it worked fine.


Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites

More testing and here is the result:(Blend Mask = Black) + (Null Value = Black) = Black(Blend Mask = White) + (Null Value = Black) = RedSo, it would not seem to be a problem with the color of the Null Value, but rather that a Blend Mask over a Null Value causes problems.Best regards.Luis

Share this post


Link to post
Share on other sites
Guest luissa

Hi LuisSo this problem is not completly understood ... Returning to your first post you have 3 pictures that show the result in the sim (3rd, 5th and 7th). The central part corresponds to 100% of the photo image (blend mask is white). Then, to the right and left, you have a blend mask that is gray. In this part I would expect the result to be a mix of the photo image (color as in the 1st picture) and of the landclass texture which is also color. Instead I see mix between the photo image and what seems to be a black white (?!) picture. It looks like the blend mask was mixed with the source image. Any ideas?Luis S

Share this post


Link to post
Share on other sites

Very sorry, Luis, for the confusion. Those are TMFViewer images, so they do not reflect the display in game. In FS X, everything displays as expected with custom and default textures blended together and a surrounding band that is either black or red.Best regards.Luis

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...