用阴影渲染行星周围的大气层

Rendering an atmosphere around a planet with shading

我造了一颗行星,想在它周围营造一种气氛。所以我指的是这个网站:

Click to visit site

我不明白这个:

As with the lookup table proposed in Nishita et al. 1993, we can get the optical depth for the ray to the sun from any sample point in the atmosphere. All we need is the height of the sample point (x) and the angle from vertical to the sun (y), and we look up (x, y) in the table. This eliminates the need to calculate one of the out-scattering integrals. In addition, the optical depth for the ray to the camera can be figured out in the same way, right? Well, almost. It works the same way when the camera is in space, but not when the camera is in the atmosphere. That's because the sample rays used in the lookup table go from some point at height x all the way to the top of the atmosphere. They don't stop at some point in the middle of the atmosphere, as they would need to when the camera is inside the atmosphere.

Fortunately, the solution to this is very simple. First we do a lookup from sample point P to the camera to get the optical depth of the ray passing through the camera to the top of the atmosphere. Then we do a second lookup for the same ray, but starting at the camera instead of starting at P. This will give us the optical depth for the part of the ray that we don't want, and we can subtract it from the result of the first lookup. Examine the rays starting from the ground vertex (B 1) in Figure 16-3 for a graphical representation of this.

第一个问题 - 光学深度是否取决于您的观看方式,即视角?如果是,table 只是给我从陆地到大气层顶部的直线光线的光学深度。那么光线穿透大气层到达相机的情况又如何呢?在这种情况下如何获得光学深度?

第二个问题 - 它所说的垂直角是多少...例如,它与我们在极坐标中使用的与 z 轴的角度相同吗?

第三个问题 - 这篇文章讨论了光线散射到太阳的问题。难道不应该反过来吗?就像从太阳到一点?

对文章或我的问题的任何解释都会有很大帮助。

提前致谢!

我不是这方面的专家,但玩过大气散射和各种物理和光学模拟。我强烈建议看看这个:

  • my VEEERRRYYY Simplified version of atmospheric scattering in GLSL

它不进行全体积积分,而只是沿射线进行线性路径积分,并且只进行具有各向同性系数的瑞利散射。如您所见,它仍然足够好。

在实际散射中,视角影响实际散射方程,因为散射系数在不同角度(相对于主光源和观察者)不同所以第一个问题的答案是肯定的.

不确定您在第二个问题中指的是什么。散射本身取决于光源、粒子和相机之间的角度。那位于任意平面上。但是,如果地球表面也被计入方程,那么它取决于水平角和垂直角(相对于地形),因此方位角,仰角,因为当相机面向太阳(方位角)并且反射光线更接近您时,通常会反射更多的光海拔。所以 我的猜测 这就是 水平角的大小 考虑到来自表面的反射光

回答你的第三个问题叫做反向光线追踪。您可以双向投射光线(从相机或太阳),但是如果您从光源开始,您不知道要以哪种方式击中相机屏幕上的像素,因此您需要投射大量光线以增加击中的可能性足以填满屏幕太慢且不准确(产生孔洞)。如果您从屏幕像素开始,那么您只投射单个或每个波长的光线,这要快得多。结果颜色相同。

[Edit1]垂直角度

好的,我稍微阅读了链接的主题,这是我的理解:

所以它只是表面法线和投射光线之间的角度。它的缩放比例 vert.angle=0 表示光线和法线相同,vert.angle=1 表示方向相反。