Board index FlightGear Development Weather

Something to look at during night flights...

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

Something to look at during night flights...

Postby Thorsten » Mon Aug 10, 2015 7:17 pm

You're going to love seeing this dynamically - pics can't really convey the impression properly. Each flash lasts a split second and is possibly followed by a second one immediately, then it starts somewhere else on the front, all illuminate part of the surrounding clouds, and then all fades back into darkness... This looks way cool in actual motion.

Image

Image
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Something to look at during night flights...

Postby LesterBoffo » Mon Aug 10, 2015 7:23 pm

So I'm taking it this is for night time thunderstorms? Since most lightning is cloud to cloud this is a good fix. Too bad it wasn't included with 3.4
User avatar
LesterBoffo
 
Posts: 2171
Joined: Sun Oct 02, 2011 5:02 pm
Location: Oregon, USA
Callsign: LesBof
Version: 2018.3.2
OS: Win10 Pro

Re: Something to look at during night flights...

Postby gsagostinho » Mon Aug 10, 2015 10:17 pm

LesterBoffo wrote in Mon Aug 10, 2015 7:23 pm:Too bad it wasn't included with 3.4

I think you meant 3.6. Well, it's a pity, but then again we already have a nice feature for 3.8 ;)

@Thorsten Looks really cool indeed! I will check it in the sim :)
User avatar
gsagostinho
 
Posts: 1806
Joined: Thu Jan 15, 2015 7:27 pm
Location: London, UK

Re: Something to look at during night flights...

Postby Thorsten » Tue Aug 11, 2015 9:51 am

Image

Anyone up to making a decent set of lightning textures? The one we have in the repository is *cough* not optimal.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Something to look at during night flights...

Postby tigert » Tue Aug 11, 2015 11:28 am

How about generating textures with a L-system fractal? I am not sure if it makes sense to do this at runtime, but maybe we could make reasonable textures this way? http://drilian.com/2009/02/25/lightning-bolts/

This page seems to explain the different "stages" of the lightning strike: http://hyperphysics.phy-astr.gsu.edu/hb ... igseq.html - it might look more realistic if there were a few frames with roughly the same path but slight alterations in the more detailed shape of the bolts?

//Tuomas
tigert
 
Posts: 106
Joined: Sat Nov 08, 2014 10:57 am

Re: Something to look at during night flights...

Postby gsagostinho » Tue Aug 11, 2015 12:33 pm

@Thorsten I will give it a shot :) By the way, where is the location of the current image in the repository? I did a git pull right now but I can't find it.

@tigert Well, I wouldn't bother with fractals to be honest since generating them in real-time would be superfluous in my opinion. Then it's up to the person creating the texture how he wants to create, the only point is to select a good looking texture regardless of the technique employed in the creation.
User avatar
gsagostinho
 
Posts: 1806
Joined: Thu Jan 15, 2015 7:27 pm
Location: London, UK

Re: Something to look at during night flights...

Postby Johan G » Tue Aug 11, 2015 1:52 pm

tigert wrote in Tue Aug 11, 2015 11:28 am:... it might look more realistic if there were a few frames with roughly the same path but slight alterations in the more detailed shape of the bolts?

gsagostinho wrote in Tue Aug 11, 2015 12:33 pm:@tigert Well, I wouldn't bother with fractals to be honest since generating them in real-time would be superfluous in my opinion.

Also I doubt most people have frame rates enough to see all the components of the lightening strike over time, perhaps with the exception of more extreme thunderstorms. :wink:
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: Something to look at during night flights...

Postby legoboyvdlp » Tue Aug 11, 2015 2:38 pm

Is this in 3.7 and latest fgdata? Will it be soon? Cant wait!
Cmon thunderstorms pay me a visit to my town
User avatar
legoboyvdlp
 
Posts: 7981
Joined: Sat Jul 26, 2014 2:28 am
Location: Northern Ireland
Callsign: G-LEGO
Version: next
OS: Windows 10 HP

Re: Something to look at during night flights...

Postby Thorsten » Tue Aug 11, 2015 4:03 pm

Should be on next (i.e. 3.7) now.

