Board index FlightGear Development Weather

A local weather system (v1.4 available)

Everything related to weather simulation, visuals should be discussed in the shader subforum.

Re: A local weather system (v1.02 available)

Postby Thorsten » Sat Apr 23, 2011 11:47 am

@VaLeo:

But, where is left wing and right flap?!


Must have misplaced them on takeoff...strange I didn't notice anything. :-)

Seriously - the plane shows fine on my screen, but since the FG internal screenshot function is broken when I use multithreading, I use the external screen capture to do shots when I have multithreading on, but that sometimes has graphics errors, part of which is that sometimes objects simply 'aren't there' in a strip - which is what you see here. Since it's not meant to show the plane but the weather pattern, I didn't bother to take another one.

@Zan:

I once made a contrail script that uses humidity and temperature to simulate different types of contrail, but problem was that FG's environmental model gives always 100% RH at high altitudes. I remember you had some kind of contrail thing, so do you have any ideas on how to estimate the real humidity on high altitudes?


Basically you have to retro-engineer it or guess it from the reported clouds. What FG does is take the measured value on the ground an extrapolate it upward - which gives you the condensation altitude of the lowest cloud layer, and then the extrapolation in a standard atmosphere would keep it 100% forever. Obviously in reality it drops below 100% at the upper edge of the layer, but reaches 100% again at the next layer - so the distribution of reported cloud layers gives you a rough indication of what is going on with humidity - but you can't really know or guess what the value is if it is not 100%, and even if there is potentially condensation, it doesn't guarantee that there really is condensation.

It's a fair guess that if you have Cirrus clouds you can have contrails. I'd also assume that if you are in a warmfront pattern, the upper air layers tend to be warmer and more moist - it's these kind of things which you can feed into a heuristics to give you some indication of what's plausible.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: A local weather system (v1.02 available)

Postby Thorsten » Mon Apr 25, 2011 12:58 pm

I've just tested a rather neat subsystem: It allows you to specify a target framerate and then adjusts the distance out to which clouds are displayed such that the framerate target is met. Since it compares 5 second averages of the framerate and allows for max. 10% change in visibility distance every 5 seconds, it's not prone to oscillations or instability. In other words, the visibility of clouds is dynamically decreased when the framerate gets low for whatever reason and increases again when spare performance is available.

Of course it can't work miracles - if you have a cloudless framerate of 25, specifying a target of 35 fps won't do you any good 8)
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: A local weather system (v1.02 available)

Postby someguy » Mon Apr 25, 2011 3:07 pm

Thorsten wrote in Mon Apr 25, 2011 12:58 pm:Of course it can't work miracles - if you have a cloudless framerate of 25, specifying a target of 35 fps won't do you any good

Hmph. Get back to work, then. No more gummi bears until you get it right! :)
User avatar
someguy
 
Posts: 1650
Joined: Tue Nov 25, 2008 6:54 am
Location: USA
Version: 2019.1.1
OS: Mac OS X 10.11.6

Re: A local weather system (v1.02 available)

Postby ot-666 » Mon Apr 25, 2011 5:15 pm

Sounds like a very nice feature. :)
A dynamic LOD like this would be nice for the scenery models too.
Callsign: ot-666
Working on LOWI and other stuff - Custom Scenery Overlay Repo: http://gitorious.org/fgfs-custom-scenery/custom-scenery-overlay/
VMX22 - Osprey... sometimes in 2014
ot-666
 
Posts: 746
Joined: Sun Nov 08, 2009 6:14 pm
Location: Germany, Konstanz
Callsign: ot-666
IRC name: ot666
Version: GIT
OS: win7 64bit

Re: A local weather system (v1.02 available)

Postby Chrison » Mon Apr 25, 2011 9:27 pm

Thorsten wrote in Mon Apr 25, 2011 12:58 pm:I've just tested a rather neat subsystem: It allows you to specify a target framerate and then adjusts the distance out to which clouds are displayed such that the framerate target is met.


FYI, this is kinda-sorta-but-not-really what X-Plane does to deal with low framerates. In X-Plane, if the framerate drops below a certain point (19 fps I think?), the application starts introducing "fog" to maintain the framerate. The "fog" will increase until you can't see any scenery at all, and then the framerate will start dropping again.

Just thought you might be interested in how other sims deal with it.

Regards,

Chris
"Even if you win the rat race, you're still a rat!" (Jackie Gleason)
My final approach announcement: "Seats up... Trays locked... Articles stowed... Seat belts on... And may God have mercy on your souls!"
Chrison
 
