Volumetric lighting
Encyclopedia
Volumetric lighting is a technique used in 3D computer graphics
3D computer graphics
3D computer graphics are graphics that use a three-dimensional representation of geometric data that is stored in the computer for the purposes of performing calculations and rendering 2D images...

 to add lighting
Lighting
Lighting or illumination is the deliberate application of light to achieve some practical or aesthetic effect. Lighting includes the use of both artificial light sources such as lamps and light fixtures, as well as natural illumination by capturing daylight...

 effects to a rendered scene. It allows the viewer to see beams of light shining through the environment; seeing sunbeams streaming through an open window is an example of volumetric lighting, also known as crepuscular rays
Crepuscular rays
Crepuscular rays , in atmospheric optics, are rays of sunlight that appear to radiate from a single point in the sky. These rays, which stream through gaps in clouds or between other objects, are columns of sunlit air separated by darker cloud-shadowed regions...

. The term seems to have been introduced from cinematography
Cinematography
Cinematography is the making of lighting and camera choices when recording photographic images for cinema. It is closely related to the art of still photography...

 and is now widely applied to 3D modelling and rendering
Rendering (computer graphics)
Rendering is the process of generating an image from a model , by means of computer programs. A scene file contains objects in a strictly defined language or data structure; it would contain geometry, viewpoint, texture, lighting, and shading information as a description of the virtual scene...

 especially in the field of 3D gaming.

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 medium (such as fog
Fog
Fog is a collection of water droplets or ice crystals suspended in the air at or near the Earth's surface. While fog is a type of stratus cloud, the term "fog" is typically distinguished from the more generic term "cloud" in that fog is low-lying, and the moisture in the fog is often generated...

, dust
Dust
Dust consists of particles in the atmosphere that arise from various sources such as soil dust lifted up by wind , volcanic eruptions, and pollution...

, smoke
Smoke
Smoke is a collection of airborne solid and liquid particulates and gases emitted when a material undergoes combustion or pyrolysis, together with the quantity of air that is entrained or otherwise mixed into the mass. It is commonly an unwanted by-product of fires , but may also be used for pest...

, or steam
Steam
Steam is the technical term for water vapor, the gaseous phase of water, which is formed when water boils. In common language it is often used to refer to the visible mist of water droplets formed as this water vapor condenses in the presence of cooler air...

) that is inside its volume, just like in the real world.

How volumetric lighting works

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 or not, using the shadowmap 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.

You can also use stencil buffer like with the shadow volume technique
Shadow volume
Shadow volume is a technique used in 3D computer graphics to add shadows to a rendered scene. They were first proposed by Frank Crow in 1977 as the geometry describing the 3D shape of the region occluded from a light source...



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.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK