Lighting simulation techniques

 

 

 

 

 

 

 

 

By

Mladen Stamenic

 

Approved by professors: Ιωάννης Βενέρης Βυριράκης Λ. Ρηγόπουλος Δ.

 

National Technical University of Athens

2003


 

 

 

 

 


 

Introduction

          

                   What is lighting simulation?

 

Lighting simulation is technique for presentation of lighting conditions in determent space with help of different computing technologies.

 

                   We can divide them in 4 categories:

 

1.      High quality rendered with real situation of lighting layout.

2.      High quality rendered with fake layout of lighting.

3.      Real time rendered with real situation of lighting layout.

4.      Real time rendered with fake layout of lighting.

 

Explanation what every category means

 

1.      I will analyze the first category in my work here. There is no need for short description.

 

2.       High quality rendered with fake layout of lighting is technique for presentation of 3D model with help of basic lights: spot, point and direct lights. The point is to make layout of lights just to achieve reality of modeled object and surrounding space. Sometimes that is enough to represent virtual space; method is highly perfected by FX and post-production studios. Its very fast for computing and give us very good results in output. Bed side is that most of rendering software which is using that method is very limited. Best software is Pixar’s  Renderman and Mental Image’s Mentalray. Most of CAD and animation packages use that method.

 

 

3.      Real time rendered with real situation of lighting layout. This method is in research and development. I don’t have enough data to describe its possibilities.

4.      Real time rendered with fake layout of lighting is very known method which we call VR (virtual reality) it uses basic lights and illumination results are like in method 2. Difference is in accuracy, because it is based on rendering engines which exploit power of VGA and non floating point computing, .accuracy is low. This method is in wide use for development of 3d video games.

 

 

Physically accurate lighting simulation techniques with real-world lighting and layouts

 

 

                   What is physically accurate lighting simulation technique?

 

It is rendering technology that realistically simulates the way in which light interacts in an environment. That means layout of lights are same the like in real-world, there is no need for fake lights (back lights, fill lights, main lights). Lights can be basic or photometric lights.

 

                   What is photometry?

 

Photometry is a technique which was developed to measure light taking into account the psychophysical aspects of the human eye/brain system. Four photometric quantities are used in the lighting simulation system:

 

Luminous flux

Illuminance

Luminance

Luminous intensity

 

Luminous flux is the quantity of light energy per unit time arriving, leaving, or going through a surface. The unit of luminous flux is the lumen (lm), which is used in both the International System (SI) of Units and in the American System (AS) of Units. If we think of light as particles (photons) moving through space, then the luminous flux of a light beam arriving at a surface is proportional to the number of particles hitting the surface during a time interval of 1 second.

 

Illuminance is the luminous flux incident on a surface of unit area. This quantity is useful for describing the level of illumination incident on a surface without making the measurement dependent on the size of the surface itself. The SI unit of illuminance is the lux (lx), which is equal to 1 lumen per square meter. The corresponding AS unit is the footcandle (fc), equivalent to 1 lumen per square foot.

Part of the light incident on a surface is reflected back into the environment. The light reflected off a surface in a particular direction is called luminance, the quantity that is converted to display colors to generate a realistic rendering of the scene. Luminance is measured in candelas per square meter or candelas per square inch. The candela was originally defined as the luminous intensity emitted by a single wax candle.

Finally, luminous intensity is the light energy per unit time emitted by a point source in a particular direction. The unit of measure of luminous intensity is the candela. Luminous intensity is used to describe the directional distribution of a light source—that is, to specify how the luminous intensity of a light source varies as a function of the outgoing direction.

 

                   Some software has native support to use photometric data for simulations and calculations. There are lot of different types of photometric data, most recognized is IES file (IES LM-63-1991 standard file format for photometric data. (IES stands for Illuminating Engineering Society.)). That file contents data related to luminary which has to be use in light simulation.

 

                  