Posts: 431
Joined: Tue Mar 16, 2010 7:33 pm
Location: North America (Full-time RV'er)
Callsign: Chrison, AVA0066

Re: A local weather system (v1.02 available)

Postby curt » Mon Apr 25, 2011 10:48 pm

Hehe, I take credit for suggesting that idea to Austin @ X-Plane. But then I didn't really like it as much after he implemented it so I never tried to do the same thing in flightgear.
curt
Administrator
 
Posts: 1168
Joined: Thu Jan 01, 1970 1:00 am
Location: Minneapolis, MN

Re: A local weather system (v1.02 available)

Postby Thorsten » Tue Apr 26, 2011 7:43 am

Well, it has pros and cons. One of the things is that it shouldn't be an independent subsystem - it's fine as long as one control loop tries to maintain framerate by changing one thing. It has a lot of desaster potential if there are other control loops doing the same thing with different knobs - if you start dialling fog, cloud visibility and LOD ranges from three different control loops, all sorts of weird oscillations may happen which you don't really want.

So... it requires some thought in its application. I tested approaching KLSV (a rather detailed airport) with a framerate target of 25 fps yesterday in 4/8 coverage. Away from KLSV, the system can deliver 45 km of cloud visibility - but as you approach, it goes down to 20 km or so - this is very noticeable, in the final turn of the approach suddenly a lot of clouds disappear (though the framerate kept close to target). It's a matter of taste if that is more acceptable than a framerate of 15 fps or not. I for one wouldn't like to have sudden fog appear...

But basically it tries to emulate what I often do by hand - I usually start with moderate cloud visibilities to get a good framerate while all the airport models are around, and then once I've climbed out to cruise altitude (where I usually get a better framerate for various reasons) I increase the cloud visibility distance so that I can enjoy the view to the horizon.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: A local weather system (v1.02 available)

Postby curt » Tue Apr 26, 2011 1:14 pm

Thorsten, I think I clicked submit before finishing my thought there. For fog/visibility I like it less because I like to fly with METAR weather and this forces a divergence from the real conditions. For things like how dense the clouds are drawn or how far out they go, it actually seems like an interesting idea ... as long as the user can have control over the limits or turn the feature on/off easily. It may be that someone is doing a visualization or wants to capture an interesting screen shot, and cares more about how things look than how fast things are drawn.
curt
Administrator
 
Posts: 1168
Joined: Thu Jan 01, 1970 1:00 am
Location: Minneapolis, MN

Re: A local weather system (v1.02 available)

Postby Thorsten » Thu Apr 28, 2011 11:21 am

I've implemented two other interesting config options for the offline weather system

Previously, up to now, the scales of weather phenomena were hard-coded. For instance, the probability when in a 'High pressure core' tile that the next tile is something different was 0.2 - combined with a tile size of 40 km, this means on average ~200 km flight till a different airmass is reached. That's rather on the small end as far as scales of weather phenomena go, but it'd give you the chance to see change even on short flights. I've now a slider which allows to vary that between 0.05 and 0.2, corresponding to sizes between 200 and 800 km.

Likewise, each airmass typically has 4-8 different sets of cloud configurations - for instance, High pressure border has some with Altocumuli, some with diffuse layers and so on. From tile to tile, it was up to now random which cloud configuration was shown. I've now added a slider which allows to specify the probability that the last configuration is simply kept - if that it set to 1, as long as you are in the same airmass the cloud pattern will be essentially the same (position and distribution are still random, so it's not a literal repetition, but the theme is very similar). Again, under some conditions, that can produce a more relalistic outcome.

I've also toned down the altitude dependence of the visibility a bit - sometimes it actually is hazy even at 30.000 ft...

Thus, most of the development work I have currently in mind is done, and I expect to be able to release v1.1 some time next week when more tests have been done and the documentation is written. Once that is done, I'll update my system and start having a look at Stuart's work with making the default clouds available from Nasal.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: A local weather system (v1.1 available)

Postby Thorsten » Wed May 04, 2011 9:52 am

It's my pleasure to announce that Local Weather v1.1 is available. Compared with the last release v1.0, the package contains the following new features:

* complete redesign of the 'Low pressure border' airmass tiles with very nice Stratocumulus layers, some redesign of 'High pressure core' and 'High pressure' as well

* some work on reduced visibility when crossing cloud layers

* [GIT] work on cloud layers casting shade - was previously implemented for some layers, has been extended to more

* work on the Cumulus textures - lower edges are now more diffuse, unnaturally hard shades from the upper edges have been lessened, some work on the dark 'aura' pixels as well

* some work on the opacity of the Cb textures - while I am still not happy with the Cb textures for lack of a large choice of good pictures to work with, the result is now, I feel, a little better

* new options in the configuration menu: A control loop to link the view range with a target framerate, as well as control sliders for the size scale of weather patterns have been included

* [GIT] work on the model of thermals - when the cloudbase is reached, the visibility deteriorates

