csc418 computer graphics
play

CSC418: Computer Graphics DAVID LEVIN Todays Topics 1. Texture - PowerPoint PPT Presentation

CSC418: Computer Graphics DAVID LEVIN Todays Topics 1. Texture mapping 2. Ray Tracing Some slides and figures courtesy of Wolfgang Hurst, Patricio Simari Some figures courtesy of Peter Shirley, Fundamentals of Computer Graphics,


  1. CSC418: Computer Graphics DAVID LEVIN

  2. Today’s Topics 1. Texture mapping 2. Ray Tracing Some slides and figures courtesy of Wolfgang Hürst, Patricio Simari Some figures courtesy of Peter Shirley, “Fundamentals of Computer Graphics”, 3rd Ed.

  3. Showtime

  4. But First … Logistical Things • You should all have your Assignment 1 and Midterm Grades • Assignment 2 is due this Friday • If you are still having troubles email the TAs • csc418tas@cs.toronto.edu • Karan is still away so email me if you have any issues • diwlevin@cs.toronto.edu (usually requires two emails)

  5. Phong Shading: Comparisons Phong shading: 1. Interpolate to get at 2. Compute

  6. Phong Shading: Comparisons Phong shading: 1. Interpolate to get at 2. Compute Comparison to Gouraud shading + Smooth intensity variations as in Gouraud shading + Handles specular highlights correctly even for large triangles (Why?) - Computationally less efficient (but okay in today's hardware!) (Must interpolate 3 vectors & evaluate Phong reflection model at each triangle pixel)

  7. Topic 1: Texture Mapping • Motivation • Sources of texture • Texture coordinates • {Bump, MIP, displacement, environmental} mapping

  8. Motivation • Adding lots of detail to our models to realistically depict skin, grass, bark, stone, etc., would increase rendering times dramatically, even for hardware-supported projective methods.

  9. Motivation • Adding lots of detail to our models to realistically depict skin, grass, bark, stone, etc., would increase rendering times dramatically, even for hardware-supported projective methods.

  10. Motivation

  11. Motivation

  12. Topic 1: Texture Mapping • Motivation • Sources of texture • Texture coordinates • {Bump, MIP, displacement, environmental} mapping

  13. Texture sources: Photographs

  14. Texture sources: Solid textures

  15. Texture sources: Procedural

  16. Texture sources: Synthesized

  17. Original Synthesized Original Synthesized

  18. Topic 1: Texture Mapping • Motivation • Sources of texture • Texture coordinates • {Bump, MIP, displacement, environmental} mapping

  19. Texture coordinates How does one establish correspondence? (UV mapping)

  20. Texture coordinates

  21. Texture coordinates

  22. Texture coordinates

  23. Texture coordinates

  24. Texture coordinates

  25. Texture coordinates

  26. Texture coordinates

  27. Texture coordinates

  28. Texture coordinates

  29. Topic 1: Texture Mapping • Motivation • Sources of texture • Texture coordinates • {Bump, MIP, displacement, environmental} mapping

  30. Mipmapping

  31. MIP-Mapping: Basic Idea Given a polygon, use the texture image, where the projected polygon best matches the size of the polygon on screen.

  32. Mipmapping

  33. Mipmapping

  34. Environment mapping

  35. Environment mapping

  36. Environment mapping

  37. Environment mapping

  38. Bump mapping

  39. Bump mapping

  40. Bump mapping

  41. Displacement mapping

  42. Displacement mapping

  43. Topic 2: Basic Ray Tracing • Introduction to ray tracing • Computing normals • Evaluating shading model • Computing rays • Spawning rays • Computing intersections • Incorporating transmission • refraction • ray-triangle • ray-spawning & refraction • ray-polygon • ray-quadric • the scene signature

  44. Local vs. Global Illumination Local Illumination Models e.g. Phong • Model source from a light reflected once off a surface towards the eye • Indirect light is included with an ad hoc “ambient” term which is normally constant across the scene Global Illumination Models e.g. ray tracing or radiosity (both are incomplete) • Try to measure light propagation in the scene • Model interaction between objects and other objects, objects and their environment

  45. All surfaces are not created equal Specular surfaces • e.g. mirrors, glass balls • An idealized model provides ‘perfect’ reflection Incident ray is reflected back as a ray in a single direction Diffuse surfaces • e.g. flat paint, chalk • Lambertian surfaces • Incident light is scattered equally in all directions General reflectance model: BRDF

  46. Categories of light transport Specular-Specular Specular-Diffuse Diffuse-Diffuse Diffuse-Specular

  47. Ray Tracing Traces path of specularly reflected or transmitted (refracted) rays through environment Rays are infinitely thin Don’t disperse Signature: shiny objects exhibiting sharp, multiple reflections Transport E - S – S – S – D – L.

  48. Ray Tracing Unifies in one framework • Hidden surface removal • Shadow computation • Reflection of light • Refraction of light • Global specular interaction

  49. Rasterization vs. Ray Tracing Rasterization: -project geometry onto image. -pixel color computed by local illumination (direct lighting). Ray-Tracing: -project image pixels (backwards) onto scene. -pixel color determined based on direct light as well indirectly by recursively following promising lights path of the ray.

  50. Projective methods

  51. Ray tracing / ray casting

  52. Ray tracing / ray casting

  53. Ray tracing / ray casting

  54. Ray tracing

  55. Ray tracing

  56. Ray tracing

  57. Ray tracing

  58. Ray tracing

  59. Projective methods vs. ray tracing

  60. Projective methods vs. ray tracing

  61. A basic ray tracing algorithm

  62. Lines and rays

  63. Lines and rays

  64. Lines and rays

  65. Coordinate system

  66. Coordinate system

  67. Coordinate system

  68. Coordinate system

  69. Coordinate system

  70. Viewing window

  71. Viewing window

  72. Viewing window

  73. Viewing rays

  74. Viewing rays

  75. Viewing rays compared

  76. A basic ray tracing algorithm

  77. Ray-object intersection (implicit surface)

  78. Spheres

  79. Intersections between rays and spheres

  80. Intersections between rays and spheres

  81. Intersections between rays and planes

  82. Ray-object intersection (parametric surface)

  83. Ray-object intersection (parametric surface)

  84. Ray-triangle intersection

  85. Plane specification

  86. Ray-plane specification

  87. Ray-plane specification

  88. Ray-plane specification

  89. Rays: parametric representation

  90. Computing Ray-Poly Intersections: Step b

  91. Computing Ray-Poly Intersections: Step b

  92. Computing Ray-Quadric Intersections

  93. Computing Ray-Quadric Intersections

  94. Computing Ray-Quadric Intersections: 3 Cases

  95. Ray-Quadric Intersections: Sub-cases for D >0

  96. Intersecting Rays & Composite Objects Intersect ray with component objects • Process the intersections ordered by depth • to return intersection pairs with the object.

Recommend


More recommend