ray tracing intro
play

Ray Tracing Intro Steve Marschner CS 4620 Cornell University - PowerPoint PPT Presentation

Ray Tracing Intro Steve Marschner CS 4620 Cornell University Cornell CS4620 Fall 2020 Steve Marschner 1 Projection To render an image of a 3D scene, we project it onto a plane Most common projection type is perspective projection


  1. Ray Tracing Intro Steve Marschner CS 4620 Cornell University Cornell CS4620 Fall 2020 Steve Marschner • 1

  2. Projection • To render an image of a 3D scene, we project it onto a plane • Most common projection type is perspective projection Cornell CS4620 Fall 2020 Steve Marschner • 2

  3. Two approaches to rendering Cornell CS4620 Fall 2020 Steve Marschner • 3

  4. Two approaches to rendering for each object in the scene { for each pixel in the image { if (object affects pixel) { do something } } } object order or rasterization Cornell CS4620 Fall 2020 Steve Marschner • 3

  5. Two approaches to rendering for each object in the scene { for each pixel in the image { for each pixel in the image { for each object in the scene { if (object affects pixel) { if (object affects pixel) { do something do something } } } } } } object order image order or or rasterization ray tracing Cornell CS4620 Fall 2020 Steve Marschner • 3

  6. Two approaches to rendering for each object in the scene { for each pixel in the image { for each pixel in the image { for each object in the scene { if (object affects pixel) { if (object affects pixel) { do something do something } } We will do this first } } } } object order image order or or rasterization ray tracing Cornell CS4620 Fall 2020 Steve Marschner • 3

  7. Ray tracing idea • Start with a pixel—what belongs at that pixel? • Set of points that project to a point in the image: a ray Cornell CS4620 Fall 2020 Steve Marschner • 4

  8. Ray tracing idea • Start with a pixel—what belongs at that pixel? • Set of points that project to a point in the image: a ray Cornell CS4620 Fall 2020 Steve Marschner • 4

  9. Ray tracing idea Cornell CS4620 Fall 2020 Steve Marschner • 5

  10. Ray tracing idea Cornell CS4620 Fall 2020 Steve Marschner • 5

  11. Ray tracing idea Cornell CS4620 Fall 2020 Steve Marschner • 5

  12. Ray tracing idea Cornell CS4620 Fall 2020 Steve Marschner • 5

  13. Ray tracing algorithm for each pixel { compute viewing ray intersect ray with scene compute illumination at visible point put result into image } Cornell CS4620 Fall 2020 Steve Marschner • 6

  14. Eye ray generation • inputs: – camera parameters – a point in the image viewing window • outputs: viewpoint – a viewing ray pixel position viewing ray Cornell CS4620 Fall 2020 Steve Marschner • 7

  15. Ray intersection • inputs: – list of objects in the scene – a ray • outputs: – whether ray intersects anything – parameter of first intersection t – information about surface Cornell CS4620 Fall 2020 Steve Marschner • 8

  16. Shading • inputs: – eye direction – light direction (for each of many lights) – surface normal n l – surface parameters v (color, roughness, …) • outputs: – light reflected towards eye Cornell CS4620 Fall 2020 Steve Marschner • 9

Recommend


More recommend