By the way, where is the location of the current image in the repository? I did a git pull right now but I can't find it.


Models/Weather/lightning.rgb

It's been there for a long, long time...

My current plan of attack is to have several *.ac models (rects with a texture) stacked in the *.xml file and use select animations to show only one of them - some higher resolution would be nice...

How about generating textures with a L-system fractal?


Cool from a math POV, but probably easier to just extract from real-life imagery or simply draw by hand.

Note that the lightning bolt registers as a non-zero value of /environment/lightning/flash - and in the same subdir, you get the relative position of the event to the current eye point. If a clever aircraft modeler knows the speed of sound, he can use that to time an event for a thunder ambience sound... I'm just saying...
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Something to look at during night flights...

Postby Thorsten » Tue Aug 11, 2015 6:52 pm

Some more to enjoy ;-)

Image

Image
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Something to look at during night flights...

Postby Johan G » Wed Aug 12, 2015 5:27 am

Thorsten wrote in Tue Aug 11, 2015 4:03 pm:Should be on next (i.e. 3.7) now.

gsagostinho wrote in Tue Aug 11, 2015 12:33 pm:By the way, where is the location of the current image in the repository? I did a git pull right now but I can't find it.


Models/Weather/lightning.rgb

It's been there for a long, long time...

My current plan of attack is to have several *.ac models (rects with a texture) stacked in the *.xml file and use select animations to show only one of them - some higher resolution would be nice...

A decent resource seem to be NOAA's photo library. A Google image search for "lightening site:photolib.noaa.gov" might yield some inspiration. Note that most of those images, though probably not all, are public domain. Unfortunately many of them seem to have been taken with filters.
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: Something to look at during night flights...

Postby gsagostinho » Wed Aug 12, 2015 11:43 am

@Thorsten in your pictures above it seems you are using lightning.rgb, but we already have two much better looking lightnings in fgdata: in the same directory, look for lightning01.rgb and lightning02.rgb. Did you try using them? If so, can you tell me what is wrong with them so I can try to improve them?

Sorry but I am away for these next weeks and it's has been difficult to find time to do anything related to FG, so it may take a while for me to try to create a new texture for this :(
User avatar
gsagostinho
 
Posts: 1806
Joined: Thu Jan 15, 2015 7:27 pm
Location: London, UK

Re: Something to look at during night flights...

Postby Thorsten » Wed Aug 12, 2015 2:37 pm

in the same directory, look for lightning01.rgb and lightning02.rgb


Thanks for pointing me to my own work :-) If you look at the timestamp, they're a few hours old (and if you look at the commit message, you'll find that I found Johan's NOAA link very helpful).

There's nothing wrong with them - but there could still be more and better varieties.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Something to look at during night flights...

Postby LesterBoffo » Wed Aug 12, 2015 6:03 pm

what would be an optimal images size in pixels for the quad, 256X512 ? and would it be easier on frame rates with a .png versus .rgb?
User avatar
LesterBoffo
 
Posts: 2171
Joined: Sun Oct 02, 2011 5:02 pm
Location: Oregon, USA
Callsign: LesBof
Version: 2018.3.2
OS: Win10 Pro

Re: Something to look at during night flights...

Postby Thorsten » Wed Aug 12, 2015 6:27 pm

what would be an optimal images size in pixels for the quad, 256X512 ? and would it be easier on frame rates with a .png versus .rgb?


Cloud texture sheets containing multiple clouds are typically 1024x1024, so 512xsomething seems quite enough, all else is probably an overkill. For weather we always use *.rgb textures because they load faster - once loaded into GPU memory, there is no framerate difference, but weather cycles a lot of stuff in and out of GPU memory.

The textures are extracted from the images, completely de-saturated and then using the light curves to get the background to black onto which color to alpha is used. A slight halo around the bolt can actually remain and looks cool, but the edges of the sheet need to go to full transparency, so I used eraser around.

The bluish color is added later procedurally.

Here's one of the new textures in action:

Image

(I guess it's really one of the things you need to see in action to fully appreciate... pictures really don't do the impression justice)
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Next

Return to Weather

Who is online

Users browsing this forum: No registered users and 4 guests