1 / 15

Ray tracing using Volumetric Planes

Luke Curley. Ray tracing using Volumetric Planes. What is a “VP”?. “VP” is short for “Volumetric Plane”. It is an infinite volume defined by a plane in coordinate space. Equation of a VP. The equation for a VP is the exact same as the equation for a plane. Ax + By + Cz + D = 0

tala
Télécharger la présentation

Ray tracing using Volumetric Planes

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Luke Curley Ray tracing using Volumetric Planes

  2. What is a “VP”? • “VP” is short for “Volumetric Plane”. It is an infinite volume defined by a plane in coordinate space.

  3. Equation of a VP • The equation for a VP is the exact same as the equation for a plane. • Ax + By + Cz + D = 0 • For some constants A, B, C, and D. • The volume of a VP is the volume on the side of the plane that is opposite to the surface normal.

  4. Constructing Objects with VPs • Objects are constructed by taking the intersection of multiple VPs. • Other set operators can be used depending on the implementation.

  5. Constructing Scenes • Scenes are constructed by taking the union of multiple objects. • The only primitive is a VP, and it is possible to create any scene using only VPs and set operators. • This makes it possible to treat each VP individually and combine the results through simple set operators (intersection and union, specifically).

  6. Ray Tracing with VPs • The ray tracing algorithm is unchanged with the exception of the ray intersection code. • Instead of using triangles to represent surfaces, VPs can represent volumes and are faster to calculate per face.

  7. IntervalintersectRayVP(Ray& ray, VP& vp) { float temp = dot(vp.normal, ray.direction); if (temp < 0.0f) { return Interval(-(dot(vp.normal, ray.origin) + vp.offset) / temp, float_max); } elseif (temp > 0.0f) { return Interval(0.0f, -(dot(vp.normal, ray.origin) + vp.offset) / temp); } elseif (vp.offset < -dot(vp.normal, ray.origin)) { return Interval(0.0f, float_max); } else { return Interval(float_max, float_max); } } Ray-VP Intersection • The Ray-VP intersection algorithm is very simple and similar to Ray-Plane. • vp.normal = (A, B, C) • vp.offset = D

  8. IntervalintersectRayVP(Ray& ray, VP& vp) { float temp = dot(vp.normal, ray.direction); if (temp < 0.0f) { return Interval(-(dot(vp.normal, ray.origin) + vp.offset) / temp, float_max); } elseif (temp > 0.0f) { return Interval(0.0f, -(dot(vp.normal, ray.origin) + vp.offset) / temp); } elseif (vp.offset < -dot(vp.normal, ray.origin)) { return Interval(0.0f, float_max); } else { return Interval(float_max, float_max); } } Ray-VP Intersection • VPs have volume, so a ray will intersect a given VP over an interval. • All that is left to do is intersect or union the returned intervals. • Much faster than Ray-Triangle intersection.

  9. Combining the Results • While the Ray-VP code is simple, actually combining the results is more of a problem. • The computation is minimal, but it is hard to structure the data in such a way that lends itself to parallel reduction. • Ray-tracing on a CPU will see enormous performance benefits, but I decided to try implementing a VP ray tracer in CUDA.

  10. CUDA Ray Tracing • CUDA harnesses the full power of parallel computing provided the application is suited. • Calculating Ray-VP intersection with CUDA is very fast, but the reduction from many intervals to one requires synchronization. • The CUDA SDK outlines optimizations for parallel reduction, all of which I implemented for my program.

  11. CUDA Ray Tracing Performance • The fast algorithm treats all VPs as one object. • This is not practical, but gives an idea of the fastest case.

  12. CUDA Ray Tracing Performance • The jumps are related to the CUDA architecture and occur because of the number of threads per block.

  13. CUDA Ray Tracing Performance • Aside from calculating Ray-VP intersection, the program also had to spawn the rays (given a camera model) and perform simple Phong shading with one light. • This took roughly 3000 GPU time, and consisted of 1.5% of the computation time for the highest end case (256 VPs). • Real performance strides can be made by speeding up the intersection code.

  14. CUDA Ray Tracing • Resolution: 800x800 • FPS: 15 • VP Count: 81 • GPU: nVidia 275 GTX • This is using the “fast” algorithm.

  15. Any Questions?

More Related