Board index FlightGear Development Scenery

Why do my water always looks so greenish

Questions and discussion about enhancing and populating the FlightGear world.

Re: Why do my water always looks so greenish

Postby erik » Sat May 08, 2021 2:58 pm

A quick reply: I'll have to go soon.
The ocean_depth_1.png was the original colored version converted to grey-alpha.
It had the depth in the alpha channel and the ocean color in thr rgb channels.

Erik
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2244
Joined: Thu Nov 01, 2007 2:41 pm

Re: Why do my water always looks so greenish

Postby vnts » Sat May 08, 2021 3:48 pm

Changes redone on top of the recent update: [Zip of changes v2]. This version reads the r channel of the depth texture, like the current fragment shader.
erik wrote in Sat May 08, 2021 2:58 pm:A quick reply: I'll have to go soon.
The ocean_depth_1.png was the original colored version converted to grey-alpha.
It had the depth in the alpha channel and the ocean color in thr rgb channels.

Slightly confused by why the grey+alpha (2 channel) depth texture is necessary?

The shader reads floor colour from an RGB texture (globe_depth.jpg). The shader reads depth from the r channel of the current grey+alpha texture (ocean_depth_1.png), while ignoring the information in the a channel (vec4 topoTexel = texture2D(topo_map, TopoUV); topoTexel.a = topoTexel.r; and then topoTexel.a is used everywhere ignoring the a channel.). Near ENBR on old nightly vs current: img.

Kind regards
vnts
 
Posts: 409
Joined: Thu Apr 02, 2015 1:29 am

Re: Why do my water always looks so greenish

Postby erik » Sun May 09, 2021 1:32 pm

vnts wrote in Sat May 08, 2021 3:48 pm:Slightly confused by why the grey+alpha (2 channel) depth texture is necessary?

The shader reads floor colour from an RGB texture (globe_depth.jpg). The shader reads depth from the r channel of the current grey+alpha texture (ocean_depth_1.png), while ignoring the information in the a channel (vec4 topoTexel = texture2D(topo_map, TopoUV); topoTexel.a = topoTexel.r; and then topoTexel.a is used everywhere ignoring the a channel.). Near ENBR on old nightly vs current: img.

Kind regards


You are right, I've now updated the gray channel to be all black and white (it's necessary since The Gimp can't write alpha only images) and adopted the shader to use alpha only.

Erik
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2244
Joined: Thu Nov 01, 2007 2:41 pm

Re: Why do my water always looks so greenish

Postby vnts » Sun May 09, 2021 4:38 pm

erik wrote in Sun May 09, 2021 1:32 pm:it's necessary since The Gimp can't write alpha only images) and adopted the shader to use alpha only.

Which version of GIMP are you using? I'm using 2.10.

It worked fine for me. In 2.10 at least, there's an easy trick work with layers - just drag a layer, colour channel, or named channel to the little bit in the top left corner [1] under the file menu. I simly use File > export as then change the extension to jpg to export (works fine?). Channels are extracted into 1 greyscale layer. From there they can be exported as PNG (compression 9) or JPG (Some settings to save space: Thumbnail off, Optimize on, Progressive encoding. Advanced: Smoothing: off, DCT:floating point, Subsampling 4:4:4 (doesn't matter)).

It also looked like the data you had in the channels was simple - compared to the GEBCO update in August 2020. Did you do any additions to the depth map since the GEBCO update?

The Aug 2020 GEBCO update 8192x4096: PNG 24 MB JPG: 99%: 6MB, 98%: 5.2MB, 97%: 4.7, 96%: 4.2MB, 95% 3.8MB.