Simulation techniques

 

                   There are four kinds of light simulation techniques

 

                   Radiosity based

                   Ray Tracing

                   Based on Monte Carlo and Quasi Monte Carlo computation methods

                   Hybrid ((Radiosity and Ray Tracing) and (MC, QMC and Ray Tracing))

 

                   Radiosity

 

                   To address some of the shortcomings of the ray tracing algorithm, researchers began investigating alternate techniques for calculating global illumination. In the early 1960s thermal engineers developed methods for simulating the radiative heat transfer between surfaces. Their goal was to determine how their designs would perform in various applications such as furnaces and engines. In the mid-1980s, computer graphics researchers began investigating the application of these techniques for simulating light propagation. Radiosity, as this technique is called in the computer graphics world, differs fundamentally from ray tracing. Rather than determining the color for each pixel on a screen, radiosity calculates the intensity for discrete points in the environment.

This is accomplished by first dividing the original surfaces into a mesh of smaller surfaces known as elements. In the radiosity process, the amount of light distributed from each mesh element to every other mesh element is calculated. The final radiosity values are stored for each element of the mesh (picture 1).

 

Figure 5. Radiosity 

Picture 1 Radiosity

 

Early on, the radiosity algorithm was formulated in such a way that the distribution of the light among all the mesh elements had to be completely calculated before any useful results could be displayed on the screen. Even though the end result was view independent, the preprocessing took a considerable amount of time. In 1988 this preprocessing portion of the radiosity algorithm was reformulated. The new technique, referred to as progressive refinement radiosity, allows users to obtain immediate visual results, which progressively improve in accuracy and visual quality.

The progressive refinement radiosity algorithm used in Lightscape works in the following way:

The surfaces are meshed into a set of relatively large elements. The initial elements can be subdivided automatically into smaller elements in areas where a significant intensity difference is detected between adjacent mesh elements (for example, across shadow boundaries).

Light is distributed from each luminaire to all surfaces in the environment. (A luminaire is a light fixture, with one or more lamps and housing.) In this calculation, surfaces can block other surfaces, casting shadows.

Depending on the characteristics of the surface material, some of the energy reaching a particular mesh element is absorbed, while the remaining energy is reflected into the environment. An important assumption in radiosity is that all the surfaces are "ideal diffuse" (Lambertian)—that is, they reflect light equally in all directions.

After distributing the energy from each primary light source (direct illumination), the progressive radiosity algorithm continues by checking all the surfaces and determining which surface has the most energy to be reflected. This surface is then treated as an area light source emitting the reflected energy to all the other surfaces in the environment (indirect illumination).

The process continues until most of the energy in the environment has been absorbed (energy equilibrium) and the simulation reaches a state of convergence.

Each distribution of light from a luminary or surface, as just described, is called an iteration. The number of iterations required for a simulation to reach a state of convergence varies depending on the complexity of the environment. Because the iterations are sorted to calculate the surfaces with the greatest energy first, the rate of convergence for the radiosity solution is much faster in the beginning. Toward the end, the amount of energy remaining to be distributed is so small that there is no perceptible difference in the resulting images from one iteration to the next. Therefore, while it may take a large number of iterations for a solution to reach full convergence, the process can typically be interrupted before this point is reached, because an acceptable solution has been obtained.

 

 

                   Ray Tracing

One of the first global illumination algorithms to be developed is known as ray tracing. In ray tracing it is recognized that while there may be billions of photons traveling about the room, the photons we primarily care about are the ones that enter the eye. The algorithm works by tracing rays backward, from each pixel on the screen into the 3D model. In this way, we compute only the information needed to construct the image. To create an image using ray tracing, the following procedure is performed for each pixel on the computer screen

 (Picture 2).

A ray is traced back from the eye position, through the pixel on the monitor, until it intersects with a surface.

We know the reflectivity of the surface from the model description, but we do not yet know the amount of light reaching that surface. To determine the total illumination, we trace a ray from the point of intersection to each light source in the environment (shadow ray). If the ray to a light source is not blocked by another object, the light contribution from that source is used to calculate the color of the surface.

The intersected surface may be shiny or transparent. In this case we also have to determine what is seen in or through the surface being processed. Steps 1 and 2 are repeated in the reflected (and, in the case of transparency, transmitted) direction until another surface is encountered. The color at the subsequent intersection point is calculated and factored into the original point.

