180 likes | 430 Views
Ray Tracing. Mike Merchant Nicholas Hilbert. What is Ray Tracing?. C o l o r. 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). Types of Ray Tracing - Forwards.
E N D
Ray Tracing Mike Merchant Nicholas Hilbert
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)
Types of Ray Tracing - Forwards • Simulates real life (aka Photon Tracing) • Accurately determines color of each object • Highly inefficient
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
REFLECTION + REFRACTION REFLECTION REFRACTION
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
((Same complexity as before)number ofreflected/refractedrays)
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)
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
Distributed Ray Tracing – Monte Carlo Ray Tracing • Light can bounce off in many directions at one point • Can add real world effects, such as: Gloss • Soft Shadows • Focus
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)
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”
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
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
Finale • Questions?