Board index FlightGear Development Effects and shaders

Sun brilliance

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

Sun brilliance

Postby Thorsten » Tue Aug 25, 2015 9:39 am

Discovering the nice way Stellarium Night Sky renders the sun (especially without atmosphere) I thought this is a texture worth copying over to FG and making the Sun appear more brilliant at high altitude.

Looks rather prominent from Space, not so much from the ground even at noon, and fades away as the Sun disc changes color while it sets.

Image
Image
Image

Needs a SG patch to work, I guess I need tor each Durk for that.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Sun brilliance

Postby CaptB » Tue Aug 25, 2015 10:42 am

This looks really good, I like it a lot more than the present one.
Ongoing projects(3D modelling): A320, MD-11, A350, B767
FG767: https://fg767.wordpress.com/
CaptB
 
Posts: 685
Joined: Thu May 23, 2013 7:36 pm
Callsign: EKCH_AP
IRC name: CaptB
Version: next
OS: Xubuntu

Re: Sun brilliance

Postby erik » Tue Aug 25, 2015 3:16 pm

Thorsten wrote in Tue Aug 25, 2015 9:39 am:Looks rather prominent from Space, not so much from the ground even at noon, and fades away as the Sun disc changes color while it sets.

Image


Note that the ring around the sun in this picture is created by a lens. You wouldn't see it without a camera.
At one point (I think around 2.0) I've added quite a brilliant sun texture but due time it has been replaced with some rather dull blob we have now

Update: I've been able to resurrect it: http://www.adalin.com/ehtw.info/html/images/halo.png

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: Sun brilliance

Postby Thorsten » Tue Aug 25, 2015 5:22 pm

Note that the ring around the sun in this picture is created by a lens. You wouldn't see it without a camera.


Agreed.

Thing is, it doesn't help much to decide what we should render.

What you actually see looking into the sun is... complicated. Part of it is simply oversaturation of the light-sensitive cells in the eye - which is what fades immediate brightness and creates dark after-images later as the cells aren't ready to receive light for a while. Part of it is deviation from logarithmic Weber-Fechner intensity perception - actual light intensity isn't perceived on the typical log scale. Part of it is color de-saturation of the scene surrounding the glare - color contrasts seem to go away to some degree. Part of it is spikes/rays generate in the lens of the eye.

Admittedly I can't render most of that - largely because the screen simply doesn't produce anything like the real intensity and will never blind you.

So, having said all that - I think the lens think looks more similar to the impression I have looking into the sun than what we have now, despite of it not being actually correct. I'd say it is less wrong perhaps.

Also, the way it's implemented, it's supposed to represent a degree of blinding glare. I understand the wide halo in the current implementation is supposed to represent Mie, so it's not simply a replacement of an existing texture, it's a fourth component to the Sun disc rendering. And you can give it a texture you consider more appropriate for the physiology of the eye if you have one. Maybe there's one which is even less wrong. Your halo.png looks fairly promising as well - so I'll give that a try.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Sun brilliance

Postby LesterBoffo » Tue Aug 25, 2015 8:52 pm

Wings Over Flanders Fields have recently upped their sun effects and shaders.

Image

Although it's really nice I think it's a bit overdone.
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: Sun brilliance

Postby MIG29pilot » Tue Aug 25, 2015 9:41 pm

What about human eye effects?
User avatar
MIG29pilot
 
Posts: 1465
Joined: Tue May 19, 2015 5:03 pm
Location: 6 feet under Snow
Callsign: MIG29pilot
Version: 2020.1.3
OS: Windows 10

Re: Sun brilliance

Postby Thorsten » Wed Aug 26, 2015 6:04 am

What about human eye effects?



What you actually see looking into the sun is... complicated. Part of it is simply oversaturation of the light-sensitive cells in the eye - which is what fades immediate brightness and creates dark after-images later as the cells aren't ready to receive light for a while. Part of it is deviation from logarithmic Weber-Fechner intensity perception - actual light intensity isn't perceived on the typical log scale. Part of it is color de-saturation of the scene surrounding the glare - color contrasts seem to go away to some degree. Part of it is spikes/rays generate in the lens of the eye.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Sun brilliance

