Atmospheric Scatting Help

Started by
4 comments, last by Quat 14 years, 1 month ago
I am implementing Atmospheric Scattering based on the paper by Nishita to color my sky dome. First, I am just using Rayleigh scattering and after I debug that I will add Mie scattering. The good news is that I am at least getting a blue sky, but I am not getting a sun and I am not getting an orange/redish sunset. I think one of the problems is that I always center my sky sphere around the camera (so it is like my camera is at the center of the earth instead of on the surface of the earth). Therefore, I never would get a sunset because light the distance light travels to the eye is always the same. For the purposes of calculating the sky color, is the fix to just move the eye position as if it were on the earth's surface, but still render the sky sphere centered about the eye so the camera never gets "closer" to it? Also, there is a value I_s (solar radiation) which is the light coming from the sun before hitting the atmosphere. What kind of value would this be. It seems like when doing this physically based rendering, you no longer describe light values in a normalized [0,1] range.
-----Quat
Advertisement
If the skydome being alway centered around the eye was the reason for not getting a sunset, then that would mean a person standing in the same location(in the real world) between sunrise and sunset would not see either. Scattering along with the direction of the sun vector would dictate sunrise/sunset. As far as the sun is concern, I think its actually Mie scattering that is responsible for that.
Quote:Original post by Quat
First, I am just using Rayleigh scattering and after I debug that I will add Mie scattering.
Quote:Original post by cgrant
As far as the sun is concern, I think its actually Mie scattering that is responsible for that.
cgrant is correct - you will not see a sun image without mie scattering.
Quote:For the purposes of calculating the sky color, is the fix to just move the eye position as if it were on the earth's surface, but still render the sky sphere centered about the eye so the camera never gets "closer" to it?
That sounds like a reasonable fix.


You might consider that these questions really don't merit entirely new threads of their own. Both of your follow-up questions could have been posted in the original thread.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Quote:
If the skydome being alway centered around the eye was the reason for not getting a sunset, then that would mean a person standing in the same location(in the real world) between sunrise and sunset would not see either.


I'm not saying I know the cause, but what I wrote was my guess. From my understand, the farther the light travels, the more blue light is scattered away, which is why you get orange/red at sunset. Since my eye is at the center of the sphere, the distance from a point on the atmosphere to the eye is always the same. So I think I need to model more accurately the eye being on the surface of the earth. However, since the user is always on the ground, I want the skysphere to move with the camera still.
-----Quat
Quote:Original post by Quat
For the purposes of calculating the sky color, is the fix to just move the eye position as if it were on the earth's surface, but still render the sky sphere centered about the eye so the camera never gets "closer" to it?


Exactly. Although your camera is located on the center of the sphere, the position you should pass to the algorithm must be the camera position above the earth surface. For example:
if your original camera position is : (0, 10.0, 0)
your camera position above the surface should be: (0, earth_radius+ 10.0, 0)

Without this adjustement your sky will always look wrong.

Quote:Original post by Quat
Also, there is a value I_s (solar radiation) which is the light coming from the sun before hitting the atmosphere. What kind of value would this be. It seems like when doing this physically based rendering, you no longer describe light values in a normalized [0,1] range.


Well, that's a rough question. In practice what you want is to generate a color in the RGB format for your, but for physically accurate rendering you should probably represent sun light in some kind of radiation format. Of course this is very complicated so the common approach taken by many implementations is to represent sun color as a very bright white, which goes outside the [0, 1] range.
Quote:
Of course this is very complicated so the common approach taken by many implementations is to represent sun color as a very bright white, which goes outside the [0, 1] range.


Thanks for the reply. And is that "very bright white" just determined by experimenting as to what looks good?
-----Quat

This topic is closed to new replies.

Advertisement