If the second surface is yet again a reflective or transparent surface, the ray tracing process repeats once again, and so on, until a maximum number of iterations is reached or until no more surfaces are intersected.

Figure 4. Ray tracing 

Picture 2. Ray tracing

Ray tracing is a very versatile algorithm because of the large range of lighting effects it can model. It can accurately account for the global illumination characteristics of direct illumination, shadows, specular reflections (for example, mirrors), and refraction through transparent materials. The main disadvantage of ray tracing is that the process can be computationally expensive and slow for environments of even moderate complexity.

Another significant disadvantage of ray tracing is that it does not account for one very important characteristic of global illumination—diffuse interreflections. With traditional ray tracing, only the light arriving directly from the light sources themselves is accurately accounted for. But, as shown in the room example, light does not only arrive at a surface from the light sources (direct lighting), it also arrives from other surfaces (indirect lighting). If we were to ray trace an image of the table, as shown in the example, the area under the table appears black because it receives no direct light from the light source. We know from experience, however, that this area would not really be completely dark because of the light it would receive from the surrounding walls and floor.

In traditional ray tracing this indirect illumination is often referred to as ambient light; it is usually accounted for by simply adding an arbitrary value that has no correlation to the physical phenomena of indirect illumination and is constant throughout space. For this reason, ray traced images often appear very flat. This is particularly true for renderings of architectural environments, which typically contain mostly diffuse surfaces.

 

                   Monte Carlo and Quasi Monte Carlo computation methods

 

Monte Carlo sampling is a method for numerical computation of integrals of functions by evaluating these functions at a number of random points. Quasi Monte Carlo sampling is a modification of this method, which instead of randomly generated points uses points forming a low-discrepancy sequence, which are more evenly distributed than purely random ones. This is the method used by application to evaluate complex things like global illumination, blurry reflections, depth of field, motion blur and image antialiasing.

                   The light sources in the scene are usually small, therefore most light within the scene usually comes from a small area. In many cases, the surfaces are specular, and the light is reflected into a small area as well. Monte Carlo and quasi Monte Carlo [Shri65] ray tracing methods are powerful tools to solve the integral equation, because they can provide a good estimate for the typical functions in computer graphics, where other numerical methods fail.

The goal of the ray tracing process is to determine the amount of light arriving to the observer through the pixels of the image. To do that, Monte Carlo ray tracing algorithms generate light transport paths in the object space that carry a given amount of light from a light source to the camera, and estimate the amount of incoming light with these sample light paths. Since our computational capacity is limited, we would like to compute the image by computing as little light paths as possible. To achieve this, we need an algorithm that generates paths that carry much light (and hence contribute to the final image significantly), and that does not generate paths that carry little amount of light.

 

 

 

 

 


                   Hybrid ((Radiosity and Ray Tracing) and (MC, QMC and Ray Tracing))

 

This method is very present in practice and unifies different approaches to lighting computations. That is a blend of different technologies which are working in conjunction. Main problem is how that works to produce good result. For example: If we want to do simulation of a room with hybrid system application, we must set lot of parameters manually to coordinate all process. In the case of Lightscape we have combination of Radiosity and Ray trace methods, for diffuse reflections Lightscape is using Radiosity , for accurate shadows and reflections Ray trace method. Latest software like 3dsmax5 and 3dsviz4 are using these two plus Monte-Carlo and Quasi Monte Carlo methods. Idea is to use Radiosity for diffuse distribution of light and with help of QMC to calculate final out to image file with all details.

 

 

