plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.

Please take a moment to read the platform’s guidelines before you get started!

question

HybridNZ avatar image
HybridNZ asked SpritelyNZ commented

Proper water exclusion and ocean transperant masking (water mask tools)

We need a way that is documented to add transparent maks to ocean water revealing the aerial ortho data but retaining the ocean water properties.

Currently using exclusion and placing other water polygons overlapping doesn't work with wind and waves but appears to be the only way this can be done. Its a bit of a hack and has many issues.

Could we please have clear documentation on how this is achieved using the same way asobo has done as St Barthélemy airport / island.


scenerydefaultdevmodedocumentation
10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

FlyingRaccoon avatar image
FlyingRaccoon answered

Hello HybridNZ,

You should be able to achieve this result by:
- defining an exclusion polygon to remove the water body and reaveal the underlying aerial
- add a custom water polygon on top of that

This way you can have the water effect with the imagery in transparency.

Does this answer your question?

Regards,
Sylvain


10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

HybridNZ avatar image
HybridNZ answered SpritelyNZ edited

Hi,

Ive tried what you said exactly and in many different configurations and it doesn't work unfortunately as below.

untitled.jpg


untitled.jpg (1.8 MiB)
4 comments
10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Ok I see what you mean. I was trying on a smaller area and my water polygon was not fully opaque. I'll keep investigating but I don't think we can find an easy workaround using the polygon system and would need an improvement of the CGL asset type to be able to do this.
0 Likes 0 ·
HybridNZ avatar image HybridNZ FlyingRaccoon ♦♦ ·

Thanks Sylvian for giving a tiny bit more insight in the SDK Q&A. It probably confirms that an airport such as St Barthélemy / island is using some outside of the editor method to achieve water/ocean transparency.

Side note, you carried yourself very well in the Dev Q & A and I really enjoyed your feedback during the session to provide another perspective to some of the answers.

Keep up the good work team.

Cheers

Josh
NZA Simulations.

2 Likes 2 ·
Hi Josh and thank you for the kind comment.

Glad you enjoyed the Q&A session and I hope we can keep providing useful information to you that way.

Regards,
Sylvain

1 Like 1 ·
Show more comments
Paavo avatar image
Paavo answered Paavo edited

Water polys seem broken and the approach suggested by FlyingRaccoon does not work.

Here's an example based on EEKU. There's an excessive sand bar a few kilometers north-east of the airfield (N58.156329 E24.02775):

sandbar-1.jpg


If I simply attempt to cover it with water, then it introduces an artifact (as expected, because overlapping water polys are not allowed):

sandbar-2.jpg


If I try to use the previously described method of exclusion + custom water on top, then exclusion works as expected:

sandbar-3.jpg


However, it's back to the start when I try to add water on top of it:

sandbar-4.jpg


And I cannot add second water poly either to force water, because overlapping water polys are not allowed and cause artifacts:

sandbar-5.jpg


So how can I cover the sand bar with water?

It looks like stock terrain is taken into account when summing polygons for the final water value (render or no render, as described in the SDK), which breaks third-party customization.

I believe this is a bug. Stock water polygons under excluded areas should not be included in the final water value, because otherwise we cannot add custom water polys over excluded areas.

In any case, this point system seems too complex. It would be much better if we could just use absolute exclusion polys that always remove water, and absolute water polys that always add them, with overlapping allowed for both types.



sandbar-1.jpg (55.2 KiB)
sandbar-2.jpg (140.9 KiB)
sandbar-3.jpg (152.2 KiB)
sandbar-4.jpg (108.2 KiB)
sandbar-5.jpg (144.2 KiB)
2 comments
10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

In this case, just add a water polygon over the sand bar and use a different water type.
It doesn't cause the artifact and the shader applied is the same as on the surrounding water

1623420954309.png

0 Likes 0 ·
1623420954309.png (2.6 MiB)
Paavo avatar image Paavo FlyingRaccoon ♦♦ ·

My situation was a bit more difficult: the goal was to replace all water around the island (and within) with custom polys derived from LIDAR data.

Initially my approach was:
- Exclude all types of water in work area.
- Add new water with WASTE_WATER (rarely used in stock terrain → low risk of artifacts).

This worked, but caused loss of waves.

Using your tip about water polys keeping their type, I modified the approach:
- Exclude water only in land mass.
- Add new water with WASTE_WATER.

This uses many complex polygons and feels hacky, but works.
Can I use it? Do you see anything wrong with it?

0 Likes 0 ·
kcai avatar image
kcai answered Pasha commented

Since Asobo can not fix all water mask around the world in a short time. Why not open this possibility for DEV. Please.

5 comments
10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Improving the CGL system to support this kind of edition is tricky and is a long term objective.
0 Likes 0 ·
Paavo avatar image Paavo FlyingRaccoon ♦♦ ·

Even something as simple as an additional water type limited to 50% transparency (eg SHALLOW_WATER) would be a huge step forward. We could draw such water polys over shallow waters to show the underlying aerial imagery.

1 Like 1 ·
Pasha avatar image Pasha FlyingRaccoon ♦♦ ·
If I may ask, how Asobo devs currently create water masking? I'm not asking for tutorial/step-by-step lesson, it's more like a general idea of how this actually works. I've searched inside SDK there are no effective way to do that. Even if that means creating mask via multiple lines of program, I'm sure there are devs out there that can create and provide external tools
0 Likes 0 ·
For now, we are using dedicated tools to edit georeferenced data and that applies to water masks. This data is then uploaded to Azure and streamed to your game. Obviously, that's not something we can include as is in the SDK and the terraforming and polygon tools in the scenery editor are workarounds to allow you to perform some edition but with limited capabilities compared to what's possible with the raw data.

But as @Paavo suggested, we are checking how we can improve the current system so that you can realize more complex editions.

4 Likes 4 ·
Show more comments
Pasha avatar image
Pasha answered SpritelyNZ commented

One of the way to do it is creating thin stripes of water polygon, but the problem is the reflected light is like zebra pattern (following strip size). It really helps when we can create transparent water from inside SDK, just like Asobo did with official water masks. I found out that water masking was done via CGL, further confirmed by a post somewhere I found in past (using older file will enable water masking in release build) but currently haven't had the knowledge on how to decompile CGLs

3 comments
10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

This was in the original problem statement as the hack way to do it but doesn't work properly with other sim variables.
Keen to see your results on the old post.
While we wait for official documentation/support on this issue.

0 Likes 0 ·
Actually it wasn't my result, just me found out someone said they successfully reverting the removed water mask that Asobo shown in trailer. I'm also waiting for official support
0 Likes 0 ·
There's a tool over on fsdeveloper.com called bgldec as it can decompile cgls for msfs now. Sorry I don't have the link but shouldn't be hard to find.
0 Likes 0 ·
soakco avatar image
soakco answered FlyingRaccoon commented

Hello,

Has there been any update to this? Water masking is a major feature that us Devs would love to have!

1 comment
10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Hello


No update yet and don't expect one soon. This kind of feature might seem simple but it has a lot of technical implications that will take time to solve.

In the meantime, It seems there's no ideas posted about that particular feature. You should create one so that people can upvote it.
Be sure it'll be taken into account when trying to prioritize the development of the upcoming features.

Regards,
Sylvain

1 Like 1 ·
rotornut44 avatar image
rotornut44 answered HybridNZ commented

Took the initiative to add this as an idea so that it could be voted on. You can find that here:

https://devsupport.flightsimulator.com/idea/1563/proper-water-masking.html

10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.