Rayleigh scattering at sunset/sunrise

Started by
5 comments, last by alvaro 10 months, 2 weeks ago

Hi

I've been studying Rayleigh scattering for my engine. I have some post process that works okay and is fairly quick but I’m trying to understand something. They say that we get red/orange/yellow light at sunrise/sunset because light from the sun has further to travel through the atmosphere at those times during the day and violet, blue and green are mostly lost leaving those orangey hues.

This makes sense but I was looking at a particularly beautiful sunset the other evening and I noticed something odd that doesn’t fit with this theory. if you face the sun, it looks orange at the horizon, but if you turn 180 degrees and fade away from the sun, the sky at the horizon is still blue. Light has to travel even further to light up those areas of the sky so how come they aren’t orange too, or at least as orange?

Advertisement

The light that comes to you from the 180° direction is almost entirely because of Raleigh scattering. It's not necessarily coming from very far.

@alvaro would you mind explaining a bit further? I understand that if you’re experiencing a sunset and you look directly up, the sky is still blue (even though the light that is hitting that part of the atmosphere is travelling further than the light that is making the sunset orange, but that’s because the light above you hasn’t gone through as thick a part of the atmosphere as the sunset light.

But if, as you say, the ‘back’ of the sky (in relation to the sunset part of the sky), is lit by Rayleigh scattering, surely the light that is lighting it has to travel further than the sunset light, therefore losing more blue?

I think what you are missing is that the blue photons are not lost because they are absorbed: They are lost because they bounce around in random directions. Many of them are still there, but they don't get to your eyes directly from the sun. Instead, some are lost to space, some hit the ground, and some eventually make it to your eyes after several scatterings. Those can come to your eyes from any direction, including from opposite direction to where the sun is.

I've been trying to get my head around this. In my mind, the further light travels through the atmosphere, the more the smaller wavelength light gets scattered away. If the light that is hitting your eye when you're facing the sun is mostly orange/red because most of the blue light has been scattered away because the light has had to travel further through the atmosphere, I can't see why blue light would make it even further than that past you and on the opposite side of the sky. The only way my mind can see it is that the blue light from the opposite side of the sky must be coming in from light that has travelled above you, i.e. in a less dense path through the atmosphere, scattering less blue. If you consider this crude diagram:

I'm coming at this from a Rayleigh scattering shader, so the yellow dot is the point where the (white) light enters the atmosphere, the pink dot is the viewer and the white dot is the point in the sky that is the exact opposite side of the sky from the sun. I get that the path of light from yellow to pink goes through a longer and denser part of the atmosphere, which means it scatters blue, then green, then orange, red, etc, producing the red sunset. But what about the white dot? If you're using integrals, you have to take the light through the densest part of the atmosphere and even further to get to the opposite side of the atmosphere. In reality, I assume the light comes in from the scattered path of the red dots, i.e. through the least dense part of the atmosphere, but how is this computed in shader terms?

Or am I completely missing something? I think I confused ChatGPT to the point where it kept flipping between thinking the white dot is a shorter path through the atmosphere than the yellow dot, to thinking it's the farthest.

Think of only blue light. It scatters like crazy. This means that it will bend many times as it passes through the atmosphere. A good amount of those photons will make it to the surface, but by the time they get there they will seem to be coming from a random direction.

Now think of red light. Rayleigh scattering barely affects it, so most of the photons make it to the surface in a straight line from the Sun.

Now think of green light. Rayleigh scattering affects it some, but not a lot. In the middle of the day, most of it will make it to the surface in a straight line from the Sun. But at sunset, because it has to go through a lot of atmosphere, a good amount of it will be scattered away (and behave more like blue light).

Of course this is a bit of a cartoon because wavelength is a continuum, not just three values. But I think this explains the majority of the effects you are trying to understand: In the middle of the day the sun is yellow and the sky is blue; At sunrise and sunset the sun is red and the sky is kind of orange in the general direction of the sun, but blue in the opposite direction (because green doesn't scatter as much as blue).

I hope this explanation makes sense.

This topic is closed to new replies.

Advertisement