Comparison of Radiosity and Monte Carlo and Quasi Monte Carlo computation methods

 

 

                   I will try to compare these different technologies using one file and sky light only, because all programs are using this kind of illumination.

                   Focus will be on ratio between speed and quality in production environment. For testing, I chose AutoDesk VIZ 4 for radiosity and third party plug-ins Brazil public beta and Vray demo for MC, QMC methods. Model of my choice is one one-story building with enough complicity to use 100% of CPU power. Because radiosity is very sensitive on way of model creations (no surfaces must be overlapped, every even smallest gap can produce unexpected results) I was trying to make it right. Point is to show all advantages and weakness of all methods one by one.

                   Brief description for all renders which I will use:

 

                   AutoDesk Viz 4 is using new kind of radiosity algorithm, which possibly is fastest on market. Viz radiosity is different of Lightscape radiosity (this one use pure radiosity, described in text above) because it use advanced vertex shading tools (that is the reason why we can paint the light on surface). This tools are widely used in computer games (Quake, Max Payne..etc). From the side of orthodox lighting design these features are blasphemy. That feature can help to increase softness of radiosity solution, speed for not very complicated models is real-time (Lightscape did this with increasing number of divisions in particular mesh element (patch) which led to long calculating times. Loss of accuracy is evident, but there is an old idiom in engineering that says "everything is a compromise".

                   Vray is plug-in render for 3dsmax and AutoDesk Viz. Beside of different rendering factures it offers and very good Global Illumination rendering engine. Vray’s GI is Quasi Monte Carlo based and use two type of calculations

 

                   Direct computation

Direct computation is a simple algorithm that traces all rays needed to compute the GI, it produces most accurate results, however at the price of longer rendering times.

                   Irradiance maps method

Irradiance map is an algorithm that uses sophisticated caching techniques and produces less accurate results with better rendering times.

 

                   Brazil r/s is plug-in render for 3dsmax and AutoDesk Viz. Like a Vray has implemented GI which is QMC based.

 

 

 

 

 

 


TEST

 

 

                   QMC candidates

 

Vray optimal settings (irradiance map: -3,0; antialiasing: adaptive subdivision 0,3; other sethings are default), on Pentium 4 2.4 GHz  512 Mb 333 MHz DDR RAM. Resolution : 1280x960, rendering time: 12,33’

 

 

 

 

 

 

 

 

Brazil r/s optimal settings (shade rate: -0,0; image sampling -3,1; other sethings are default), on Pentium 4 2.4 GHz  512 Mb 333 MHz DDR RAM. Resolution : 1280x960, rendering time: 19,1’

 

 

 

 

 

 

 

 

 

 

 

 

 

 

                   Radiosity candidates

 

AutoDesk Viz 4 settings: radiosity initial quality 65%, mesh size 0,2m, filter radius 4;

 radiosity computation time is 9,14’; rendering time: 30’’ (no regathering of indirect illumination)  19,40 (with regathering of indirect illumination: rays per sample 96; filter radius 2.5)

 

 

 

 

 

 

 

 

 

Conclusion

 

 

In presented images, we can recognize what is the difference between two concepts for light simulation.

                   QMC RENDERS

                   QMC images have more contrasts and much accurate shadow gradients then radiosity image (image without pixel regathering). Image loocks more real due to built in soft shadows. Both renders Vray and Brazil r/s are relatively slow. Vray render shows dark spots around windows due to inaccuracy of irradiance map. Brazil r/s is loosing details because of integrated interpolation inside of rendering engine. GI stains (grainy look) are visible and removing them will increase rendering time more than 3 times.

 

 

                   RADIOSITY BASED RENDER

Radiosity offers much faster rendered. Contact lines between floors (model has been made in ADT 3.3) are visible due to inaccurate light dispersion on diffuse surfaces. Enabling regather of indirect illumination increase time 38.8 times (from 30’ to 19,40’). When render use that hybrid functions image becomes grainy (GI stains characteristic of QMC computations).

                   All methods have good and bad sides, its going to be dead race in next few years. New trends are heading to newer technologies (photon tracing and real-time radiosity), future  of lighting simulation is in hardware support for Global Illumination. More close to true is that innovation will come from the world of computer games, because that market is in great expansion than architectural visualizations and lighting design.

 

Bibliography (links)

 

http://www.discreet.com

http://www.autodesk.com

http://www.newtek.com

http://www.softimage.com

http://www.mentalimages

http://www.vrayrender.com

http://www.splutterfish.com

http://hdri.cgtechniques.com

http://erco.com

http://graphics.ucsd.edu

http://graphics.stanford.edu

http://www.graphics.cornell.edu