Postby erik » Wed Aug 26, 2015 8:17 am

LesterBoffo wrote in Tue Aug 25, 2015 8:52 pm:Wings Over Flanders Fields have recently upped their sun effects and shaders.

Although it's really nice I think it's a bit overdone.


Agreed, the red spots to the left of the sun glare are, again, lens effects and won't be visible without a camera.

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: Sun brilliance

Postby bugman » Wed Aug 26, 2015 8:38 am

Camera lens effects would be great for a dedicated 'camera' external view - they would make for interesting promotional videos with flybys, for example - but inside the cockpit they should most definitely be off as they are not realistic and not what you'd ever see.

Regards,

Edward
bugman
Moderator
 
Posts: 1808
Joined: Thu Mar 19, 2015 10:01 am
Version: next

Re: Sun brilliance

Postby tigert » Thu Aug 27, 2015 6:59 am

bugman wrote in Wed Aug 26, 2015 8:38 am:Camera lens effects would be great for a dedicated 'camera' external view - they would make for interesting promotional videos with flybys, for example - but inside the cockpit they should most definitely be off as they are not realistic and not what you'd ever see.


What is "real"? It's complicated, I think.

If you are an aviation enthusiast like most of us likely are, you might also be watching a lot of aviation videos, and this might be how your brain thinks "reality" looks like, with lens flares and all. Many of us have not been in small aircraft cockpits themselves. Thus something that looks like the videos could trigger a stronger feeling of "being there" than a more "realistic" rendering, even though it is "wrong".
Also, when the sun is glaring like that, you are likely wearing sunglasses which can also cause flares.
And the aircraft windows have tiny scratches and grooves that can make the glare more intense. Sometimes to a crazy degree if you have an older aircraft that has a worn out glass from all the years of dirty rugs used to clean the bugs from the windshield.

I think simulation is like directing theatre or a movie: It's about the illusion: smoke and mirrors to create something that your brain thinks is real. Now, we have a fairly "serious" goal of recreating a realistic world scenario, so we cannot go all crazy, and we have to start from the physics and how the world works, but a little bit of help for the brain here and there does not hurt, if it leads us to the right direction.
tigert
 
Posts: 106
Joined: Sat Nov 08, 2014 10:57 am

Re: Sun brilliance

Postby Thorsten » Thu Aug 27, 2015 7:36 am

And the aircraft windows have tiny scratches and grooves that can make the glare more intense. Sometimes to a crazy degree if you have an older aircraft that has a worn out glass from all the years of dirty rugs used to clean the bugs from the windshield.


Let's keep these apart.

Mie forward scattering on haze or glass scratches is a genuine physics effect - it's there, and ALS has the shader to take it into account properly (if you have a scratched windshield, or frost on it, and you use the ALS glass effect to look into the sun, you won't see a thing because of the glare - likewise clouds and haze get a Mie correction, the low atmosphere illuminated by the sun shows a white-out).

What we do not have is a simulation of the complete physiology of perception - how the eye generates spikes around intense lights, how they deplete the retina pigment and leave after-images, how the pupils adapt to light.

So we may get artistic on the physiology part, but not on the physics part.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Sun brilliance

Postby gluon » Sat Aug 29, 2015 8:09 am

My 2¢ since I'm the person who has coded the current sun code and created the textures:

The outer halo is indeed supposed to represent Mie scattering. Its alpha-channel gets decreased while the suns angle increases, so that it's not visible at noon. Which is an approximation of what you see in reality, since you don't have such a wide glare when the sun is high. The amount of scattering is less, because the light travels through a shorter stretch of the atmosphere when the sun is at the zenith.

Since the introduction of shaders and especially ALS I've wondered if the Mie scattering could be better done with a shader that covers a wider area and doesn't create the visible "ring" at the end of the texture. Ideally it would be a soft transition.
Also, the sun is created with multiple textures which were necessary for simulating the changing color gradient of the 'halo' at sunrise. This could probably also be done more elegantly with a shader nowadays.

