Board index FlightGear Support Graphics

weird graphic bugs with "atmospheric light scattering"

Graphics issues like: bad framerates, weird colors, OpenGL errors etc. Bad graphics ar usually the result of bad graphics cards or drivers.
Forum rules
In order to help you, we need to know a lot of information. Make sure to include answers to at least the following questions in your initial post.

- what OS (Windows Xp/Vista, Mac etc.) are you running?
- what FlightGear version do you use?
- what graphics card do you have?
- does the problem occur with any aircraft, at any airport?
- is there any output printed to the console (black window)?
- copy&paste your commandline (tick the "Show commandline box on the last page of FGRun or the "Others" section on the Mac launcher).
- please upload a screenshot of the problem.

If you experience FlightGear crashes, please report a bug using the issue tracker (can be also used for feature requests).
To run FlightGear on old computers with bad OpenGL support, please take a look at this wiki article. If you are seeing corrupted/broken textures, please see this article.

Note: If you did not get a reponse, even after 7 days, you may want to check out the FlightGear mailing lists to ask your question there.

weird graphic bugs with "atmospheric light scattering"

Postby Curtis » Thu Oct 16, 2014 8:23 pm

I have just compiled and installed flightgear 3.2.0 from the official source code :

http://ftp.icm.edu.pl/packages/flightge ... .0.tar.bz2

and the official flightgear data base package :

http://ftp.icm.edu.pl/packages/flightge ... .0.tar.bz2

the datestamp of these source files are "october 2 2014",

I notice a lot of weird graphic bugs if "atmospheric light scattering" is used, for example VASI/PAPI lights are not showed correctly, they seem distorded :

Image

if I disable "atmospheric light scattering" I get a much better display of VASI/PAPI :

Image

I use archlinux 64 bits, ati radeon HD4650 pcie, cpu intel pentium dual core 3.33 Ghz, 4 Gb ram

and mesa 10.3.1

something seems wrong in flightgear 3.2.0 about this option "atmospheric light scattering",

I remember that in flightger 3.0 version this option works much better, lights were good
Curtis
 
Posts: 105
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: weird graphic bugs with "atmospheric light scattering"

Postby Philosopher » Thu Oct 16, 2014 8:41 pm

I think Thorsten just fixed it in Git (see the the commit and the mailing list message). I think we just need to ask him to bring it into the release branch as well ;).
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: weird graphic bugs with "atmospheric light scattering"

Postby Thorsten » Fri Oct 17, 2014 2:44 pm

But I don't have any confirmation that this is indeed a fix...

Curtis, could you verify whether changing

Code: Select all
float ray = clamp(pow(sin((sinphi-3.0) * (sinphi-3.0)),10.0),0.0,1.0);


