170 likes | 650 Views
Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004 Computer Graphics Ray Tracing Radiosity Texture and Surface Details Modeling Volumetric Rendering Graphics Hardware and other important components of a realistic model of an object Render
E N D
Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004
Computer Graphics • Ray Tracing • Radiosity • Texture and Surface Details • Modeling • Volumetric Rendering • Graphics Hardware • and other important components of a realistic model of an object
Render • To render is to create 2-D drawings. • Based on 2, 3 or higher dimensional worlds. • Simple light rendering involves bouncing light off of objects and into a person’s eye. • Limitation of simple rendering: Not a whole lot of realism compared to other methods.
Different techniques • Different techniques of rendering light: • Simple light rendering. • Ray tracing. • Global illumination. • Radiosity. • Phong Model.
The Phong Model • Commonly used in computer graphics today. • Light at any given point is made of 3 components: • Diffuse: represent reflection that is not directional in nature. • Specular: characterize reflections that are highly directional. • Ambient: Accounts for light generated from interobject reflections.
Another way of rendering light: Global Illumination • Refers to a class of algorithms used in 3D CGs which takes into account not only the light which has taken a path directly from light source, but also light which has undergone reflection from other surfaces. • Images rendered using global illumination algorithms are considered more realistic. • Algorithms are much slower and computationally expensive than simple rendering. • Radiosity is an example of global illumination.
Radiosity • Alternative to Phong model; better approximates the interaction of diffuse surfaces. • It is an addition to typical 3D rendering methods that increases the realism of any given image by a multitude. • Allows the light to bounce off objects onto yet more objects and then into the person’s eye. • Allows us to imitate what happens in real life!!! • Results in “color bleeding”.
Reason for Radiosity • Results are detailed analysis of light reflections off diffuse surfaces. • Images that result from a radiosity renderer are characterized by soft gradual shadows. • Typically used to render images of the interior of buildings; create photo-realistic results for scenes comprised of diffuse reflecting surfaces.
Radiosity Model • Original radiosity system developed by Goral. • Method based on a simple model of energy transfer. • At each surface in a model the amt. of energy that is given off is comprised of the energy that the surface emits internally, plus the amt. of energy that is reflected off the surface. • Basically: The radiosity of a surface is the energy that is given off. • Radiosity equation:
Radiosity Pipeline • The following is a list of procedures that a radiosity renderer would take in computing a scene: • Generate Model • Compute Form Factors • Solve Radiosity Matrix • Render
Radiosity Matrix • Two interesting properties: • Diagonally dominant. • Upper right matrix is computable from the lower left.
Basic Outline of Radiosity Mapping • The steps required for radiosity mapping are: • Render object view from object origin. • Blur object view so that all pixels contribute their color equally to the half of the object view closest to them. • Use normal mapping to acquire UV coordinates for each vertex of the mesh. • Texture map the object view onto the object using pixel colors as lighting values and adding those light values to the light already present on the object from traditional lighting methods. • Render the scene with its new light values.
Optimizations • Obvious optimizations to be implemented with radiosity are: • Don’t do full texture mapping for the object view. Instead, only find the light values for each vertex in the mesh, and then interpolate. • Ignore the radiosity calculation of the static objects, and only do radiosity mapping for dynamic object. Pre-calculate the radiosity of static objects by traditional method. Pre-calculate the volume of light-contribution that moved with the object for dynamic objects.
Examples Without Radiosity With Radiosity
Sample Code for Radiosity using C inline float Hemicube::getFormFactor(int side, int pixX, int pixY = -1) { if( pixY == -1) { // access pixels linearly using pixX if( side == 0) { return topPixels[pixX]; } if( side > 0) { return sidePixels[side-1][pixX]; } return 0; } // else access pixels as 2d array by using yOffset[] precalcs if( side == 0) { return topPixels[yOffsetPixels[pixY] + pixX]; } if( side > 0) { return sidePixels[side-1][yOffsetPixels[pixY] + pixX]; } return 0; }
References • www.opengl.org/resources/faq/technical/miscellaneous.htm • www.flipcode.com/articles/article_radenglish02-pf.shtml • www.q-bus.de/Blender/test009.html • www.cs.wpi.edu/~matt/courses/cs563/talks/radiosity.html • www.gamedev.net/reference/articles/article918.asp