I agree with Erik about the Lens flare/artefacts in the textures. As I remember back when I introduced the current implementation it was discusses to add a similar effect on the devel-list (there's a OpenGL function for this). The idea was generally objected back then because the rings and rays are the product of the lens and aperture of a camera and hence do not represent what the human eye sees (and which is what a simulator should represent).
gluon
 
Posts: 68
Joined: Tue Aug 18, 2009 8:43 am

Re: Sun brilliance

Postby Johan G » Sat Aug 29, 2015 10:55 am

gluon wrote in Sat Aug 29, 2015 8:09 am:Since the introduction of shaders and especially ALS I've wondered if the Mie scattering could be better done with a shader that covers a wider area and doesn't create the visible "ring" at the end of the texture. Ideally it would be a soft transition.
Also, the sun is created with multiple textures which were necessary for simulating the changing color gradient of the 'halo' at sunrise. This could probably also be done more elegantly with a shader nowadays.

I though the Mie scattering around the sun was implemented in ALS; it looks very good.

Regarding how it looks I always was a bit frustrated about that halo and considered that too much of artistic freedoms were taken in that respect, in particular at dawn and sunset until I actually saw it with my own eyes and reflected about it a bit. My opinion about that changed that very minute. I have to say that halo is close enough to reality for FlightGear to impress me. :D
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: Sun brilliance

Postby MIG29pilot » Sat Aug 29, 2015 6:02 pm

gluon wrote in Sat Aug 29, 2015 8:09 am:My 2¢ since I'm the person who has coded the current sun code and created the textures:



Oh stop quarking barking your two cents' worth! :wink: :)
User avatar
MIG29pilot
 
Posts: 1465
Joined: Tue May 19, 2015 5:03 pm
Location: 6 feet under Snow
Callsign: MIG29pilot
Version: 2020.1.3
OS: Windows 10

Re: Sun brilliance

Postby jarl.arntzen » Fri Sep 04, 2015 2:17 pm

Hi, all.
I'm happy to present a new set of sun textures that, in my very humble opinion, look more reasonable and takes into account light effects occurring inside the eye ("intra-ocular") as well as atmospheric effects. The effects are not based on accurate physics but mimics my impression and observations of the glaring sun:
  1. sun.png
    Feathered the edge of the sun to make it look a lot less sharp and defined. There is rarely, if ever a sharply defined outer boundary that's actually observable by the naked eye.
  2. inner_halo.png
    Intra-ocular: Effects occurring inside of the eye. Tried to replicate the effect of glare occuring in the eye. The display size of this texture could easily benefit from being increased to 3x the sun diameter to give more leeway for trying out various glare sizes.
  3. outer_halo.png
    Atmospheric: The outer halo primarily appears at shallow angles during sunrise or sunset and I've here tried to represent both intra-ocular scattering (rays) combined with atmospheric scattering. Maybe it's a little on the artistic side, but I think it looks nice.


The textures are based on my own observations of briefly glancing directly into the sun at various times of the day and through various cloud cover.
GIMP:
inner_halo.png, outer_halo.png and sun.png,
all made in Gimp using
Filters --> Light and shadow --> Supernova... among various other techniques.

To further improve the sun appearance, both inside and outside the atmosphere, I think a possible way forward may be to have 3 separate sets of atmospheric effect textures, 3 sets of intra-ocular effect textures and possibly some effect to represent the residual after-image experienced after looking directly into the sun.

Try it out by extracting the zip inside Textures/Sky
https://www.dropbox.com/s/hbipea1wpjw9s9d/Textures-Sky.zip?dl=0

Edit: Added sunrise image without rays.
Kinda hard to balance.
Image

Image
Image
Image
Image
Last edited by jarl.arntzen on Fri Sep 04, 2015 6:08 pm, edited 1 time in total.
Frequent Flyer. Occasional Lander.
jarl.arntzen
 
Posts: 106
Joined: Thu Jan 03, 2013 10:43 pm
IRC name: Jarl Arntzen
Version: 2017.1.1
OS: Ubuntu 14.04

Next

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 2 guests