(that's line 60 in Shaders/surface-light-lightfield.frag in the RC, I have renamed the file since...)

into

Code: Select all
float ray = clamp(pow(sin(mod((sinphi-3.0) * (sinphi-3.0),6.2832)),10.0),0.0,1.0);


actually gets rid of the problem for you? Thanks.
Thorsten
 
Posts: 10986
Joined: Mon Nov 02, 2009 8:33 am

Re: weird graphic bugs with "atmospheric light scattering"

Postby Curtis » Fri Oct 17, 2014 5:36 pm

Thorsten wrote in Fri Oct 17, 2014 2:44 pm:(that's line 60 in Shaders/surface-light-lightfield.frag in the RC, I have renamed the file since...)


I don't find the file "Shaders/surface-light-lightfield.frag" in the official source code of flightgear 3.2.0 :

http://ftp.icm.edu.pl/packages/flightge ... .0.tar.bz2

I'm not sure to understand when you said "RC", what means "RC" ? It's the name of a directory in the source code ?
Last edited by Curtis on Fri Oct 17, 2014 5:44 pm, edited 2 times in total.
Curtis
 
Posts: 105
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: weird graphic bugs with "atmospheric light scattering"

Postby Thorsten » Fri Oct 17, 2014 5:40 pm

Shaders are in FGData, not in the source code, you don't need to compile from source, you just edit them and they get compiled by the GPU driver.

RC means 'release candidate'.
Thorsten
 
Posts: 10986
Joined: Mon Nov 02, 2009 8:33 am

Re: weird graphic bugs with "atmospheric light scattering"

Postby Curtis » Fri Oct 17, 2014 5:44 pm

Ok , I will try,

My opinion is that a new version of flightgear 3.2.0 should be published quickly because the actual version is not really usable, and there is a huge bug related to KSFO ( the default airport for flightgear ) :

viewtopic.php?f=11&t=24318

unfortunately some linux distro has started to publish flightgear 3.2.0 binary based on this bad source code ( october 2 2014 ) :

https://www.archlinux.org/packages/comm ... lightgear/

it would be great if a new source code ( 3.2.1 for example ) can be provided with some bug fixes ( for "atmospheric light scattering" and the KSFO problem )
Curtis
 
Posts: 105
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: weird graphic bugs with "atmospheric light scattering"

Postby Curtis » Fri Oct 17, 2014 5:55 pm

Thorsten wrote in Fri Oct 17, 2014 2:44 pm:Curtis, could you verify whether changing

Code: Select all
float ray = clamp(pow(sin((sinphi-3.0) * (sinphi-3.0)),10.0),0.0,1.0);


(that's line 60 in Shaders/surface-light-lightfield.frag in the RC, I have renamed the file since...)

into

Code: Select all
float ray = clamp(pow(sin(mod((sinphi-3.0) * (sinphi-3.0),6.2832)),10.0),0.0,1.0);


actually gets rid of the problem for you? Thanks.


I did this change, it doesn't solve the problem :(
Curtis
 
Posts: 105
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: weird graphic bugs with "atmospheric light scattering"

Postby Curtis » Sat Oct 18, 2014 12:58 am

here are 2 screenshots, one with ALS enabled, and one with ALS disabled,

Image

Image

for me the rendering of lights is much better when ALS is disabled, we see much more details when ALS is disabled
Curtis
 
Posts: 105
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: weird graphic bugs with "atmospheric light scattering"

Postby MasteroftheSKIES » Sat Oct 18, 2014 1:23 am

To be honest, ALS would look more realistic if the lights were brighter.
I would use FSX but I use FlightGear because it's a project with goals.

Windows 7; Processor: 8 core 4 GHz; 8GB RAM; Graphics: NVIDIA GeForce GTX 770 (a pretty good graphics card if you're wondering)
MasteroftheSKIES
 
Posts: 216
Joined: Tue Oct 22, 2013 11:10 am
Version: 3.2
OS: Windows 7

Re: weird graphic bugs with "atmospheric light scattering"

Postby Thorsten » Sat Oct 18, 2014 6:40 am

To be honest, ALS would look more realistic if the lights were brighter.


I've had that discussion before, the short answer is: No, I don't think so, you're used to how bright they are in default (and perhaps how bright FSX makes lights), but in reality they're nowhere near as bright as you think based on your past FG experiences. They may look 'better' if brighter, but I am quite certain they're not more realistic.

I did this change, it doesn't solve the problem


Okay :-/ Please try what I asked Stefan to do on the mailing list


Edit

/Shaders/surface-lights-lightfield.frag line 64 which now reads

float intensity = clamp(ray * exp(-40.0 * r * r) + exp(-80.0*r*r),0.0,1.0) + 0.1 * fogEffect * (1.0-smoothstep(0.3, 0.6,r));

ray is the star-shaped structure, fogEffect is a halo type thing, and the exp(-80*r*r) is the central light disc intensity, and here they're mixed together.

What do you see if you comment out the line and replace it by

float intensity = clamp(exp(-80.0 * r * r),0.0,1.0);

I'm hoping that this would give you just discs then and proves that there's some fault with the above line, although I can't readily spot it.


If that does something and gets you back to disc lights, please continue with:


float ray = clamp(pow(sin((sinphi-3.0) * (sinphi-3.0)),10.0),0.0,1.0);

probably has some problem due to a driver idiosyncrasy... Mathematically, the expression should be fine. The sine of any real number falls between -1 and 1, and that taken to the 10th power results always in a number between 0 and 1, and there's even a clamp to deal with numerics... But - the function itself is rather spiky.

Could you try to deconstruct it outside in - first replace the power of 10 by something smaller (say 2), then removing the power (you still need to clamp then, because it gets negative...), then removing the outer sin() just to see if the issue goes away at some step and you can see the central light disc?
Thorsten
 
Posts: 10986
Joined: Mon Nov 02, 2009 8:33 am

Re: weird graphic bugs with "atmospheric light scattering"

Postby Thorsten » Sat Oct 18, 2014 6:47 am

My opinion is that a new version of flightgear 3.2.0 should be published quickly because the actual version is not really usable,


Well, we haven't released a 3.2 yet, have we? So there is no actual 3.2 version yet, there's just a release candidate 3.2 RC2 for testing purposes.

And the thing we're tracking here is how to circumvent an ATI driver peculiarity, no NVIDIA user has seen it so far. Which means that it can't be fixed without feedback from ATI users. Which means there is no bugfix yet, because you need to help me find it first. Which means you're partially setting the pace here... :-)

Btw. in 3.0, the lights didn't 'work' either, they just had a different problem - they were infinitely visible in fog. So we had to change that, which led us to hit this ATI thingy here...
Thorsten
 
Posts: 10986
Joined: Mon Nov 02, 2009 8:33 am

Re: weird graphic bugs with "atmospheric light scattering"

Postby Curtis » Sat Oct 18, 2014 2:37 pm

Thorsten wrote in Sat Oct 18, 2014 6:47 am:Well, we haven't released a 3.2 yet, have we? So there is no actual 3.2 version yet, there's just a release candidate 3.2 RC2 for testing purposes.


check the flightgear website, the 3.2 version has been released :

October 15, 2014: FlightGear 3.2.0 is released! Please enjoy the FlightGear v3.2 release announcement.


http://www.flightgear.org/

and some linux distros have already created a flightgear 3.2 binary :

https://www.archlinux.org/packages/comm ... lightgear/

so it's not normal to release the 3.2 version if some annoying bugs are still present ( "atmospheric light scattered", distorted lights for VASI/PAPI if the user has an ATI/AMD graphic card and a crash at startup for the KSFO airport ),

for me it seems urgent to remove the 3.2 release annoncement because of these bugs, and when these bugs will be really fixed you can post a 3.2.1 official version of flightgear( not a release candidate but a definitive version )
Curtis
 
Posts: 105
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: weird graphic bugs with "atmospheric light scattering"

Postby Curtis » Sat Oct 18, 2014 3:17 pm

it's much better if I replace this line in file /fgdata/Shaders/surface-light-lightfield.frag :

Code: Select all
float intensity = clamp(ray * exp(-40.0 * r * r) + exp(-80.0*r*r),0.0,1.0) + 0.1 * fogEffect * (1.0-smoothstep(0.3, 0.6,r));


by this :

Code: Select all
float intensity = clamp(exp(-80.0 * r * r),0.0,1.0);


and

Code: Select all
float ray = clamp(pow(sin((sinphi-3.0) * (sinphi-3.0)),10.0),0.0,1.0);


by

Code: Select all
float ray = clamp(pow(sin(mod((sinphi-3.0) * (sinphi-3.0),6.2832)),10.0),0.0,1.0);


here is the result with ALS "on" with these 2 modifications :

Image

and with "ALS" disabled :

Image

but the lights are still a little "weak" if ALS is enabled, it's not easy to fly the night with these weak lights, it would be great if these lights can be brighter when ALS is enabled
Curtis
 
Posts: 105
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Re: weird graphic bugs with "atmospheric light scattering"

Postby Thorsten » Sat Oct 18, 2014 4:44 pm

so it's not normal to release the 3.2 version if some annoying bugs are still present ( "atmospheric light scattered", distorted lights for VASI/PAPI if the user has an ATI/AMD graphic card


Please note that this isn't a FG bug as far as I know. The GLSL code is mathematically fine and according to official specs as far as I can see - just the ATI driver does weird things with it. So the actual problem is with the ATI driver, we're just trying to find a workaround here since we can't work on your driver easily.

Would you kindly read through what I wrote again and do the full program? You managed to check the preliminary condition that ray carries the problem, but you have to put ray back in in order to identify the actual operation that goes awry :-)

but the lights are still a little "weak" if ALS is enabled, it's not easy to fly the night with these weak lights, it would be great if these lights can be brighter when ALS is enabled


I think I answered to that already, but in case you missed this:

I've had that discussion before, the short answer is: No, I don't think so, you're used to how bright they are in default (and perhaps how bright FSX makes lights), but in reality they're nowhere near as bright as you think based on your past FG experiences. They may look 'better' if brighter, but I am quite certain they're not more realistic.


check the flightgear website, the 3.2 version has been released :
(...)
so it's not normal to release the 3.2 version if some annoying bugs are still present ( "atmospheric light scattered", distorted lights for VASI/PAPI if the user has an ATI/AMD graphic card and a crash at startup for the KSFO airport ),


You certainly got me there - no announcement on the mailing list, no questions whether we are good to go...

Well, we don't know whether the lights are problematic on all ATI cards for instance, might be just your specific driver version - has happened before. The thing that worked in the other instance doesn't for you, so it's difficult to see the picture. Likewise, many people start at KSFO just fine and FG doesn't crash.

The relevant change to the lights happened a few months back - the first problem report was 5 days ago, so hundreds of users using GIT and/or the release candidates haven't had or reported these problems, so... I'm not a miracle worker able to guess what the ATI driver does on a system where I can't test myself. But I guess you have your patch to make things work.
Thorsten
 
Posts: 10986
Joined: Mon Nov 02, 2009 8:33 am

Re: weird graphic bugs with "atmospheric light scattering"

Postby Curtis » Sat Oct 18, 2014 5:32 pm

Thorsten wrote in Sat Oct 18, 2014 4:44 pm:Likewise, many people start at KSFO just fine and FG doesn't crash.


are you sure that these people use the same fg-data package and the same version of flightgear ? ( datestamp : october 2 2014 )

the bug is easily reproducible on a linux distro, in my case it's : archlinux 64 bits,

I tried also to use the "libgl software mode" for mesa in order to run flightgear in "software mode for open GL" and I still have the crash at startup for KSFO,

another explanation is that the bug for KSFO is related to a bad version of fg-data package, a missing or corrupt file related to KSFO

I am not the only one who have this bug, so the resolution of this bug should be a priority because KSFO is the default airport for flightgear :

https://code.google.com/p/flightgear-bu ... il?id=1556


Would you kindly read through what I wrote again and do the full program? You managed to check the preliminary condition that ray carries the problem, but you have to put ray back in in order to identify the actual operation that goes awry


Ok but I am not an expert in openGL programming, I don't understand when you say "you have to put ray back in in order to identify the actual operation that goes awry" ?

I am just a user, what I am able to do is to replace one line by another in the source code
Curtis
 
Posts: 105
Joined: Wed Jun 17, 2009 3:09 pm
OS: archlinux 64 bits

Next

Return to Graphics

Who is online

Users browsing this forum: No registered users and 3 guests