Ray Tracing
description
Transcript of Ray Tracing
![Page 1: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/1.jpg)
Ray TracingMike MerchantNicholas Hilbert
![Page 2: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/2.jpg)
What is Ray Tracing?
![Page 3: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/3.jpg)
Color•Image plane (pixels) are determined by
the color of the light ray that passes through that pixel. (Ultimately… determining the color of each pixel is the point of ray tracing)
![Page 4: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/4.jpg)
Types of Ray Tracing - Forwards•Simulates real life (aka Photon Tracing)•Accurately determines color of each
object•Highly inefficient
![Page 5: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/5.jpg)
Types of Ray Tracing - Backwards•Emits 1 ray from the viewer to each pixel
on the screen and tracks its path•No unnecessary rays for simple ray tracer
(1080p screen = 2,073,600 rays… not too bad)
•Still time consuming
![Page 6: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/6.jpg)
Complexity is O(heightscreen *
widthscreen * numobjects)
![Page 7: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/7.jpg)
REFLECTION + REFRACTIONREFLECTIONREFRACTION
![Page 8: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/8.jpg)
Recursively Reflecting/Refracting Rays• Create a tree of rays: root note is the original ray, each node
is a reflected/refracted ray, and all leaves are non-reflected/non-refracted rays… go until a depth limit is reached or there are no more nodes
![Page 9: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/9.jpg)
((Same complexity as before)number of reflected/refracted rays)
![Page 10: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/10.jpg)
Current Overview
![Page 11: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/11.jpg)
Problems •Time Consuming:
▫Impossible for real-time graphics▫Takes time to calculate closest object
through ray (usually involves the dreaded square root function)
•Aliasing•Image has perfect reflection (unnatural)
![Page 12: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/12.jpg)
Anti-Aliasing •Ray tracing gives a color for all points on
image… but a square pixel contains an infinite number of points which might not all be the same color
•Shoot more rays at each pixel (random or not) then filter the result and color the pixel accordingly
![Page 13: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/13.jpg)
Distributed Ray Tracing – Monte Carlo Ray Tracing•Light can bounce off in many directions at
one point•Can add real world effects, such as:
GlossSoft ShadowsFocus
![Page 14: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/14.jpg)
Finished Overview• Complicated Ray Tracer is able to simulate an image in real life…
but must require lots of calculations
• Add more rays that intersect at a point (for distributed ray tracing)
![Page 15: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/15.jpg)
Accelerated Ray Tracing•Adaptive depth control
▫Decrease the depth of possible recursion for reflected/refracted rays
•Only keep rays needed for basic image▫Remove features mentioned in the last few
slides•Bounding Volumes•“Embarrassingly parallel”
![Page 16: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/16.jpg)
Bounding Volumes• Bind objects together into
bigger objects▫ If ray doesn’t hit bounded
object, it won’t hit objects inside either
▫ Also used for single objects
![Page 17: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/17.jpg)
Embarrassingly parallel•Wikipedia: “… an embarrassingly parallel
workload, is one for which little or no effort is required to separate the problem into a number of parallel tasks”
•Only need scene and a ray to calculate pixel’s color
![Page 18: Ray Tracing](https://reader036.fdocuments.in/reader036/viewer/2022062410/568162a5550346895dd321e5/html5/thumbnails/18.jpg)
Finale•Questions?