4 Sky Dome Rendering History [PSS99][HP03][O’N05]Single scattering onlyOr viewable from ground onlyOr all of the aboveOr not real-timeAtmospheric light scattering is complex phenomena. Hard to model, hard to calculate.Different model simplifications are used to make it real-time.
5 Current Approach Multiple scattering Aerial perspective Viewable from spaceLUTs are pre-computed on GPU
6 L(x,v,s)=(L0+R[L]+S[L])(x,v,s) Rendering EquationL(x,v,s)=(L0+R[L]+S[L])(x,v,s)x – position, v – view direction, s – sun directionFinal lighting includes:L0 – attenuated direct sun lightR[L] – light reflected at point (x0) and attenuatedS[L] – light scattered toward the viewer between x and x0Usually computed by numerical integration
7 Direct Sun Light L0(x,v,s)=T(x,x0)Lsun, or 0 Direct sunlight attenuated by the transmittance function T(x,x0) before reaching viewer at xAccounts for occlusion by the horizonSmooth shadow transition to hide sharp border on the cloudsL0 eazily can be generalized to include all direct light coming from extra-terrestrial objects we see – light coming from the moon, stars, nebulas, etc..
8 R[L](x,v,s)=T(x,x0)I[L](x0,s) Reflected LightR[L](x,v,s)=T(x,x0)I[L](x0,s)Light reflected at x0 and attenuated by transmittance towards xI[L] == 0 at the top atmosphere boundaryThis stands for the light coming from solid and transparent objects such as clouds, ground, etc..Additionally this should include illumination from sun and other light sources. Direct illumination is approximated using common techniques – general dynamic lighting with shadowmaps or other shadowing techniques.
9 S[L](x,v,s)=∫T(x,y)J[L](y,v,s)dy Inscattered Lightx0S[L](x,v,s)=∫T(x,y)J[L](y,v,s)dyxLight scattered between x and x0 toward xThe very essence of visible sky color.
10 Look-up Tables (LUT) Re-parametrise functions and store them in LUT Pre-compute LUTs on GPUTransmittance (r, μ)Irradiance (r, μS)Inscatter (r, μ, μS, ν)Terms which need numerical integration and don’t have high spatial frequency details as direct lighting does are put into LUTs.Re-parametrisation is used to lower both lighting equation parameter space dimensions and LUT size.GPU is used to speed up LUT pre-computation. Still can’t do it real-time – too costly for that. But computational time is short.
11 View from SpaceRealistic atmosphere with fictional space objects.
12 Simple Fog vs Inscatter FastChange parameters in real timeAccounts for transmittance onlyLooks fineSlowerPrecomputeAccounts for transmittance and inscatterExtremely realisticFog both scatters (and extincts) light coming from solid and transparent objects and inscatters light coming from all other directions.
14 Sun shafts Use industry-standard mask generation Radial blur it Modulate inscattered light with the maskCheap, known, works for all types of geometrySun shafts effect is a scattered light coming from the sun shaped by the objects which occlude this light.Our approximation is far from being physically correct, but it delivers eye-pleasing results.
16 Clouds Need volumetric realistically looking clouds Use group of particles to represent a single cloudUse the same lighting equation to blend nicely into the skyUse impostors to save on expensive per-pixel lighting computationsMost current techniques simulate time-of-the-day lighting conditions for the clouds using artists-defined data. This data is per time of the day. While it gives good results, data doesn’t varies spatially, which allows much space for improvements.Using the same lighting equation naturally gives us spatially-dependant lighting conditions. Difference is especially noticeable at dawn at sunset time.
17 Clouds lighting Need x0 to apply lighting equation Use world-space impostor’s pixel positionApply inscattered light and irradiance as to a regular object.To simulate sun direct light scattering use similar to [WENZEL07] techniqueMarch in sun direction in impostor space to accumulate light extinction factor to attenuate sun lightAdd rim light to simulate scattering on the cloud’s edge
19 Impostor Pixel Position Special lighting conditions at dawns and sun sets.The sun light is partially blocked by the Earth resulting in shadow running on the cloud.
20 Impostor Pixel Position Need better pixel position reconstruction:Sun shadow is a crisp horizontal lineCan’t pack a group of clouds into a single impostor or have a very large cloudSimple position reconstruction reveals the flat nature of the impostor.
21 Impostor Pixel Position Accumulate impostor-space linear depth per pixelSimple min doesn’t work well – must account for transparency, linear interpolation problem on bordersSimple additive blend doesn’t work – depth on cloud edges blend with impostor clear depth valueWe could use another position reconstruction technique – assumption about cloud form could allow us to use analytical method to reconstruct position. Won’t work for arbitrary cloud or packed into a single impostor cloud group.
22 Impostor Pixel Position Min blendAdditive blendMin blend behaves really bad for light transparent particle interleaves opaque particle situationadditive blend fails when light and transparent particle interleaves clear sky.
23 Impostor Pixel Position Store both accumulated depth and normalization weightDepthAcc = OldDepthAcc*(1-newDepthWeight) + NewDepth*NewDepthWeightDepthWeightAcc=OldDepthWeightAcc*(1-newDepthWeight) + NewDepthWeightFinal depth = DepthAcc/DepthWeightAccUse particle transparency as DepthWeight => Need 2 FP16 channels to store both impostor depth and densityLinear interpolation is not linear anymore, but it is monotonous and worksHave two more spare channels – store normal or per-particle ambient occlusion for more sophisticated lighting?This method is a simple weighted sum. The trick is how the weight is calculated.If initial DepthWeightAcc is set to 1 we get common additive blending.Linear interpolation won’t fail on particle edges – it will deliver exact value until DepthAcc will become too small which anyway results into transparent pixel.
26 Polarization Sky light is polarized Max polarization at view-sun angle == 900Min polarization at view-sun angle == 00 and 1800Simulate effect of camera with polarized filter attached to add more contrast and depth to the scene* Mimics what we got used to see on photos.
27 PolarizationONOFFTo emphasize effect completely physically incorrect polarization intensity dependency was used. Commonly used approximation doesn’t work well in our situation.
29 Reference[PSS99]Preetham, A. J., Shirley, P., and Smits., B. E.: A Practical Analytic Model for Daylight. In Siggraph 1999, Computer Graphics Proceedings (Los Angeles, 1999), Rockwood A., (Ed.), Addison Wesley Longman, pp. 91–100.[HP03] Hoffman, N., and Preetham, A. J.: Real-time Light-Atmosphere Interactions for outdoor scenes. Graphics Programming Methods (2003), pp. 337–352.[O’N05] O’NEIL S.: Accurate atmospheric scattering. In GPU Gems 2: Programming Techniques for High-Performance Graphics and General-Purpose Computation (2005), Addison-Wesley Professional.[BrunetonNeyret2008] Bruneton, E. and Neyret, F Precomputed Atmospheric Scattering. EGSR Computer Graphics Forum, 27(4), June 2008, pp[WENZEL07] WENZEL C Real-time Atmospheric Effects in Games Revisited. Conference Session. GDC March 5-9, 2007, San Francisco, CA.