1 / 65

Rendering Outdoor Light Scattering in Real Time

Rendering Outdoor Light Scattering in Real Time. Arcot J Preetham ATI Research preetham@ati.com. Naty Hoffman Westwood Studios naty@westwood.com. Outline. Basics Atmospheric Light Scattering Radiometric Quantities From Radiance to Pixels Scattering Theory

bunny
Télécharger la présentation

Rendering Outdoor Light Scattering in Real Time

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Rendering Outdoor Light Scattering in Real Time Arcot J Preetham ATI Research preetham@ati.com Naty Hoffman Westwood Studios naty@westwood.com

  2. Outline • Basics • Atmospheric Light Scattering • Radiometric Quantities • From Radiance to Pixels • Scattering Theory • Absorption, Out-Scattering, In-Scattering • Rayleigh and Mie Scattering • Implementation • Aerial Perspective, Sunlight, Skylight • Vertex Shader • Future Work

  3. Atmospheric Light Scattering • Is caused by a variety of particles • Molecules, dust, water vapor, etc. • These can cause light to be: • Scattered into the line of sight (in-scattering) • Scattered out of the line of sight (out-scattering) • Absorbed altogether (absorption)

  4. Atmospheric Light Scattering • Illuminates the sky

  5. Atmospheric Light Scattering • Attenuates and colors the Sun

  6. Atmospheric Light Scattering • Attenuates and colors distant objects

  7. Atmospheric Light Scattering • Varies by • Time of Day • Weather • Pollution

  8. Atmospheric Light Scattering • Varies by • Time of Day • Weather • Pollution

  9. Atmospheric Light Scattering • Varies by • Time of Day • Weather • Pollution

  10. Atmospheric Light Scattering • Varies by • Time of Day • Weather • Pollution

  11. Atmospheric Light Scattering • Varies between planets

  12. Atmospheric Light Scattering • Extinction (Absorption, Out-scattering) • Phenomena which remove light • Multiplicative: • In-scattering: • Phenomenon which adds light • Additive: • Combined:

  13. Radiometric Quantities • Radiant Flux • Radiance • Irradiance

  14. Radiometric Quantities • Radiant Flux • Quantity of light through a surface • Radiant power (energy / time) • Watt

  15. Radiometric Quantities • Radiance L • Quantity of light in a single ray • Radiant flux / area / solid angle • Watt / (meter2 * steradian)

  16. Radiometric Quantities • Irradiance E • Quantity of light incident to a surface point • Incident radiant flux / area (Watt / meter2) • Radiance integrated over hemisphere

  17. From Radiance to Pixels • Compute radiance incident to eye through each screen pixel

  18. From Radiance to Pixels • Pixel value based on radiance • But radiance is distributed continuously along the spectrum • We need three numbers: R, G, B

  19. From Radiance to Pixels • SPD (Spectral Power Distribution) to RGB • Fast approach: • Do all math at R, G, B sample wavelengths • Correct approach: • Use SPDs, convert final radiance to RGB M L S 400nm 500nm 600nm 700nm

  20. Absorption • Absorption cross section • Absorbed radiant flux per unit incident irradiance • Units of area (meter2)

  21. Absorption • Absorption cross section

  22. Absorption • Absorption coefficient • Particle density times absorption cross section • Units of inverse length (meter-1)

  23. Absorption • Total absorption cross section: • Probability of absorption: A ds

  24. Absorption • Attenuation of radiance from travel through a constant-density absorptive medium: L0 L(s) s

  25. Out-Scattering • Exactly as in the absorption case • Scattering cross section • Scattering coefficient • Attenuation due to out-scattering in a constant-density medium:

  26. Extinction • Both absorption and out-scattering attenuate light • They can be combined as extinction • Extinction coefficient • Total attenuation from extinction

  27. In-Scattering • Light is scattered into a view ray from all directions • From the sun • From the sky • From the ground • We will only handle in-scattering from the sun

  28. In-Scattering • Where does a scattered photon go? • Scattering phase function • If a photon is scattered, gives the probability it goes in direction • Most atmospheric particles are spherical or very small:

  29. In-Scattering • How do we use for in-scattering? • In-scatter probability: • In-scatter radiance : Sun Eye ray

  30. In-Scattering • In-scattering over a path • Radiance from a single event: • Over a distance ds: • Angular scattering coefficient • In-scattering over ds: • Units of : meter-1 * steradian-1

  31. In-Scattering • Added radiance from solar in-scattering through a constant-density scattering medium: s

  32. Extinction and In-Scattering s

  33. Extinction and In-Scattering • Compare to hardware fog: • Monochrome extinction • Added color completely non-directional

  34. Rayleigh Scattering • Small particles • is proportional to

  35. Rayleigh Scattering • Phase function:

  36. Rayleigh Scattering

  37. Mie Scattering • Larger, spherical particles • Phase function approximation: • Henyey-Greenstein 0.5 0 -0.5 -0.75 0.75

  38. Mie Scattering • Wavelength dependence • Complex and depends on exact size of particle • In practice, air usually contains a mix of various sizes of Mie particles • In the aggregate these tend to average out any wavelength dependence

  39. Mie Scattering

  40. Combined Scattering • In practice, air contains both Rayleigh and Mie scatterers • Absorption is usually slight • We will use:

  41. Parameters • Atmospheric parameters: • Constant? • Affected by extinction • Constant:

  42. Implementation How ? Without scattering With scattering

  43. Implementation • Aerial Perspective • Extinction & Inscattering • Rays low in atmosphere • Constant density good approximation s

  44. Implementation • Sunlight • is white • Density is not constant! • Use a more accurate model for Fex?

  45. Implementation • Sunlight: • Virtual sky dome, use simple model density distance

  46. Implementation • Sky color: • Density is not constant! • More accurate model too expensive • Many computations needed per frame • Sky geometry • Virtual sky dome

  47. Implementation • Compute: • Can be done with textures • 1D texture for • Texture coordinate is a function of s • 2D texture for • Texture coords are functions of s, • Combine in pixel shader • We decided on a different approach

  48. Implementation • Compute: • Use vertex shader to compute • Apply as vertex interpolated colors • In pixel shader, or even fixed pipeline • Pros: • Doesn’t use valuable texture slots • Can change atmosphere properties • Cons: • Somewhat dependent on tessellation

  49. Vertex Shader Position Constants: Transform Matrix Outputs: Vertex Shader Sun Direction Eye Position

More Related