I resized the 21600x10800 GEBCO image to 16364x8192, after converting from indexed to greyscale in GIMP. I used lancos3 method in GIMP 2.8 (2.10 doesn't have it) as it seems recommended for downasmpling (1]). However the image data is in some logarithmic form, so these interpolations aren't really appropriate.

The PNG was 23.2 MB and JPG's ranged from 99%: 17.7MB to 95: 11.1MB. If file sizes aren't a concern, it should be possible to include a 16364x8192 depth texture in a higher water quality settings technique (e.g. create a very high quality water shader setting).

Zip of the 8192x4096 image from FG, and the resized 16364x8192 image with PNG and JPGs: link

Kind regards
vnts
 
Posts: 409
Joined: Thu Apr 02, 2015 1:29 am

Re: Why do my water always looks so greenish

Postby erik » Sun May 09, 2021 5:15 pm

I'm starting to get enough of this. Evey improvement result in a degradation somewhere else or a complaint that it could be so much better. Maybe I'll start working on it in about half a year. maybe not.
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2244
Joined: Thu Nov 01, 2007 2:41 pm

Re: Why do my water always looks so greenish

Postby vnts » Sun May 09, 2021 5:43 pm

You should be able to just use the PNG or JPG files I provided and it should 'just work' with issues fixed. As for merspeiler doing an orthophoto and water comparison using an under-construction feature on the mailinglist, it's just part of the orthophoto and WS2 thing [1][2], don't take notice.

Kind regards
vnts
 
Posts: 409
Joined: Thu Apr 02, 2015 1:29 am

Re: Why do my water always looks so greenish

Postby wlbragg » Sun May 09, 2021 7:03 pm

Sorry, I forgot to update. I rebuild with current next and all is well, thanks.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7586
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Why do my water always looks so greenish

Postby merspieler » Sun May 09, 2021 7:46 pm

vnts wrote in Sun May 09, 2021 5:43 pm:You should be able to just use the PNG or JPG files I provided and it should 'just work' with issues fixed. As for merspeiler doing an orthophoto and water comparison using an under-construction feature on the mailinglist, it's just part of the orthophoto and WS2 thing [1][2], don't take notice.

Kind regards


Um... that had nothing to do with this... It was an idea, which I had on my mind already for a while so I've proposed it... and then I've just noticed that it "works"...
Obviously that "works" is a bug.... but in this case, the bug is the feature!

Never meant to discourage anyone.
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2241
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: Why do my water always looks so greenish

Postby benih » Sun May 09, 2021 9:10 pm

vnts wrote in Fri May 07, 2021 4:28 pm:The lake at 47.72N, 11.73E Benih mentioned which had a water colour similar to this 2/3 of the time:
Image

Quick override (only roughly the colour above):
Image


I like it and that particular looks closer to what i can see here
User avatar
benih
 
Posts: 1688
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit

Re: Why do my water always looks so greenish

Postby erik » Mon May 10, 2021 8:01 am

vnts wrote in Sun May 09, 2021 5:43 pm:You should be able to just use the PNG or JPG files I provided and it should 'just work' with issues fixed.

Ehm, no. The deepest party of the ocean is almost 9km. The resolution of the PNG images is 65536 possible values per channel. Resulting in a step change of more than 7 meters per value. Which means you know sea-level, and you know 7 meters deep, but nothing inbetween. In reality anything deeper than 7 meters is not relevant for ocean floor coloring.

The current image has a resolution of 25cm per value change around the shorelines.

Erik
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2244
Joined: Thu Nov 01, 2007 2:41 pm

Re: Why do my water always looks so greenish

Postby Johan G » Mon May 10, 2021 9:04 am

erik wrote in Mon May 10, 2021 8:01 am:The deepest party of the ocean is almost 9km. The resolution of the PNG images is 65536 possible values per channel. Resulting in a step change of more than 7 meters per value. Which means you know sea-level, and you know 7 meters deep, but nothing inbetween. In reality anything deeper than 7 meters is not relevant for ocean floor coloring.

Good point Erik. Not a diver, but it seems very few recreational divers go below 60 meters, yet many use underwater flashlights. There really is no need to try model light reflected from 9 km depth.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6629
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: Why do my water always looks so greenish

Postby erik » Mon May 10, 2021 10:58 am

Okay, i've spent another six hours at improving the depth and color maps and that will be the last for quite some time.
I've also pushed the materials inland water coloring effect support version 2.0.

Erik
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2244
Joined: Thu Nov 01, 2007 2:41 pm

Re: Why do my water always looks so greenish

Postby vnts » Mon May 10, 2021 2:18 pm

Thanks for merging the regional definitions extension : ). I will have a look when I get back.
erik wrote in Mon May 10, 2021 8:01 am:The resolution of the PNG images is 65536 possible values per channel.

Oops I seemed to have saved the 8192 png as 16-bit somehow, but the jpg ones were normal, and the 16384 png/jpg weren't affected. I probably misclicked.

