Board index FlightGear Development Effects and shaders

Atmospheric scattering, with terrain shader preview

An exciting "new" option in FlightGear, that includes reflections, lightmaps, the particle system etc.. A lot is yet to be discovered/implemented!

Re: Atmospheric scattering

Postby Zan » Mon Mar 14, 2011 5:39 pm

Yeah I know. And it is relatively easy to change skydome and terrain, but to do all objects too, that's the hardest part. That's why this effect should be toggleable (and default to off?) so that solutions can be searched while nothing really changes :)
Zan
 
Posts: 123
Joined: Tue Oct 20, 2009 11:28 am

Re: Atmospheric scattering

Postby Zan » Mon Mar 14, 2011 9:14 pm

I got the fixed function version sort of working again, so now the shader is toggleable.

I uploaded all necessary patches and other files if someone is willing to test it. Note that it still is not ready, so do it on a different branch or something :)

Patches, the one for simgear is necessary. Flightgear patch only changes clear color from fog color to black (space looks better ;)
http://users.tkk.fi/~lapelto2/fgfs/scatter/scatter-simgear.patch
http://users.tkk.fi/~lapelto2/fgfs/scatter/scatter-flightgear.patch

Effect file:
http://users.tkk.fi/~lapelto2/fgfs/scatter/skydome.eff

Shaders:
http://users.tkk.fi/~lapelto2/fgfs/scatter/skydome.vert
http://users.tkk.fi/~lapelto2/fgfs/scatter/skydome.frag

And the command line to run it:
Code: Select all
fgfs --prop:/sim/rendering/mie=0.003 --prop:/sim/rendering/rayleigh=0.0003 --prop:/sim/rendering/dome-density=0.5 --prop:/sim/rendering/scattering-shader=1


I exposed the variables to control the scattering so that one can play around with them and see the effect. I found those above to look pretty nice (screenshots in my previous post).

I don't know, but in the non shader version sunset and sunrise effects seem to be 90 degrees off. Was it like that before or did I break something? I tried everything to fix it but the glitch still exists...

Cheers, Zan
Zan
 
Posts: 123
Joined: Tue Oct 20, 2009 11:28 am

Re: Atmospheric scattering, patch available

Postby ASTON » Mon Mar 14, 2011 11:13 pm

Thanks Zan, but! Where do i need to put the simgear and flightgear patches ? in /Data?
BTW i'm running FG on a mac, do i need the CVS flightgear version to run the patch ?
Cheers!
ASTON
 
Posts: 12
Joined: Mon Sep 20, 2010 5:05 pm
Location: LFSR - FR
Callsign: GB-586
OS: MAC OS X

Re: Atmospheric scattering, patch available

Postby Zan » Tue Mar 15, 2011 10:48 am

You need the latest development (GIT) source code where you apply the patches. Then you must compile both etc... If you're not familiar with that, then you must wait until/if the patch gets to GIT and then grab a proper Hudson built version...

Zan
Zan
 
Posts: 123
Joined: Tue Oct 20, 2009 11:28 am

Re: Atmospheric scattering, patch available

Postby ASTON » Tue Mar 15, 2011 2:48 pm

Zan wrote in Tue Mar 15, 2011 10:48 am: If you're not familiar with that, then you must wait until/if the patch gets to GIT and then grab a proper Hudson built version...

Zan



That's what i going to do! :lol: 8)
But great job Zan, thanks alot!
ASTON
 
Posts: 12
Joined: Mon Sep 20, 2010 5:05 pm
Location: LFSR - FR
Callsign: GB-586
OS: MAC OS X

Re: Atmospheric scattering, patch available

Postby rafa23189 » Sun Apr 03, 2011 5:38 pm

Is it goind to be included in FG 2.2?
rafa23189
 
Posts: 79
Joined: Tue Jan 26, 2010 11:51 pm

Re: Atmospheric scattering, patch available

Postby Zan » Tue Apr 05, 2011 9:06 pm

Rafa, depends a bit. Only few persons have tested it yet, and I'm not sure if it has bugs... And I don't know when 2.2 is going to be released.

To other things, vitos requested patch to block all objects from loading so that the visibility could be increased and terrain loading would work better. So here is a simple one which blocks all shared and static objects, runway signs and random lights from loading:
http://users.tkk.fi/~lapelto2/fgfs/simgear_noobjload.diff

