Volumetric lighting
Effect in computer graphics
≈ 3 min read
Names in other languages
- PolskiŚwiatło wolumetryczne
- TürkçeHacimsel ışıklandırma
- lvtilpuma apgaismojums
- EnglishVolumetric lighting
- РусскийОбъёмные лучи
- 中文体积光
- 简体中文体积光
- 繁體中文體積光
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
Volumetric lighting, also known as "God rays", is a technique used in 3D computer graphics to add lighting effects to a rendered scene. It allows the viewer to see beams of light shining across the environment. Examples of volumetric lighting are seeing sunbeams shining through a window and seeing sunbeams radiating when the Sun is below the horizon, also known as crepuscular rays.
The term seems to have been introduced from cinematography and is now widely applied to 3D modeling and rendering, especially in the development of 3D video games. In volumetric lighting, the light cone emitted by a light source is modeled as a transparent object and considered as a container of a "volume".
As a result, light has the capability to give the effect of passing through an actual three-dimensional aerosol (e.g. fog, dust, smoke, or steam) that is inside its volume, just like in the real world.
Techniques
, showing light rays through the canopy Volumetric lighting requires two components: a light space shadow map, and a depth buffer. Starting at the near clip plane of the camera, the whole scene is traced and sampling values are accumulated into the input buffer.
For each sample, it is determined if the sample is lit by the source of light being processed using the shadow map as a comparison. Only lit samples will affect final pixel color. This basic technique works but requires more optimization to function in real time.
One way to optimize volumetric lighting effects is to render the lighting volume at a much coarser resolution than that which the graphics context is using. This creates some bad aliasing artifacts, but that is easily touched up with a blur. One can also use stencil buffer like with the shadow volume technique.
Another technique can also be used to provide usually satisfying, if inaccurate volumetric lighting effects. The algorithm functions by blurring luminous objects away from the center of the main light source. Generally, the transparency is progressively reduced with each blur step, especially in more luminous scenes.
Note that this requires an on-screen source of light.
Text derived from https://en.wikipedia.org/w/index.php?oldid=1349327242 under CC BY-SA 4.0; modifications have been made.