I was aware that the source data was 8-bit (and also FG wouldn't use 16 bit textures), which is why I pointed out above that the images were in logarithmic format , so resizing was not accurate (doesn't matter because all FG needs is a measure of shallowness, and the texture filtering on the GPU happens in linear space anyway).
benih wrote in Sun May 09, 2021 9:10 pm:I like it and that particular looks closer to what i can see here

The overrides for the screenshot were quickly tweaked to match the example you showed, as a demo - it changes a lot depending on altitude/angle, and whether the sun is ahead or behind you. You can tweak the water of the lake through regional definitions text files to give a better match to what you experience, as it is your home lake. https://wiki.flightgear.org/Howto:Regio ... trol_files

(I will add a version of the following general info to the wiki later, but the same things are valid for anyone wanting to change watrebodies in their area):

For specific water bodies you can create a data/Materials/regions/germany-local-waterbodies.xml file for clarity - or maybe an alps-local-water-bodies file if you remember colours from other lakes in a part of alps or around your home. This file can be in the list in Materials/regions/materials.xml after xml file for the most specific region - in this case there's nothing for alps/germany currently so it should be europe.xml. Entries that occur further down override entries further up for that location/landclass. A reason the lakes around there are a bit blue might be that the mountains are part of the Northern Limestone Alps that the wiki page talks about [1].

When tweaking weather conditions in sim should be the same as what you remember (e.g. colour of water in blue sky, or overcast conditions, time of day, whether the sun was ahead or behind you) and the view angle should also probably match (if it's from a low angle, try a lower angle, if it's while flying try from higher altitude). If it's green-blue one colour 2/3rds of the time and bluer 1/3rd of the time, you could choose something in-between that's slightly more towards blue as a compromise? Once you've found the exact colour you should write it down in a comment in the xml file, <!-- Germany, name of lake, WS3 colours comment -->, for use when WS3 arrives :) . For WS2 the colours could be made darker or desaturated by putting them into in GIMP or a color picker and fiddling with saturation/intensity, so the lack of a transition doesn't get noticed (it blends in with the scenery, and/or the focus is on the plane/scenery if there are parts that look odd - this lake). Reloading materials and then reloading scenery will show changes to the materials file.

The controls are:
<use_specified_water_shallowness type="int">0</use_specified_water_shallowness> <!-- 0 or 1-->
<water_shallowness type="float">1.0</water_shallowness> <!-- floating point 0 to 1-->
<use_specified_floor_color type="int">0</use_specified_floor_color> <!-- 0 or 1-->
<floor_color type="vec3d">0.1608 0.2588 0.1765</floor_color> <!-- RGB 0 to 1, not 0-255 -->

A starting value might be the colour from the ortho screenshot, or around RGB=0.130, 0.381, 0.315.
The landclasses are listed in Materials/regions/global-summer.xml, and the landclass(es) you want are likely in this block (can also ctrl+alt+click in ufo to check what a waterbody belongs to). You should also confirm/set the colour of rivers in the area, and check they don't noticeably clash when they meet the lake:
<effect>Effects/water-inland</effect>
<name>Lake</name>
<name>Pond</name>
<name>Reservoir</name>
<name>Lagoon</name>
<name>Estuary</name>
<name>Watercourse</name>
<name>Saline</name>

Kind regards
vnts
 
Posts: 409
Joined: Thu Apr 02, 2015 1:29 am

Re: Why do my water always looks so greenish

Postby benih » Mon May 10, 2021 7:00 pm

Hm, now the lake is way too black....

Image
Image

I want to give this a shot, but i'm overwhelmed by all those files etc.
In this specific case, where should i look?

EDIT more specific: i see all the xml files, and want to start adding the separate file you mentioned - but i don't know what to enter there. Can you maybe share the code for the demo you mentioned?
User avatar
benih
 
Posts: 1688
Joined: Tue Aug 15, 2017 10:34 am
Callsign: D-EBHX
Version: next
OS: Debian Linux 64bit

Re: Why do my water always looks so greenish

Postby erik » Tue May 11, 2021 10:34 am

It turned out that the lakes layer was misaligned. This is now fixed.

Erik
Current: Parachutist, Paraglider, Pterosaur, Pilatus PC-9M and variants, ERCO Ercoupe, Fokker Dr.1, Fokker 50, Fokker 100
Less active: Cessna T-37, T-38, Santa Claus. Previous: General Dynamics F-16. Worked on: Wright Flyer
erik
 
Posts: 2244
Joined: Thu Nov 01, 2007 2:41 pm

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 3 guests