Top Banner
Ray Tracing & Radiosity Dr. Amy H. Zhang
23

Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline Ray tracing Radiosity.

Dec 17, 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: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Ray Tracing & Radiosity

Dr. Amy H. Zhang

Page 2: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Outline Ray tracing Radiosity

Page 3: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Ray Tracing The color we see is determined by

interactions among light sources and surfaces.

Page 4: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Ray-casting model

Page 5: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Ray Tracing : Initial Stage Divide the image plane into pixel-sized areas Generate a cast ray through each pixel If the ray goes off to infinity without striking

anything Assign background color to the pixel

If the ray strikes a surface Calculate a shade for the point of intersection

Page 6: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Ray Tracing: Computing shadows Is the intersection point illuminated ? Compute shadow or feeler rays from the point

of intersection to each light source If a shadow ray intersects a surface before it

meets the source, this point is in shadow No lighting calculation needs to be done for

the point

Page 7: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Shadow Rays

Page 8: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Ray Tracing: Highly Reflective Surfaces

Follow the shadow ray as it bounces from surface to surface.

Stop if it either goes off to infinity or intersects a source. Any other condition(s)?

Page 9: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Ray Tracing: Reflection and Transmission

If a surface is both reflecting and transmitting Cast a ray in the direction

of a perfect reflection. Cast a ray in the direction

of the transmitted ray How to calculate

Vector r (reflected ray) Vector t (transmitted ray) Vector l (incoming ray)

Page 10: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

The Ray Tree Secondary rays may be generated by the primary

cast ray by reflection and transmission of light. A ray tree can be dynamically constructed to

represent the primary and secondary cast rays.

Page 11: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Ray Tracing: Example

Page 12: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

From http://www.povray.org/competition/jun95/index.html

Page 13: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

From: http://www.cg.tuwien.ac.at/research/rendering/rays-radio/

Page 14: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Ray Tracing: Pros and Cons, open problems Pros

Simple and intuitive Generate photo-realistic objects, especially for

the highly reflective and transparent objects Easy to generate shadow

Cons Diffuse surface

Open problems Optimal number of cast rays? Optimal depth?

Page 15: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Radiosity

Ideal for scene consisting of only perfectly diffuse surfaces.

Light interactions in a view-independent way

paths which leave a light source and are reflected diffusely some number of times (possibly zero) before hitting the eye.

An example Some of the diffuse reflections

from red wall would fall on white wall.

Diffuse light from white wall would have a similar effect on red wall.

Simple shading model does not consider these diffuse-diffuse interactions.

Page 16: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Radiosity Physical laws governing the radiant-energy

transferred(1950) Radiant energy terms

Energy of each Photon Total radiant energy sum over all photons and all

frequency Radiant power [flux] (Φ)

Rate at which light energy is transmitted (in watts = joules/sec).

Page 17: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Radiosity Radiosity(B)

Existent flux density from a locally planar area (in watts/ m2 )

dA

dB

Page 18: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Radiosity Equation

Bk–Radiosity at surface k Ek-Energy emitted from surface k ρk-reflectivity factor for surface k Hk–sum of the radiant energy

contributions from all surfaces in the rendered volume arriving at surface k per unit time per unit area

Fjk-Form factor of surface j related to surface k

http://www.siggraph.org/education/materials/HyperGraph/radiosity/overview_1.htm

j

jkjkkkkkk FBEHEB

Page 19: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

The Form Factors Breaks up the scene into small polygonal patches. Consider patches pair wise to determine form

factors. The factors determine how the light energy

leaving one patch affects the other. Depends on distance, shape, orientation,

occlusion

Small form factor

Large form factor

Page 20: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Progressive radiosity have intermediate radiosity values for the

patch correspond to bounce levels

As the algorithm iterates, light can be seen to flow into the scene, as multiple bounces are computed. Individual patches are visible as squares on the walls and floor.

Page 21: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Radiosity : Example

Page 22: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Radiosity : Another Example

Page 23: Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.

Overall comments on Global Illumination Ray-tracing models specular reflection

well, but diffuse reflection is approximated Radiosity models diffuse reflection

accurately, but specular reflection is ignored Time cost-> Radiosity Map

Advanced algorithms combine the two –Get your PhD by improving it