1 / 41

Two Methods for Fast Ray-Cast Ambient Occlusion

Two Methods for Fast Ray-Cast Ambient Occlusion. NVIDIA Research. Samuli Laine and Tero Karras. Ambient Occlusion in Theory. Occlusion of incoming ambient light. Light from these directions does not reach the surface. Light from these directions reaches the surface. What It Looks Like.

lmaryann
Download Presentation

Two Methods for Fast Ray-Cast Ambient Occlusion

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. Two Methods for Fast Ray-Cast Ambient Occlusion NVIDIA Research Samuli Laine and Tero Karras

  2. Ambient Occlusion in Theory • Occlusion of incoming ambient light Light from these directions does not reach the surface Light from thesedirections reachesthe surface

  3. What It Looks Like

  4. Ambient Occlusion in Practice • Use limited range for occlusion • Otherwise everything would be occluded in indoor scenes • Also faster to calculate because of finite radius • Use falloff function to smooth the transition • Do not solve analytically • Theoretically doable, but would be ridiculously expensive • Solution: Monte Carlo sampling • 256 – 1024 samples is usually enough

  5. Ray Casts for Ambient Occlusion • Cast a number of rays from the point to be shaded • Determine occlusion distance, apply falloff, sum • In reality use a fancy low-discrepancy sampling pattern

  6. Using Shadow Rays • Shadow rays are usually faster than ordinary rays • Enough to detect any intersection, not necessarily closest one • Can do if we bake falloff function into the rays

  7. Our Contributions • Two methods for calculating ambient occlusion faster • One for rasterization-based renderers • One for ray tracing -based renderers • No approximations as in screen-space methods • Up to ~10–15x speedup over state-of-the-art ray caster

  8. Common Part: Occlusion Masks • Both methods keep occlusion status in bit masks • Occlusion of all rays from one point = one bit mask • Utilize precalculated look-up tables for fast update of these masks • Update occlusion of all rays at once! • Resembles LUTs of hemispherical rasterization paper by Kautz et al. 2004, but more versatile

  9. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  10. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  11. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  12. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  13. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  14. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  15. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  16. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  17. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  18. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  19. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  20. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  21. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  22. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  23. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  24. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  25. Occlusion Look-up Table • Store binary plane vs. ray occlusion • Plane normal & distance from origin  3D table • Clever parameterization to avoid singularity at the center

  26. Occlusion of a Triangle • Combination of four occlusion masks

  27. Using Pre-Calculated Masks • 1283 look-up table is sufficiently accurate • To calculate occlusion of one triangle vs. all occlusion rays from a single receiver point • Transform triangle into coordinate space of receiver point • Calculate triangle plane and edge planes (trivial) • Fetch occlusion masks for all planes • Combine fetched masks together (binary AND) • Combine with current occlusion status (binary OR)

  28. Method 1: Rasterization • First render depth and normal buffers • For each occluding triangle, rasterize bounds for region of influence • For each fragment inside the region of influence, calculate triangle vs. point occlusion and accumulate in frame buffer • Use logic op blending into occlusion bits in frame buffer • Bounding the region of influence similar to ambient occlusion volumes by McGuire 2010

  29. Rasterization

  30. Bounding the Region of Influence • Two choices for bounding volume • If triangle is large, construct hexagonal prism • If triangle is small, construct hemispherical billboard Large triangle Small triangle

  31. Level of Detail Optimization • Far away occlusion doesn’t care about small details in the occluding surface • Therefore, we could use simplified geometry for larger occlusion distances • Nearby occlusion always has to be done using original geometry! • Split occlusion distance to various ranges, apply progressively more and more aggressive simplification as the distance grows • Can yield 30–140% speedup with tolerable error, depending on the scene

  32. Level of Detail Example

  33. Method 2: BVH Traversal • Assume that BVH for scene triangles is available • Find occluding triangles by traversing the BVH around the neighborhood of the receiver point • Similarities to packet traversal of Wald et al. 2007.

  34. BVH Traversal Algorithm • Maintain cumulative occlusion mask for all AO rays during traversal • When making traversal decision, estimate the occlusion potential of current node’s children • Occlusion potential = Number of currently non-blocked rays that are blocked by the bounds of the node • If occlusion potential is zero, don’t go there • If both children are eligible, first process the one with greater potential • Try to build up occlusion quickly to be able to cull remaining nodes

  35. Calculating Node Occlusion Mask • Tried out two kinds of node bounds • Boxes • Find silhouette edges, use same mask LUT as for triangles • Tight bounds, but expensive to compute (6 lookups) • Spheres • Determine direction and apex angle • Needs a separate 3D LUT for finding the occlusion mask • Conservative bounds, but cheap to compute (1–2 lookups) • Found out that spheres gave best overall performance

  36. Results • Compared against our previous GPU ray caster[Aila and Laine 2009] • Added optimizations for shadow rays • Performance measured in Mrays/second • Used various ambient occlusion radii

  37. Results

  38. Results: Scalability

  39. Results: Correctness

  40. Future Work • Soft shadows from area light sources

  41. Thank You • Questions

More Related