Volumetric Lighting - How Volumetric Lighting Works

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

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.

Read more about this topic:  Volumetric Lighting

Famous quotes containing the words lighting and/or works:

    “There is no more miserable human being than one in whom nothing is habitual but indecision, and for whom the lighting of every cigar, the drinking of every cup, the time of rising and going to bed every day, and the beginning of every bit of work, are subjects of express volitional deliberation.”
    —William James (1842–1910)

    “In doing good, we are generally cold, and languid, and sluggish; and of all things afraid of being too much in the right. But the works of malice and injustice are quite in another style. They are finished with a bold, masterly hand; touched as they are with the spirit of those vehement passions that call forth all our energies, whenever we oppress and persecute..”
    —Edmund Burke (1729–97)