159 235 graphics graphical programming n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
159.235 Graphics & Graphical Programming PowerPoint Presentation
Download Presentation
159.235 Graphics & Graphical Programming

Loading in 2 Seconds...

play fullscreen
1 / 36

159.235 Graphics & Graphical Programming - PowerPoint PPT Presentation


  • 323 Views
  • Uploaded on

159.235 Graphics & Graphical Programming. Lecture 32 - Illumination Part 2 - Global Models. Global Illumination. Extends the Local Illumination Model to include: Reflection (one object in another) Refraction (Snell’s Law) Transparency (better model)

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about '159.235 Graphics & Graphical Programming' - jana


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
159 235 graphics graphical programming

159.235 Graphics & Graphical Programming

Lecture 32 - Illumination Part 2 - Global Models

Graphics

global illumination
Global Illumination
  • Extends the Local Illumination Model to include:
    • Reflection (one object in another)
    • Refraction (Snell’s Law)
    • Transparency (better model)
    • Shadows (at point, check each light source)
    • Antialiasing (usually means supersampling)

Graphics

wireframe view of a test scene
Wireframe View of a Test Scene

Orthographic view from above

Graphics

test scene
Test Scene

High quality rendering of test scene.

  • Note :
  • Mirror and chrome teapot.
  • Shadows on floor.
  • Shiny floor.

Graphics

locally illuminated test scene
Locally Illuminated Test Scene

Ambient term only

Graphics

locally illuminated test scene1
Locally Illuminated Test Scene

Phong shading.

Ambient and Diffuse terms

only

  • Notes :
  • Highlight on wall from light is in the wrong place; screen space interpolation.
  • We cannot illuminate the lights with the light sources – wrong side !

Graphics

locally illuminated test scene2
Locally Illuminated Test Scene

Phong shading.

Ambient, diffuse and

Specular terms.

Graphics

locally illuminated test scene3
Locally Illuminated Test Scene

Flat shading.

Note : Mach bands.

Graphics

locally illuminated test scene4
Locally Illuminated Test Scene

Gouraud shading.

Ambient, diffuse and

Specular terms.

Note: artefacts on wall.

Graphics

solution to gouraud artefacts
Solution to Gouraud Artefacts

Gouraud shading.

Re-triangulated mesh.

Graphics

comparison
Comparison

Flat

Gouraud

Phong

Coarser mesh

Graphics

use local illumination
Use Local Illumination
  • No.
  • In our test scene, we can’t represent :
    • Mirror
    • Chrome teapot.
    • Shiny floor
    • Shadows

with local illumination.

Graphics

