On Skylight and Aerial Perspective A.J. Preetham ATI Research (preetham@ati.com)
Introduction
Outline Atmosphere Skylight Simulation models Analytic models Aerial Perspective Scattering using graphics hardware. Interactive and Real time techniques
Sun Solar constant: 1.37 kw/m 2 Radius: 680x10 6 m (109 times earth s radius) Solid angle: 7.2x10-5 sr -1 Color: White
Atmosphere A very thin layer and extends up to 600 km. 10% at 18 km 1% at 30 km 600km 6400km Earth Atmosphere
Atmosphere Layers Troposphere (12 km) Stratosphere (50 km) Mesosphere (85 km) Thermosphere (600 km)
US Standard Atmosphere Courtesy of Windows to the Universe
Atmosphere Sunlight Transmitted Scattered Absorbed Multiple Scattered Reflected Earth Atmosphere
Atmosphere Composition Mostly N 2 and O 2 Mixed gases, H 2 0, dust Absorption UV O 2, O 3 IR H 2 0, CH 4, C0 2, N 2 0 Oxygen 21% Others 1% Nitrogen 78%
Atmosphere Optical Mass. Mass of medium in path of unit cross-section. Optical Mass = Optical Length Optical Mass / Density at earth s surface. Optical Length = ρ(x) dx 1 ρ ρ 0 ( xdx )
Optical Length l 1 = ρ 0 ρ( xdx ) r(x) x r 0 r 0 Optical length
Optical length (cnt d)( Transmittance (T) T T = = e e 1 ρ K( x) dx 0 K 0 ρ ( xdx ) Scattering coefficient: Density: ρ Optical length: l Optical depth: τ K T = e Kl 0 T = e τ
Relative optical length Optical length varies with direction. Relative optical length l( θ ) m = l (0) Approximation by Kasten, 1989. m = (cosθ + 0.15*(93.885 θ)) 1 1.253
Relative optical lengths(cnt d) 8.4 km, 1.25 km s 11.9 km, 1.8 km 16.9 km, 2.54 km θ 45 o 60 o 75 o 32.6 km, 4.9 km 306 km, 45.6 km 90 o Earth Atmosphere Optical lengths for air, aerosols
Skylight
Skylight (cnt d)( Sunlight Atmosphere Earth
Skylight & Atmospheric Scattering Measurement (Meteorology) Simulation (Computer Graphics) Data Data Fit Model Fit Model Rendering Luminance CIE Clear sky CIE Overcast sky CIE Intermediate sky Perez all weather sky Spectral Radiance Preetham Spectral Radiance Blinn Dobashi Kaneda Klassen Nishita Max
Skylight (cnt d)( E s A D ω s B R dx Atmosphere L( ω) ω x C Earth Kl dl= Ee 0 ABKP ωω e 0 BCdx s 0 (, s ) Kl
Skylight (cnt d)( E s A D ω s B R dx Atmosphere L( ω) ω x C Earth Kl dl= Ee 0 ABKP ωω e 0 BCdx s 0 (, s ) Kl
Skylight (cnt d)( E s A D ω s B R dx Atmosphere L( ω) ω x C Earth Kl dl= Ee 0 ABKP ωω e 0 BCdx s 0 (, s ) Kl
Skylight (cnt d)( E s A D ω s B R dx Atmosphere L( ω) ω x C Earth Kl dl= Ee 0 ABKP ωω e 0 BCdx s 0 (, s ) Kl
Skylight (cnt d)( E s A D ω s B R dx Atmosphere L( ω) ω x C Earth Kl dl= Ee 0 ABKP ωω e 0 BCdx s 0 (, s ) Kl
Skylight (cnt d)( E s A D ω s B R dx Atmosphere L( ω) ω x C Earth Kl dl= Ee 0 ABKP ωω e 0 BCdx s 0 (, s ) Kl
Skylight (cnt d)( E s A D ω s B R dx Atmosphere L( ω) ω x C Earth D Kl 1 = s 0 C Kl L ( ω) Ee 0 ABKP( ωω, ) e 0 BC dx s
Skylight (cnt d)( E s A D ω s B R dx Atmosphere L( ω) ω x C Earth D Kl 1 = s 0 C Kl L ( ω) Ee 0 ABKP( ωω, ) e 0 BC dx s
Skylight (cnt d)( Atmosphere E s Earth L( ω) C A ω s ω L( ω,x) ω R B x dx D D 4π L ( ) L( ', xkp ) (, ') d ' e 0 ABdx ω ω ωω ω = 2 0 C 0 Kl
Skylight (cnt d)( Atmosphere E s Earth L( ω) C A ω s ω L( ω,x) ω R B x dx D D 4π L ( ) L( ', xkp ) (, ') d ' e 0 ABdx ω ω ωω ω = 2 0 C 0 Kl
Skylight (cnt d)( Atmosphere E s Earth L( ω) C A ω s ω L( ω,x) ω R B x dx D D 4π L ( ) L( ', xkp ) (, ') d ' e 0 ABdx ω ω ωω ω = 2 0 C 0 Kl
Skylight (cnt d)( Atmosphere E s Earth L( ω) C A ω s ω L( ω,x) ω R B x dx D D 4π L ( ) L( ', xkp ) (, ') d ' e 0 ABdx ω ω ωω ω = 2 0 C 0 Kl
Skylight (cnt d)( Atmosphere E s Earth L( ω) C A ω s ω L( ω,x) ω R B x dx D L( ω) = L ( ω) + L ( ω) +... 1 2
Atmospheric Scattering simulation Nishita et al, Display of The Earth Taking into account Atmospheric Scattering, Siggraph 1993
Atmospheric Scattering simulation Dobashi et al, Fast, accurate rendering method of Outdoor scenes using An All-weather skylight model, Journal IEEE of Japan, 1999
Skylight & Atmospheric Scattering Measurement (Meteorology) Simulation (Computer Graphics) Data Data Fit Model Fit Model Rendering Luminance CIE Clear sky CIE Overcast sky CIE Intermediate sky Perez all weather sky Spectral Radiance Preetham Spectral Radiance Blinn Dobashi Kaneda Klassen Nishita Max
Skylight Meteorological measurements IDMP (International Daylight Measurement Programme), 1991 was setup by CIE. Measurements included solar radiation and distribution of light over sky. Analytic models fit to real world measurement data.
Luminance Luminous flux (lumen) Energy of light emitted per sec in all directions Luminous intensity (cd) Luminous flux in a direction per unit solid angle Luminance (cd/m 2 ) Luminous intensity emitted per unit surface area Range: 1.6X10 9 cd/m 2 (sun at noon) to 8000cd/m 2 (clear sky) to 10-3 cd/m 2 (night sky)
Sky dome variables θ s θ v W γ N S φ s φ E
Overcast sky Luminance model: Moon & Spencer (1942), CIE (1955)
Overcast sky (cnt d)( CIE Luminance model: Y oc = Y z 1+ 2cosθ 3
Clear sky Luminance model: Pokrowski, Kittler (1967), CIE (1973).
Clear Sky (cnt d)( CIE luminance model Y c = Y z 3γ 2 0.32/cosγ 0.91+ 10e + 0.45cos γ 1 e ( )( ) 0.91+ 10e + 0.45cos 3θ s 2 0.32 θs 1 e
All weather sky Luminance model: Perez et al 1993. Based on 5 different parameters Darkening or brightening of horizon Luminance gradient near horizon. Relative intensity of circum solar region Width of circum solar region Relative backscattered light
All weather sky (cnt d)( Perez luminance model B/cosθ Dγ 2 F( θγ, ) = (1 + Ae )(1+ Ce + Ecos γ) F( θγ, ) YP = YZ F (0, θ ) s
Skylight ASRC-CIE luminance model Linear combination of CIE clear sky Turbid clear sky (Gusev) Intermediate sky (Nakamura) CIE overcast sky The weights are computed using sky clearness and sky brightness factors.
Clear Sky Spectral radiance model: Preetham et al, 1999. Based on simulation data. Simulation based on USSA. Up-to second order scattering. Provides Luminance Y and chromaticities x,y similar to Perez model.
Clear sky (cnt d)( Spectral radiance model B/cosθ Dγ 2 F( θγ, ) = (1 + Ae )(1+ Ce + Ecos γ) F( θγ, ) Y = YZ F (0, θ ) s F( θγ, ) x= xz F (0, θ ) T : Turbidity Yz, xz, yz : functions of T, θs ABCDE,,,, : polynomials in s T F( θγ, ) y = yz F (0, θ ) s
Clear sky (cnt d)( Chromaticity to spectral curve. 1.3515 1.7703x+ 5.9114y M1 = 0.0241+ 0.2562x 0.7341y M 2 0.0300 31.4424x+ 30.0717y = 0.0241+ 0.2562x 0.7341y S S MS M S D( λ) = 0( λ) + 1 1( λ) + 2 2( λ)
Clear Sky (cnt d)( Spectral curve & Luminance to spectral radiance Y = Km L( λ) V( λ) dλ V ( λ): Spectral sensitivity curve K m : Luminance efficacy(680 lm/w)
Clear Sky (cnt d)( Preetham et al, A Practical Analytical model for Daylight, Siggraph 1999.
Aerial Perspective Courtesy: Irene Alora & Pandromeda
Aerial Perspective (cnt d) Sunlight Inscattering Extinction
Aerial Perspective Simple model Earth is flat. Rays travel through constant density. Single scattering only.
Aerial Perspective (cnt d) L = fl0 + Lin C L 0 x L( ω' ) ω' B L in inscatter s ω L A
Aerial Perspective (cnt d) Kl f = e AC = e Ks C L 0 x L( ω' ) ω' B L in inscatter s ω L A
Aerial Perspective (cnt d) s Kl L e AB L( ω') KP( ωω, ') dω' dx in = 0 4π C L 0 x L( ω' ) ω' B L in inscatter s ω L A
Sunlight at earth s surface Transmittance Rayleigh scattering Aerosol scattering Water vapor absorption Ozone absorption Mixed gases absorption
Sunlight at earth s surface (cnt d)( Spectral attenuation Luminance v angle
Using graphics hardware
Interactive Rendering Dobashi et al (2000, 2002) Model atmosphere scattering by rendering virtual planes and accumulate terms using alpha blending Visibility at any virtual plane is calculated using standard shadow map technique.
Interactive Rendering (cnt d) D x E s x w s ω DL in Virtual planes Kl x in s s L = Vis( xe ) ( xe ) KP( ωω, ) x
Interactive Rendering (cnt d) x k + x L ( ) ( ) ( ) x in xk = Vis xes xe KP( ωω, s) dx x k Kl D x L ( x ) f ( x ) f ( x ) in k h k l k E s x ws x k + x fh( xk) = Vis( xe ) s( xdx ) x k ω DL in x k + x Kl f ( ) x l xk = e KP( ωω, s) dx x k fl planes f h planes
Interactive Rendering (cnt d) Dobashi et al, Interactive Rendering of Atmospheric Effects Using Graphics Hardware, Hardware Workshop 2002.
Real time rendering Programmable graphics hardware User specifies vertex and/or fragment program. Programmability exposed through DX8/9, GL ARB vertex and pixel shaders. Many offline shading models ported to graphics processor
Real time rendering (cnt d) Hoffman et al, 2002 Aerial Perspective - Evaluate f and L in in vertex shader Multiply f with L 0 and add L in in pixel shader L= fl0 + Lin C L 0 x L( ω' ) s ω' B L in inscatter ω L A
Real time rendering (cnt d) Transmittance term Kl f = e AC = e Ks In the presence of 2 types of particles ( K K ) s f e r + r+ m = m
Real time rendering (cnt d) Inscattering term. s K( s x) in = s ωωs 0 L e EKP(, ) dx Ks L = EP( ωω, )(1 e ) in s s In the presence of 2 types of particles KP Lin = E ( r m) s e + K + K r r ( ωω, s ) + KmPm ( ωω, s ) (1 ( Kr+ Km) s ) r m
Real time rendering (cnt d) Position L 0 K r, K E s ω s m Vertex Shader L f in Pixel Shader L= fl + L 0 in
Real time rendering (cnt d) Hoffman et al, Rendering Outdoor Light Scattering in Real Time, GDC 2002.
Real time rendering (cnt d) DEMO
Summary Atmosphere Skylight Simulation models Analytic models Aerial Perspective Scattering using graphics hardware. Interactive and Real time techniques
THANK YOU!