A
SEMINAR REPORT
ON
AN INTRODUCTION TO
RADIOSITY –
A RENDERING TECHNIQUE
By:-N. Thadani
ACKNOWLEDGEMENTS
The seminar report on An Introduction to Radiosity – A Rendering Technique, took me some effort, but it could not have been done without the help of a number of people. I would like to take this opportunity to thank them for their support.
Firstly I would like to thank Professor G. Potdar for taking time out to go through my entire report, giving me some useful suggestions and his approval. I would also like to thank Professor Mooghat for his basic tutoring in Calculus without which it would have been impossible for me to understand the essence of radiosity. Above all I would like to thank my brother Mr Manoj Thadani for suggesting me the topic of Radiosity, directing me to some useful links over the world wide web on the topic and for overall guidance. Once again I thank them all.
Contents
1. Introduction - A Rendering Primer
11.1 Radiosity And Ray Tracing
12. Appendix – Images Rendered Using Radiosity
13. References
Rendering essentially is the art of creating realistic
images on the computer. Creating realistic pictures involves a number of
stages. First, models of the objects are generated. Next, a viewing specification
and lighting conditions are selected. Those surfaces visible to the viewer
are then determined. The color assigned to each pixel in a visible surface’s
projection is calculated. The resulting picture can then be combined with
previously generated ones by using compositing techniques. Finally, if
we are producing an animated sequence, time-varying changes in the models,
lighting and viewing specification must be defined. The process of creating
images from models is often called rendering. Rendering techniques have
gained precedence due to a Quest for Realism.
The creation of realistic pictures is an important goal in fields such as simulation, design, entertainment and advertising, research and education, and command and control.
Simulation systems, such as flight simulators, present images that are not only realistic, but also change dynamically. Designers of 3D objects such as automobiles, airplanes, and buildings want to see how their preliminary designs look. Creating realistic computer-generated images is often an easier, less expensive and more effective way to see preliminary results.
Computer-generated imagery is used extensively in the entertainment world. Computer-generated cartoons can transcend manual techniques by introducing more complicated motion and richer or more realistic imagery at lower costs than filming them from physical models of the objects. Realistic images have become an essential tool in research and education, as computers allow larger structures to be built and studied than are possible with physical models. As technological advances are made the demand for realistic images in various spheres continually increases.
For many people, rendering means one thing: waiting. For others, it's a complex mathematical process that can be geared toward a vast range of results. A rendering engine takes a 3D scene or model, runs through some obscure mathematics to calculate how it's supposed to look, then creates an image. Different rendering engines use different techniques such as raytracing, shading, and antialiasing to make those images appear more or less lifelike. The higher the image quality the longer a scene will take to render.
Most rendering engines fall into two broad categories:
real-time engines and non-real-time engines. Rendering engines can also
be categorized as scan-line or raytrace-based.
The rendering pipeline is made up of four spaces or stages–local space, world space, eye space, and screen space–and describes the process of transforming 3D information from each stage to the next. In a generic rendering environment the process is as follows.
Objects are defined in local space (sometimes called coordinate space). In other words, before you place an object into a scene, the object has its own geometric description such as height, width, and depth, but does not yet have an orientation or relationship to other objects. This stage can also include a tessellation phase where calculated surfaces are turned into polygons.
When you place an object into a scene, its local description must be transformed into the world space. Now the object has a position and orientation relative to other objects in the space. At this stage objects are assigned surface attributes and lights are specified. Objects may also be assigned paths and other animation cues.
When you first define a view or camera position in world space, all of the objects in the scene are then transformed into eye space. Now the objects have an orientation and geometric relationship to the camera. At this stage each polygon is tested for visibility and those facing away from the camera are ignored. This is sometimes called backface elimination or culling. The camera can also be assigned animation attributes at this stage.
Next, objects in eye space are transformed into screen space. First, depending on the attributes of the camera (focal length, field of view, and so on), a view frustum is defined. Polygons completely outside the frustum are ignored and polygons that fall on the frustum boundaries are clipped. The rendering engine needs to do this since it can only deal with polygons whose vertices and edges are defined within the screen space. Also, during this transformation a lot of geometric hocus-pocus is performed on the objects to simulate and compensate for perspective distortion (things get smaller the farther away from the camera they are).
Finally, we enter what most people would consider the true rendering phase (although technically all of these steps are part of the rendering pipeline). Clipped and properly distorted polygons are projected onto a view plane or image plane. Each polygon is rasterized, evaluated for depth and facing, and shaded (not necessarily in that order). At this point antialiasing and motion blur can be applied to the polygons.
While most of the pipeline steps are fairly easy to accomplish, the last phase in the pipeline can be done using a myriad of arcane and borderline mystic techniques that address specific visual effects or help speed up the process. For example, there are all sorts of tricks for quickly determining the depth of a polygon (the most common is Z-buffer) and an entire dark and scary world of shading algorithms. The common element to all of these tricks and techniques is to make the scene look as real as possible in the least amount of time. Unfortunately, many of the tricks used to speed things up or simulate particular optical effects introduce other problems that have to be solved with other tricks (with other problems) and so on and so on.
While the first four steps are common to all rendering
pipelines, the last step can be done in many different ways, using many
techniques such as scanline rendering, ray tracing or the more recently
developed Radiosity.
This section provides a brief overview of computer graphics rendering and a conceptual understanding of the rendering techniques available.
A 3D model contains geometric data defined in relationship to a 3D Cartesian coordinate system (world space). The model may also contain other information about the material of each of the objects and the lighting. The image on a computer monitor is made up of a large number of illuminated dots called pixels. The task in creating a computer graphics image of a geometric model is to determine the color for each pixel on the screen (screen space) based on the model information and a specific viewpoint.
The color of any specific point on a surface in a model is a function of the physical material properties of that surface and the light that illuminates it. Two general shading algorithms—local illumination and global illumination are used to describe how surfaces reflect and transmit light.
Local illumination algorithms describe only how individual surfaces reflect or transmit light. Given a description of light arriving at a surface, these mathematical algorithms predict the intensity, spectral character (color), and distribution of the light leaving that surface. The next task is to determine where the light arriving at the surface originates. In a simple rendering algorithm, only the light coming directly from the light sources themselves is considered in the shading.
In considering more accurate images, however, it is important to take into account not only the light sources themselves, but also how all the surfaces and objects in the environment interact with the light. For example, some surfaces block light, casting shadows on other surfaces; some surfaces are shiny, in which case we see in them the reflections of other surfaces; some surfaces are transparent, in which case we see other surfaces through them; and some surfaces reflect light onto others. Rendering algorithms that take into account the ways in which light is transferred between the surfaces in the model are called global illumination algorithms.
Consider, the simple room shown in Figure 1.
Figure 1. Global Illumination in a Room
This room has one light source. One theory of light allows us to consider the light in terms of discrete particles called photons, which travel out from the light source until they encounter some surface in the room. Depending on the material of the surface some of these photons, traveling with particular wavelengths, are absorbed, while others are scattered back out into the environment. The fact that photons traveling at a particular wavelength are absorbed while others are not is what determines the color (also referred to as the spectral reflectance) of the surface. The way in which the photons are reflected from a surface depends primarily on the smoothness of the surface. Surfaces that are rough tend to reflect photons in all directions (Figure 2). These are known as diffuse surfaces, and this type of reflection is known as diffuse reflection.
Figure 2.Diffuse Reflection Figure 3. Specular Reflection
A wall painted with flat paint is a good example of a diffuse surface. Surfaces that are very smooth reflect the photons in one direction (Figure 3), at an angle equal to the angle at which they arrive at the surface (angle of incidence). These surfaces are known as specular surfaces, and this type of reflection is known as specular reflection. A mirror is an example of a perfectly specular surface. Of course, many materials display some degree of both specular and diffuse reflection. The final illumination of the room is determined by the interaction between the surfaces and the billions of photons that are emitted from the light source. At any given point on a surface, it is possible that photons have arrived directly from the light source (direct illumination) or else indirectly through one or more bounces off some other surfaces (indirect illumination). If you were standing in the room, a very small number of the total photons in the room would enter your eye and stimulate the rods and cones of your retina. This stimulation would, in effect, form an image that is perceived by your brain (Figure 1).
In computer graphics we replace the rods and cones
of a retina with the pixels of the computer screen. One goal of a global
illumination algorithm is to recreate, as accurately as possible, what
you would see if you were standing in a real environment. A second goal
is to accomplish this task as quickly as possible; ideally in real time
(30 images per second). There is currently no single global illumination
algorithm that can accomplish both of these goals.
There are two basic approaches to rendering; Scanline rendering and raytracing. The difference is your point of view–or more accurately the renderer's point of view. The scanline approach is roughly equivalent to posing the question "if the scene really existed in 3D and you looked at it through a screen window what would you see through the first tiny hole (pixel), and the next and the next?" A scanline rendering engine draws an imaginary line from the viewer's eye, through a single pixel on the CRT, and into the imaginary 3D scene to determine what element(s) would be visible. Depending on what color or texture has been assigned to the object the pixel is then colored appropriately and the rendering engine goes on to the next pixel and the next, one scanline at a time until the last pixel has been colored.
One problem with this approach is efficiently determining what can be
seen and what can't. Early scanline renderer’s used a simple brute force
approach–render everything starting with objects farthest away from the
viewer. If something in the foreground covers up something in the background,
simply redraw the pixel. While this approach does work, it isn't very efficient.
One trick that rendering engines use to avoid redrawing the same pixels
over and over again is to calculate which objects will be occluded by other
objects before going to the trouble of rendering them to the screen. This
is what Z-buffering accomplishes. Before rendering anything to the screen,
the engine assigns each polygon a Z value indicating the distance away
from the screen. When it comes time to render, the engine picks the polygon
with the lowest Z value and doesn't bother rendering the others. This speeds
up rendering considerably.
Figure 4. 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 (Figure 4).
1. A ray is traced back from the eye position, through the pixel on the monitor, until it intersects with a surface. When the imaginary line drawn from the eye, through a pixel, into a scene strikes a polygon three things happen.
2. First, the color and brightness values are calculated based on direct illumination from lights directly striking that polygon. 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.
3. Next, the angles of reflection and refraction (the bending of light as it passes through a transparent object such as water) are calculated. Based on the surface's assigned reflectivity and/or transparency, the ray splits and continues off in two new directions. 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.
4. 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. Each ray continues bouncing around the scene until it hits a light source, leaves the scene, or reaches some arbitrary number (recursion level). When all the rays have completed their journeys the intensity and color values are combined and the pixel is painted.
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.
Inverse raytracers start with the lights in a scene and calculate where (and to some extent how) the zillion rays of light will bounce around the scene and if they will eventually pass through a given pixel and ultimately reach the eye of the beholder.
You can imagine how this approach could easily avalanche into literally billions of calculations. Raytracing engine designers usually let the user determine how far to let the engine go by providing different levels of recursion (how many objects must a ray strike before you give up). Many times they will also provide a few recursion presets (good, better, best).
The advantages of the raytracing technique are that things such as reflections and refraction are calculated accurately so light bouncing off a mirror or passing through a glass of water gets bounced or bent the same way it does in real life. A raytracer can also calculate shadows as it works. When a ray strikes a polygon the engine can try to draw rays from that point directly to light sources. If there is no direct line to a light then the polygon is in shadow.
4.1 Disadvantages Of Ray Tracing
The main disadvantage of ray tracing is that the process can be computationally expensive and slow for environments of even moderate complexity. Also not all behaviors of light are accounted for. For example if a red object is in front of a white object then some of the red will appear on the white background. Another behavior of light that isn't usually handled by the raytracing technique is diffraction or the scattering of light as it bounces off objects—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. Look under your desk and you can still see your feet even if the light isn't shining directly on them. Much of the light that is illuminating your feet was diffracted off other objects in the room.
In the real world light rays don't behave like laser beams in a house of mirrors. While the majority of the photons (assuming we are using the particle view of light) will bounce off objects in a fairly predictable manner, like a billiard ball bounces off a rail, some of the photons will scatter in all directions. Now you might ask, "who cares about a few stray photons?" In reality a few trillion strays bounce around our world all the time. If the raytrace renderer only follows the big bouncing balls then the scene is rendered very starkly–shadows have sharp edges, reflected lights have sharp edges, and recursive reflections remain in sharp focus. Another effect of raytracers is that objects that are illuminated directly are rendered accurately but everything not directly illuminated by a light source is pitch black. Many rendering engines use one of two tricks to get around this problem; they either add a universal light that illuminates everything or they can pretend that every object in a scene is also a light source emitting a very slight glow.
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.
Radiosity or Secondary Illumination is the ability of materials physical properties to reflect light and to impinge upon other materials as if it were a second source of illumination. As an example, lets consider the intersections of two walls in a corner (i.e. orthogonal to each other), one painted white and the other red. From real experience we know that when this scene is illuminated by some lightsource, we won’t get a simple red wall and white wall. In fact depending on the paint (Matt or gloss) some of the light hitting the red wall will bounce off it and hit the white wall, producing a slightly reddish tint to certain sections of the white wall. And the exact same thing happens with the white wall; it will impinge upon the red wall. This will happen for all real materials and for all lightsources. Of course theoretically you can conjure up materials and light sources with such properties as not to omit secondary illumination, but they DO NOT exist in reality. No matter how subtle the light or dull the object, radiosity is occurring even if you can’t see it
Normal raytraced rendering CAN NOT reproduce secondary illumination. The reason for this is that raytracing is exactly that, tracing the mathematical paths of photons (particles of light) from light sources. But raytracing does more than this, it not only calculates where the photons should go from a light source, but also how they should react with the properties of materials they hit. That is why raytracing can reproduce such things as transparency, reflection and refraction etc, to a high degree of accuracy. But it can not produce secondary sources of light. For instance, in the above example of a red and white wall, what is really happening, is that photons from the light source are hitting the red wall, and the majority of frequencies (colours) making up the light source are being absorbed by the material. Those photons are then dissipated through the material, mostly as vibrations which generate heat, and are quantised, called phonons. But a small majority of the frequencies of the light source is reflected/emitted by the material. In this case it is the frequencies that compose the red part of the visible color spectrum (in fact you also get a lot more reflected such as infra red etc). So fundamentally what the red wall has done, is take a normal white light source, and where ever the light hits the wall, created a secondary RED light source due to reflection. And the same thing is happening with the white wall, except the majority of light is now being reflected. In the real physics of it, there is no "real" reflection, but rather just secondary emission of photons. Photons from a light source hit the material, some get dissipated as heat vibration, some get absorbed by electrons, the electrons go up in energy, they don't like being there, so they get rid of this extra energy in the form of another photon. And that put very simply is the process of optical reflection (the same theory works for radiation, in fact the same theory works for a lot of physical phenomena). Raytracers don't create secondary photons. They stick with the same photon, calculate its path and interactions due to material properties, but their FREQUENCY ALWAYS REMAINS THE SAME.
As well as colour being projected upon
other objects from certain materials, we also have the fact that a secondary
source actually is just that, a second source of illumination. Hence
we have objects creating "highlights" due to them acting as second sources.
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. Their approach was based on the thermal-engineering models for the emission and reflection of radiation, which eliminates the need for ambient lighting term by providing a more accurate treatment of interobject reflections. First introduced by Goral, Torrance, Greenberg and Battaile and by Nishita and Nakamae, these algorithms assume the conservation of light energy in a closed environment. All energy emitted or reflected by every surface is accounted for by its reflection from or absorption by other surfaces. The rate at which energy leaves a surface, called its radiosity, is the sum of the rates at which the surface emits energy and reflects or transmits it from that surface or other surfaces. 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.
Figure 5. Radiosity
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 (Figure 5).
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. We shall discuss progressive refinement in greater detail under
Radiosity Algorithms.
As mentioned earlier, the radiosity methods allow any surface to emit light; thus all light sources are modeled inherently as having area. Imagine breaking up the environment into a finite number N of discrete patches, each of which is assumed to be of finite size, emitting and reflecting light uniformly over its entire area. If we consider each patch to be an opaque Lambertian diffuse emitter and reflector, (Lambertian surfaces appear equally bright from all viewing angles because they reflect light with equal intensity in all directions) then, for surface i
Bi = Ei + ri S1< j < N Bj Fji Aj
Ei is the rate at which light is emitted from patch i and has the same units as radiosity.
ri is patch i’s reflectivity and is dimensionless.
Fji is the form factor between patches j and i which specifies the fraction of energy leaving the entirety of patch j and reaching the entirety of patch i, taking into account the shape and relative orientation of both patches and presence of any obstructing patches.
The equation above states that the energy leaving a unit area of surface is the sum of the light emitted plus the light reflected. The reflected light is computed by scaling the sum of the incident light by reflectivity. The incident light is in turn the sum of the light leaving the entirety of each patch in the environment scaled by the fraction of that light reaching a unit area of the receiving patch. Bj Fji is the amount of light leaving a unit area of Aj that reaches all of Ai. Therefore, it is necessary to multiply by the area ratio Aj/ Ai to determine the light leaving all of Aj that reaches a unit area of Ai.
Conveniently, a simple reciprocity relationship holds between form factors in diffuse environments,
Ai Fij = Aj Fji
Thus the equation gets simplified to
Bi = Ei + ri S1< j < N Bj Fij
Rearranging terms
Ei = Bi - ri S1< j < N Bj Fij
This gives the interaction of light among the patches as a set of simultaneous equations, which can be solved using Gauss Siedel method to calculate the light being emitted by each patch. The following matrix equation is obtained:
The simultaneous equations must be solved for each
band of wavelengths considered in the light model, since ri
and
Ei are wavelength dependent. The form factors are solely a function
of geometry, and thus do not need to be recomputed if the lighting or surface
reflectivity changes.
Form-factors define the fraction of energy leaving a given surface that arrives at a second surface directly. This is the essence of radiosity.
There are two algorithms for the calculation of form-factors: hemisphere and hemicube. Hemisphere sampling requires finding the intersection of the patch and the hemisphere surface, and then projecting the intersection down to the floor of the hemisphere to get the form-factor. This is a very computationally expensive task. So, the hemicube method was developed.
The area of the hemicube that intersects with the patch's radiation is the same as the projection from the hemicube surface to the floor. So, the form-factor is simply the area of intersection with the surface of the hemicube. This eliminates much of the computation that was necessary with the hemisphere algorithm. Each section of the hemicube is a pixel to make things easier.
The calculation of form-factors can consume up to 80% of the total computation. This makes it the computation bottleneck for the radiosity method. For this reason, this is the area that has consistently received most of the attention from researchers.
Figure 2.Computing the form factor between a patch and differential area.
Consider the two patches shown in Fig 2. The form factor from differential area dAi to differential area dAj is
dFdi dj = (Cos qi Cos qj Hij dAj )/ pr2
The above equation can be obtained by projecting those parts of Aj that are visible from dAi onto a unit hemisphere centered about dAi, projecting this projected area orthographically down onto the hemisphere’s unit circle base and dividing by the area of the circle. Projecting onto the unit hemisphere accounts for Cos qj/r2, projecting down onto the base corresponds to multiplication by Cos qi, and dividing by area of unit circle accounts for p in the denominator.
The final form factors can be calculated using the following equation.
Fij = 1 òò (Cos
qi
Cos
qj
Hij dAj
dAi
) /pr2
Ai
This method of form factor calculation is computationally expensive as it involves performing the integration for all pairs of patches in the scene. To circumvent this problem the Hemicube method was developed.
In this method the patch Aj is projected onto the upper half of a cube centred about dAi. Each face of this hemicube is divided into a number of equal size square cells. Each hemicube cell p is associated with a precomputed delta factor value,
D Fp = (Cos qi Cos q p D A) / p r2
where qp is the angle between p’s surface normal and the vector between dAi and p, r is the length of this vector and D A is the area of a cell. By suitable approximations the above equation can be reduced to a rational fraction free from trignometric ratios and integrals. Also due to symmetry the values of D Fp need to be computed for only one-eigth of the top face and one-quarter of a single side half face.
We can approximate Fij for any patch j by summing the values of D Fp associated with each cell p in Aj’s hemicube projections.
Any radiosity algorithm will run into O(n2)
(n = number of patches in the scene) complexity for form factor calculation.
As such, this part becomes the real bottleneck of the entire procedure
and needs to be dealt with in greater detail. In the next chapter we shall
consider some radiosity algorithms which will try and enhance this procedure.
As mentioned in the previous chapter that calculation of form factors creates a bottleneck in the radiosity algorithm. On the other hand, the finer the patch parametrization, the better the results. This implies enhancement of the image at the cost of computation time. Here we discuss a few methods to alleviate the problem.
To discuss the algorithms, we will need some notation. Let k denote the number of input surfaces (typically polygons), n the number of patches into which the surfaces are subdivided during meshing, and v the cost of determining visibility between a pair of points in the scene. In a simple implementation, v=O(k), but with good data structures and enough memory, v = O(k1/3) or O(logk) is achievable. Here we examine the foundation for the fundamental algorithms: the three basic classes of algorithms for radiosity rendering.
The first of these is matrix radiosity, which explicitly computes a large form factor matrix and solves several large systems of equations. First, the scene is discretized into patches, then form factors are computed. The resulting n´ n linear system of equations is typically solved using an iterative method such as Gauss-Seidel iteration. Computing the matrix is the most costly step. It takes O(n2v) time because n2 form factors must be computed and each one requires one or more visibility tests. Solving takes only O(n2) time in practice because only a small, fixed number of iterations each of cost O(n2) is typically required. Visibility can be tested either using a hemicube, in which case the amortized cost of visibility can be v=O(1). Because it is so expensive in time and space, we do not expect matrix radiosity to be competitive with the other methods.
The second of these is progressive radiosity, which progressively refines the image by computing the matrix and the solution incrementally. Progressive radiosity iteratively "shoots" light from the brightest light sources and reflective surfaces, computing just one column of the form-factor matrix at a time. The method can be explained as follows.
The matrix radiosity method gathers the light from the rest of the environment by calculating radiosity for each patch using
Bi due to Bj = riBjFij, for all j.
The progressive refinement method shoots radiosity from a patch into the environemnt by using
Bj due to Bi = rjBiFji, for all j.
Unfortunately this requires determining Fji for each j which imposes the same large space-time overhead. However by using reciprocity we can rewrite the above equation as
Bj due to Bi = rjBiFijAi/Aj, for all j.
Evaluating this equation for each j requres only the form factors calculated using a single hemicube centred about patch i, which can be discarded as soon as the radiosities shot from patch i have been computed.
If s shooting steps are used, the time cost is O(nsv). In practice it converges much faster than matrix radiosity, so s<<n. Progressive radiosity has the added advantage that storage is only O(n), since matrix columns are discarded after they are used.
The progressive refinement radiosity algorithm works in the following way:
1. 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
3. 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).
4. The process continues until most of the energy in the environment has been absorbed (energy equilibrium) and the simulation reaches a state of convergence.
Progressive radiosity is very often used along with substructuring, which speeds up the algorithm greatly.
In this method patches are adaptively subdivided into subpatches at places where a high radiosity gradient is found. The subpatches are not treated like full-fledged patches. The form factors Fsj from each subpatch s to each patch j are computed using hemicube technique but form factors from j to s are not computed. After a patch has been broken into subpatches the previously calculated values of each form factor from the patch to other patches are replaced by the more accurate area-weighted average of the form factors from its m subpatches:
Fij = (1 / Ai) S1£ s £ m Fsj As.
Substructuring allows subpatch radiosities to be
determined without changing the size of the matrix to be solved.
The final class of methods is called wavelet radiosity. These methods employ multilevel meshes to represent the radiosity function, and allow inter-patch interactions to take place between arbitrary levels of the mesh hierarchy. Thus, unlike previous methods, wavelet radiosity methods do not use a fixed mesh, but a mesh that is adaptive to the other surface "viewing" them. When reflecting light to a distant surface, a given surface is meshed coarsely, but when reflecting to a nearby surface, it is meshed more finely. Theoretically, wavelet radiosity methods cost O(k2v + nv).
All three of these can be regarded as different methods for approximating and solving the integral equation governing radiosity. The kernel of the integral equation is approximated in one of the above ways to create the matrix for the system of equations that is solved.
Currently the most commonly implemented radiosity
algorithm is probably progressive radiosity. The commercial system from
Lightscape for example, uses progressive radiosity. Wavelet radiosity is
primarily a research topic, and only a handful of implementations exist.
This is largely due to the added complexity in implementing the wavelet
radiosity algorithms.
Given below is a psuedo code for radiosity algorithm using progressive refinement and sub structuring.
for (each patch i) {
D Bi = Ei;
for (each subpatch s in i)
Bs = Ei;
}
while(not converged) {
Select patch i with greatest D BiAi;
Determine
Fis for all subpatches s in all patches;
/* Shoot Radiosity from patch i */
for (each patch j seen by i) {
for (each subpatch s in j seen by i) {
D Radiosity = rjDBiFisAi/As;
Bs += D Radiosity;
D Bj += D Radiosity As/Aj;
}
}
if(radiosity gradient between adjacent patches is too high)
subdivide offending patches and reshoot from patch i to them;
D Bi = 0;
perform view dependant visible surface determination and shading;
} /* End While */
Radiosity has few very serious shortcomings which we discuss below
A certain highlight can be observed on objects such as waxed apples or shiny plastics. This phenomenon is due to specular reflection. Such objects when viewed from different angles display the highlight at different points. This is because shiny surfaces reflect light unequally in different directions; on a perfectly shiny surface light is reflected only in the direction of the reflected ray.
The radiosity methods described so far are unable to correctly model the phenomenon of specular reflection. This is because radiosity leaving a patch in any direction is influenced by the patch’s total radiosity, not by the directions from which its incoming energy was acquired. Although the hemisphere method can be modified to handle specular reflection the overhead involved in it renders the method impractical for moderately complex scenes.
The hemicube method for calculation of form factors makes a few assumptions, which bring about certain failings in the method.
Light sources must be finely meshed in order to produce soft shadows.
However, in doing so we also force other, non-shadow casting surfaces in
the scene to be more finely meshed, and thus drastically increase running
time. It would be better to mesh the light sources to a greater extent
than other objects in the scene, and high-reflectance objects more heavily
than low-reflectance ones. This is where wavelet radiosity has an advantage,
with its ability to effectively subdivide the source mesh based on the
current illumination in the scene.
There are several applications where radiosity methods are better suited for the task than ray tracing methods:
Radiosity as a rendering technique can give some remarkable results. A few images have been attached at the end of this report to give an idea of the image quality that can be obtained using this technique. Although the radiosity methods give much more realistic images than ray tracing they are not as widely used as ray tracing. This is partly due to the popularity and ease of ray tracing and partly due to the inherent complexity involved in implementing the radiosity algorithms.
Despite this there are certain packages which use radiosity for rendering. One such example is Lightscape, a rendering software used to model the internal architecture of buildings. Currently radiosity is still a topic of research and it will be still some time before it is widely accepted. One variation of radiosity, which even lightscape uses, is a combination of radiosity and ray tracing.
11.1 Radiosity And Ray Tracing
Radiosity methods are well suited to diffuse reflection, but cannot model specular reflection accurately. In contrast ray tracing calculates specular reflection well since the eye point is known in advance. Hence it makes sense to combine the 2 methods, so that one can take advantage of the other. But simply summing the pixel values computed by a diffuse radiosity method and a specular ray tracer will not suffice. This is because the radiosity method will fail to take into account the extra illumination falling on the diffuse surface from the specular surface. Hence it is necessary to account for transfers from diffuse to diffuse, diffuse to specular, specular to diffuse, and specular to specular reflection. Although the method sounds very tedious, it is not entirely so, and some noteworthy implementations of this technique do exist.
All in all, radiosity techniques form a useful
tool for rendering images in our Quest For Realism.
1. Computer Graphics – principles and practise
By – Foley van Dam & Feiner Hughes
2. Introduction To Radiosity
www.student.nada.kth.se/~f96-mry/radiosity/radiosity/node2.html
3. A Rendering Primer
www.3dgate.com/techniques/000424/0424rendering.html
4. Overview Of Technology Used In Lightscape
www.lightscape.com/overview/default.asp
5. Radiosity Algorithms – A Technical report
www.cs.cmu.edu/~radiosity/emprad-tr.html