Top Banner
Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004
17

Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

RadiositySyed-Areeb A. Sabzposh

S. Yaris A. SabzposhCSC 470

11/11/2004

Page 2: 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

Page 3: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

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.

Page 4: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

Different techniques

• Different techniques of rendering light:– Simple light rendering.– Ray tracing.– Global illumination.– Radiosity.– Phong Model.

Page 5: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

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.

Page 6: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

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.

Page 7: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

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”.

Page 8: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

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.

Page 9: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

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:

Page 10: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

Radiosity Pipeline

• The following is a list of procedures that a radiosity renderer would take in computing a scene:

1. Generate Model

2. Compute Form Factors

3. Solve Radiosity Matrix

4. Render

Page 11: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

Radiosity Matrix

• Two interesting properties:– Diagonally dominant.– Upper right matrix is computable from the

lower left.

Page 12: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

Basic Outline of Radiosity Mapping

• The steps required for radiosity mapping are:1. Render object view from object origin.2. Blur object view so that all pixels contribute their

color equally to the half of the object view closest to them.

3. Use normal mapping to acquire UV coordinates for each vertex of the mesh.

4. 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.

5. Render the scene with its new light values.

Page 13: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

Optimizations

• Obvious optimizations to be implemented with radiosity are:

1. 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.

2. 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.

Page 14: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

Examples

Without Radiosity With Radiosity

Page 15: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

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; }

Page 17: Radiosity Syed-Areeb A. Sabzposh S. Yaris A. Sabzposh CSC 470 11/11/2004.

Questions???