kajiya s rendering equation
Kajiya’s Rendering Equation
  • Viewer is at point x, looking toward point x.
  • I(x,x) determines amount of light arriving at x from x
  • g(x,x) is a geometry term, = 0 when x is occluded, otherwise = attenuation factor 1/r2 (or 1/(s+k))
  • (x,x) is the amount of light emitted from x to x.
  • (x,x,x) is the fraction of light reflected and scattered off x to point x from point x
  • The integral S is over all such points (x") on all surfaces.

Graphics

global illumination1
Global Illumination
  • Two methods :
    • View dependent methods.
      • Calculate the view from the camera with global illumination.
    • Recursive ray-tracing.
    • View independent methods.
      • Solve lighting for the entire scene.
      • Radiosity solution.

Graphics

view dependent methods
View Dependent Methods
  • Loop round the pixels…..
  • Good for lighting effects which have a strong dependence on view location :
    • Specular highlights.
    • Reflections from curved surfaces.
  • Only a small number of objects need to be considered at the same time.
  • Poor when many objects need to be considered
    • E.g diffuse interactions (eg. colour bleeding).

Graphics

view independent methods
View Independent Methods
  • Loop round the scene…
  • Good when many (all) objects need to be considered at same time.
    • Diffuse inter-reflections.
  • Poor when shading has strong dependence on view location.
    • Specular reflection.

Graphics

recall ray casting

Scene

Eyepoint

Window

Recall : Ray Casting
  • Involves projecting an imaginary ray from the centre of projection (the viewers eye) through the centre of each pixel into the scene.
  • The first object the ray intersects determines the shade.

Graphics

whitted s algorithm
Whitted’s algorithm
  • Fire off secondary rays from surface that ray intersects.
    • Towards Light Source(s) : shadow rays. L (shadow feelers)
    • In the reflection direction : reflection rays, R
    • In a direction dictated by Snell’s Law : transmitted rays, T

Graphics

recursive ray tree
Recursive Ray Tree
  • Reflection and Transmission Rays spawn other rays.
    • Shadow rays test only for occlusion.
  • The complete set of rays is called a Ray Tree.

Light Source ray determines colour of current object.

Viewpoint

Graphics

recursive ray tree1
Recursive Ray Tree
  • Reflection and Transmission Rays spawn other rays.
    • Shadow rays test only for occlusion.
  • The complete set of rays is called a Ray Tree.

Graphics

test scene1
Test Scene

Ray tree depth 1.

Note only ambient shade on mirror and teapot

Graphics

test scene2
Test Scene

Ray tree depth 2.

Note only ambient shade on reflection of mirror and teapot.

Graphics

test scene3
Test Scene

Ray tree depth 3.

Note only ambient shade on reflection of mirror in teapot.

Graphics

test scene4
Test Scene

Ray tree depth 4.

Note ambient shade on reflection of teapot in reflection of mirror in teapot.

Graphics

test scene5
Test Scene

Ray tree depth 5.

Graphics

test scene6
Test Scene

Ray tree depth 6.

Graphics

test scene7
Test Scene

Ray tree depth 7.

Graphics

when to stop
When to stop ?
  • Need to know when to stop the recursion.
  • Can define a fixed depth.
  • Hall introduced adaptive tree depth control.
    • Calculate maximum contribution of a ray to a pixels final value.
    • Multiply contribution of ray’s ancestors down the tree.
    • Stop when below some threshold, perhaps stack overflow.
    • May miss major contribution this way (culled bright pt)

Graphics

adaptive tree depth control
Adaptive Tree Depth Control

0.3

Viewpoint

0.2

Graphics

adaptive tree depth control1
Adaptive Tree Depth Control

0.3

0.3 * 0.2

Viewpoint

0.2 * 0.2

0.2

Graphics

global vs local illumination
Global vs. Local Illumination
  • In both an object hit by a ray, if lit by a light source, is illuminated by a local illumination model, i.e with specular, diffuse & ambient terms.
  • Global: a reflected ray, a shadow feeler, and a transmission ray (if appropriate) are also cast into the scene.
  • Phong term only reflects light source.
    • Need to adjust local illumination terms to normalise total light values.
    • Inconsistent if local and global specular terms used together as local term spreads light source, global term does not.

Graphics

slide32

Increased reflectivity

Phong specular term is held constant

Increased transmissivity

Graphics

incorrect result
Incorrect Result
  • Effect of not normalising reflection and transmission – light appears to be created.
    • Reflection & transmission = 100%

Graphics

problems with ray tracing
Problems with Ray-Tracing
  • A serious problem with Ray tracing is rays are traced from the eye.
    • Refraction is not physically correct.
  • Shadow rays are cast only to light sources
    • Lights reflected in mirrors do not cast shadows
    • Shadows of transparent objects don’t exhibit refraction.
    • Still need local illumination for diffuse shading.

Graphics

speeding up ray tracing
Speeding up Ray Tracing
  • Ray tracing is slow, not real-time.
  • Use appropriate extents for objects.
  • Ray tracing is inherently parallel.
  • Use item buffers – z-ordered lists, store closest object per pixel.
  • Use light buffer – z-ordered list per light ray used for shadowing.

Graphics

illumination part 2 summary
Illumination Part 2 - Summary
    • Reflection
    • Refraction
    • Transparency
    • Shadows
    • Antialiasing
  • Acknowledgments - thanks to Eric McKenzie, Edinburgh, from whose Graphics Course some of these slides were adapted.

Graphics