It should apply fine against latest git, with either
Code: Select all
patch -p0 < simgear_noobjload.diff

or
Code: Select all
patch -p1 < simgear_noobjload.diff


One should first try with
Code: Select all
patch -p? --dry-run < blah.diff
to make sure it will apply fine.

Cheers, Zan
Zan
 
Posts: 123
Joined: Tue Oct 20, 2009 11:28 am

Re: Atmospheric scattering, patch available

Postby Zan » Tue Apr 19, 2011 10:57 am

The shader and patches are now in git, since last saturday. Please feel free to test it and report if you find some oddities.

Zan
Zan
 
Posts: 123
Joined: Tue Oct 20, 2009 11:28 am

Re: Atmospheric scattering, patch available

Postby longfly » Tue Apr 19, 2011 11:50 am

Great, really good work, Zan!

Only two things:

- Is it in the FG-core in Git (I only have to update my Git-FG)
- or is there an extra direction, so I have to download it and copy it into my FG?

and the second:

can you please post some nice screenshots, would be verry nice!

Thanks a lot and keep up this wonderful work!

Longfly
User avatar
longfly
 
Posts: 228
Joined: Tue Dec 07, 2010 5:41 pm
Location: EDDM (Germany)
Version: always new

Re: Atmospheric scattering, patch available

Postby Gijs » Tue Apr 19, 2011 12:17 pm

It's in Git since last week. You do have to update both data and source though.
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Atmospheric scattering, patch available

Postby Zan » Tue Apr 19, 2011 1:10 pm

I think the latest hudson build should have the required patches, for windows it's here: http://flightgear.simpits.org:8080/job/Win32-installer/. And like Gijs said, you also need GIT data.

I can post some screenshots maybe tonight or later when I get home and have time (I'm trying to finish my master's thesis at the moment, which takes about all my free time :-)

Zan
Zan
 
Posts: 123
Joined: Tue Oct 20, 2009 11:28 am

Re: Atmospheric scattering, patch available

Postby longfly » Tue Apr 19, 2011 2:07 pm

Ok, thank you!

And good luck with your master, Zan!

Longfly
User avatar
longfly
 
Posts: 228
Joined: Tue Dec 07, 2010 5:41 pm
Location: EDDM (Germany)
Version: always new

Re: Atmospheric scattering, patch available

Postby Sealbhach » Wed Apr 20, 2011 12:49 am

Zan wrote in Tue Apr 19, 2011 10:57 am:The shader and patches are now in git, since last saturday. Please feel free to test it and report if you find some oddities.

Zan


OK, I found this, a black sky when there's fog. The metar and weather settings are in the image, just click on it to enlarge. Otherwise, it works fine, when I've set it to Fair Weather or whatever. I've experimented a little with the visibility settings, and the problem is somewhere between 800m and 1200m, as far as I can tell.

Image

I have also done a video. This is around Catalina Island, with the weather set to Fair, so visibily would be 18 kilometres or so. The sunset is outrageously beautiful. There seems to be a problem with the way the sea looks though. Also, I'm not so sure that green colour in the sky opposite the sunset is realistic. Have a look, hope it helps:



.
Sealbhach
 
Posts: 934
Joined: Wed Jun 30, 2010 10:17 am

Re: Atmospheric scattering, patch available

Postby Zan » Wed Apr 20, 2011 12:46 pm

The funny looking sea color is because the terrain fog is not calculated the same way as the fog in the scattering shader. And another problem is that the tiles are not visible far enough, so you will see some weird (too yellow) colors which normally would be hidden by earth.

I will investigate the black sky thing, it might have something to do with the clear color now being black.

I also try to weak the parameters to make it possible to produce even more colors for different weather conditions.

Zan

Edit: Tried to tweak some parameters for the sunset/sunrise effect:
Image
Image
Zan
 
Posts: 123
Joined: Tue Oct 20, 2009 11:28 am

Re: Atmospheric scattering, patch available

Postby Sealbhach » Thu Apr 21, 2011 5:15 am

Beautiful. I've done another video. This effect can really make some beautiful scenes.



.
Sealbhach
 
Posts: 934
Joined: Wed Jun 30, 2010 10:17 am

PreviousNext

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 2 guests