* menu properties are now xml initialized, i.e. the system now remembers your settings from the last session

* [GIT] support for a faster, hard-coded terrain presampling system by Torsten Dreyer

* minor bugfixes

Installation instructions:

* extract in FGRoot/

* [2.0.0] In order to create the menu entries, copy the relevant entries 'local-weather-xxx' from /gui/menubar.xml.alt into /gui/menubar.xml

* Important: insert the line <local-weather include="Environment/local-weather-defaults.xml"/> into /preferences.xml , otherwise the menu will not have initialized values, as this is no longer done from Nasal

* [GIT] If Local Weather has its own Nasal subdirectory in your FGData, move the files local_weather.nas, weather_tiles.nas, weather_tile_management.nas, weather_dynamics.nas and compat_layer.nas from Nasal/ into the Local Weather subdir

* add --prop:/environment/terrain/area[0]/enabled=1 to your commandline to use the hard-coded terrain presampler, otherwise you'll use the old default system
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: A local weather system (v1.1 available)

Postby Thorsten » Mon May 16, 2011 8:36 am

A direct performance comparison of overcast layers:

Lower scattered, higher overcast layer as received by METAR in the default clouds, 20 km cloud visible range, multithreading off, I get 16 fps and this:

Image

The same METAR, done by Local Weather 1.1, 30 km cloud visible range, multithreading still off, I get 20 fps and this:

Image

It's just not true that local weather would be generically slower...
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: A local weather system (v1.1 available)

Postby Thorsten » Thu Jun 09, 2011 12:16 pm

Thanks to Erik Hofman, we have now two new properties to control the skydome and terrain shader. I'm currently working on coding a model for the light penetration conditions in the atmosphere.

The first parameter, /rendering/scene/scattering controls the brightness of objects fading in the distance. If you look into this thread, Flightgear by default assumes that distant objects fade first to white, then to transparent, which this property fixes. I use it if I have denser cloud layers to reduce the amount of light reaching the ground, so that now distant objects fade to dark. Above the cloud layers, its value returns to unity.

This works well with overcast layers, but not perfect for 4/8 clouds or so. The reason is that the darkening has to be removed at high altitude, because then there's always a lot of light and object fade to white. So any mountain reaching above the cloud layers should never fade to dark. But if the fade brightness is changed on the ground, and restored at high altitude, in 4/8 clouds it is possible to watch the ground through the cloud layer - which appears darker when flying below the layer and brighter when flying just above.

The 'correct' solution to that would be individual cloud shadows - but we just can't do that at the moment.

The second parameter /rendering/scene/overcast allows to color the skydome in different degrees of haze without touching the forward visibility. This is very neat, as it allows to simulate diffuse high-altitude haze such as Cirrostratus which are very difficult to do with texture sheets, where the skydome is gradually restored to normal as one climbs above the clouds.

I've combined these two along with the high-altitude visibility into a 3d interpolated setup where each individual weater pattern has its own altitude variation of the parameters. The code as such is working fine, but parameters still need some tuning for best effect, and of course the METAR heuristics needs to be instructed to make use of them (i.e. taught to guess the amount of light reaching the surface given the reported cloud layers). I hope to be ready in time for the 2.4 release... also hopefully I'll be able to show some screenshots of results soon.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: A local weather system (v1.1 available)

Postby statto » Thu Jun 09, 2011 7:04 pm

As always, thank you for your work on this.
Custom Scenery available from http://www.stattosoftware.com/flightgear
statto
 
Posts: 2106
Joined: Fri Jan 25, 2008 10:57 pm

Re: A local weather system (v1.1 available)

Postby penta » Thu Jun 09, 2011 7:51 pm

I'm with statto...we will never thank you enough for what you are doing. You can feel the passion for what you are doing when I read your reports and I'm amazed every time I read something new in this thread!
penta
 
Posts: 238
Joined: Mon Dec 29, 2008 12:05 pm
Location: Parma-Italy
Version: Git
OS: Ubuntu Linux

Re: A local weather system (v1.1 available)

Postby someguy » Fri Jun 10, 2011 4:37 am

Tat's new git snapshot includes (as far as I can tell) local weather v1.1. If I specify METAR in the Mac launcher, all I need do is open local weather tiles and click clear/OK. I just finished a flight around KSFO that had clouds down to the water in places. I was following Dave Culp, and his B-17 kept fading in and out of view depending on the cloud density and my distance from him. Pretty cool stuff!
User avatar
someguy
 
Posts: 1650
Joined: Tue Nov 25, 2008 6:54 am
Location: USA
Version: 2019.1.1
OS: Mac OS X 10.11.6

PreviousNext

Return to Weather

Who is online

Users browsing this forum: No registered users and 1 guest