In the act of observing the real world, things are not seen in a vacuum between the observer and the object. There has to be taken into account the emission, absorption, and scattering of light in a complex environment .
God rays occur when a space contains a dense mixture of light scattering media, like gas molecules, and objects that occlude the light will cast volumes of shadow that appear to create rays of light that emanate from the light source (figure 1) . This phenomena is also known as crepuscular rays, sunbeams, star flare, sunburst, or light shafts. In the field of 3D graphics development it is called Volumetric Light Scattering, in which the natural effect is replicated digitally. According to the 3D Dictionary, the general term of volumetric lighting is defined as “the capability of light to give the effect of passing through an actual three dimensional medium such as fog, dust, smoke, steam, and other gasses.”  
Rendering these type of rays was first experimented utilizing non-real-time rendering, with a modified shadow volume algorithm. After that, a method was developed for multiple light sources. In 2002, the creation of god rays was researched in real-time rendering, utilizing a slice-based volume-rendering technique, and in 2004 using hardware shadow maps. An alternative real-time method, inspired on research made in 2001, uses polygonal volumes .
Volumetric light scattering as well as other illumination effects such as indirect lighting, soft shadows, or caustic enhance the realism of rendered scenes and ads polish. There is a number of ways that light shafts can be used like rays filtering through a forest canopy, light beams on a foggy night, or shafts of light shining through clouds, for example  . While rendering crepuscular rays and other light effects provides an enhancement of the realism in virtual scenes, it comes with a cost by increasing the computational demand for interactive applications. Having participating media means that light will not only interact with the surfaces in the virtual scene but requires “the evaluation of the scattering integral at every point in space.” It is therefore necessary to develop a fast and precise rendering method, notably for space, flight, or driving simulators,   Engelhardt and Dachsbacher (2010) write that rendering volumetric lighting effects is “typically done using ray marching which is too expensive for every pixel on the screen for interactive applications” and propose “a rendering technique for textured light sources in single-scattering media, that draws from the concept of epipolar geometry to place samples in image space: the inscattered light varies orthogonally to crepuscular rays, but mostly smoothly along these rays. These are epipolar lines of a plane of light rays that projects onto one line on the image plane. Our method samples sparsely along epipolar lines and interpolates between samples where adequate, but preserves high frequency details that are caused by shadowing of light rays. We show that our method is very simple to implement on the GPU, yields high quality images, and achieves high frame rates.” 
The creation of realistic images is an important research subject in computer graphics. It is therefore necessary to know the properties of light, and a good grasp of the natural phenomenon of crepuscular rays in order to translate it properly to the virtual imagery . Light is affected by the electromagnetic fields of different kinds of particles, which may result in the absorption of the light or scattering it in another direction . As light goes through a media, there can be also emission, which is radiating electromagnetic energy. Since a photon can have multiple scattering events, complete equations taking into account this are hard to solve. In real-time rendering a single scattering model is used that assumes that the light was scattered only once before, making it easier to compute .
- GPU Gems 3. Chapter 13. Volumetric Light Scattering as a Post-Process. Retrieved from http://http.developer.nvidia.com/GPUGems3/gpugems3_ch13.html
- Moreau-Mathis, J. (2014). God Rays? What’s that? Retrieved from https://medium.com/community-play-3d/god-rays-whats-that-5a67f26aeac2#.l7of1sdun
- The 3D Dictionary. Volumetric Lighting. Retrieved from http://www.tweak3d.net/3ddictionary/3ddictionaryV.shtml
- Digital Fill Tools. Rays. Retrieved from http://www.digitalfilmtools.com/rays/
- Engelhardt, T. and Dachsbacher, C. (2010). Epipolar sampling for shadows and crepuscular rays in participating media with single scattering. Symposium on Interactive 3D Graphics and Games
- Dobashi, Y., Yamamoto, T. and Nishita, T. (2002). Interactive rendering of atmospheric scattering using graphics hardware. Graphics Hardware, pp. 1-10
- Hoffman, N. and Preetham, A. J. (2002). Rendering outdoor light scattering in real time. Retrieved from http://developer.amd.com/wordpress/media/2012/10/ATI-LightScattering.pdf
- Intel Developer Zone (2012). IVB atmospheric light scattering. Retrieved from https://software.intel.com/en-us/articles/ivb-atmospheric-light-scattering