Real-Time Rendering of Planets with Atmospheres


Real-Time Rendering of Planets with Atmospheres

Tobias Schafhizel, Martin Falk, Thomas Ertl, In Journal of WSCG 07, 2007



행성과 행성의 대기 산란을 실시간 렌더링하는 방법에 대한 내용.

http://www.vis.uni-stuttgart.de/~schafhts/HomePage/pubs/wscg07-schafhitzel.pdf



[메모]


3. ATMOSPHERIC SCATTERING


Single scattering due to air molecules. == Rayleigh scattering.

Ip(λ,θ) : P 점에서 산란된 빛은 wavelength λ(람다)와 viewer와 진입 빛 사이각 θ(세타)에 대한 함수이다.

Io : 진입하는 빛의 강도

ρ: 밀도의 비율(로)  = exp(-h/Ho), h: 고도, H0: height scale(7994m). exp(x)는 e(2.71828)^x. 이 식으로 그래프를 그려보면 7994미터 정도의 높이에서 값이 0.36정도 되는데 에베레스트 산 정상에서 공기가 1/3 정도로 희박해진다고 하는 말과 맞아 떨어진다.

Fr: scattering phase function. 산란의 방향 성질 = 3/4(1+cos^2(θ))

K: 상수. 해수면 높이에서 공기 분자의 밀도.


Ns: 표준 대기의 분자개수밀도(molecular number density) == 1.2250 kg/m^3

n: 공기의 굴절 인덱스 == 1.000277

계산해보면  K = 1.6489679641432173501383193061305e-6  맞나..? 맞다. 실제로 셰이더에서 이 값을 사용하면 된다.

Wavelength와 Attenuation

The relation between the scattered light and the wavelength of the incident light describes the strong attenuation of short wavelengths. This is due to the wavelength's inversely behavior to the light attenuation.



위 영어 문장의strong attenuation of short wavelengths는 strong attenuation of long wavelengths나, strong scattering of short wavelengths로 이해하면 되는 듯 하다. 

왜냐하면...

태양에서 방사된 가시광선은 360 nm (violet)에서  750 nm (red) 의 wavelength를 가지고 있는데.

논문 본문에 짧은 wavelength를 가진 빛이 강한 감쇄를 한다라고 되어 있는데, 긴 wavelength의 감쇄가 강하다. 빛이 물을 투과할 때 긴 wavelength를 가진 빨강, 노랑 녹색 빛들은 낮은 수심에서 대부분 감쇄되어 사라지고, 낮은 파장의 파란색 보라색 빛은 깊은 바다에까지 도달한다. 그래서 수심 깊은 곳은 어두운 파란색으로 보인다.

참고 : its blue component is Rayleigh scattered strongly by atmospheric gases but the longer wavelength (e.g. red/yellow) components are not. - https://en.wikipedia.org/wiki/Mie_scattering

물을 통과할때와 파장보다 작은 대기분자를 통과하는 경우가 갖지 않다. 낮은 파장의 빛은 산란을 잘한다. 그래서 대기의 대부분은 파란색이다. 하지만 태양이 질때 석양빛은 산란으로 인한 색이 아니라 태양에서 직접 도달한 빛의 색상이다.


β: attenuation coefficient. i.e. The extinction ratio per unit length.

The attenuation between two points inside the atmosphere is determined by the optical length t(S, r). S: 거리, r: wavelength.

Optical length == Optical depth. 같은 용어로 보임.





4. REAL-TIME ATMOSPHERIC SCATTERING

4.1 Creating the Scattering Texture


참고 필요 : S.O'Neil; 'Real-time atmospheric scattering', 2004

http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/real-time-atmospheric-scattering-r2093


참고 필요: Tomoyuki Nishita, Takao Sirai, Katsumi Tadamura, Eihachiro Nakamae; 'Display Earth Taking into Account Atmospheric Scattering', 1993

http://nishitalab.org/user/nis/cdrom/sig93_nis.pdf


이렇게 오래된 논문도 링크가 살아있어서 다행이다. nishitalab의 경우는 어느 대학에서 후원을 받는 연구소인 듯 하다. S. O'Neil의 문서는 GameDev에 소스코드와 함께 올려져있던 문서인데 링크주소 자체는 변경되었지만 여전히 접근 가능하다. GameDev도 정말 오래된 곳인데, 보존을 잘하고 있다. 안타까운건 S. O'Neil의 홈페이지는 죽어있다. 내 홈페이지 jungwan.net은 얼마나 살아있을 수 있을까...


이 논문(Real-Time Rendering of Planets with Atmospheres)은 대기를 렌더링하기 위해 필요한 연산 중 일부를 3D 텍스쳐에 미리 계산하는 방법에 대해 설명한 논문이라서, 대기 산란 그 자체에 대해서 알고 싶으면 위와 같은 관련 논문들을 살펴봐야한다.

Display Earth Taking into Account Atmospheric Scattering 

Rayleigh scattering and Mie scattering

The characteristics of scattering depend on the size of particles in the atmosphere. Scattering by small particles such as air molecules is called Rayleigh scateering, and scattering by aerosols such as dust is called Mie scattering.



Assumptions:

1. multiple scattering between molecules is ignored. The interreflection of light between the earth's surface and particles in the air is also ignored.

2. For visible wavelenghts, the absortion in the ozone layer is ignored. It is negligible.

3. The actual light path is curved due to the variation of index of refraction with altitudes. But we assume that the light path is straight.


Phase function for Mie scattering

g : an asymmetry factor

5/9 * u - (4/3 - 25/81 * u^2)x^(-1/3) + x^(1/3),

x = 5/9 * u + 125/729 * u^3 + (64/27 - 325/243 * u^2 + 1250/2187* u^4)^(1/2)

g가 0이면 Rayleigh scattering의 phase함수와 동일.

u는 대기 상태에 따라 다양한 값을 선택할 수 있는데, 0.7~0.85의 값을 가짐.(관련 내용 : W.M. Cornette, J.G. Shanks, "Physical reasonable analytic expression for the single-scattering phase function")

Aerosol의 density는 Molecules랑 다르다. H0을 7994m가 아니라 1.2km로 하면 Aerosol의 density함수가 된다. 7994 / 12000 = 0.666





구현 중...


해가 비켜나갈 때 가장자리 부근이 붉게 물드는데, 이는 지표면에서 수평선 넘어로 해가 질때 노을이 붉게 물드는 것과 같다.


대기를 고려하지 않은 경우

지구에서 반사된 빛이 대기에 의해 감쇄된 결과

Atmospheres

Real Time Cloud Generation

Night lights

구현 완료.

댓글

이 블로그의 인기 게시물