Accelerating Sphere Tracing Csaba Bálint , Gábor Valasek Eötvös Loránd University, Hungary
Table of Contents ➢ Introduction to Sphere Tracing ✓ Relaxed Sphere Tracing Current best ➢ Enhanced Sphere Tracing Our first contribution ✓ Optimally approximates smooth surfaces ✓ ~50% faster than relaxed sphere tracing ➢ Iteratively Increasing Resolution Our second contribution ✓ Increases resolution while rendering ✓ ~20% speedup 2 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Ray-Surface Intersection • 𝒒 is a surface point implicit representation 𝑔 𝒒 = 0 • Ray: 𝒕 𝑢 = 𝒒 0 + 𝑢 ⋅ 𝒘 0 • Ray-surface intersections: 𝑔 𝒕 𝑢 = 0 3 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Singed Distance Function • 𝑔(𝒒) : signed distance to the surface from point 𝒒 Unbounding sphere → Center: 𝒒 0 → Radius: 𝑔(𝒒 0 ) 4 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Sphere Tracing Step • Travel 𝑔(𝒒) on ray – Cannot step over an intersection 5 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Repeat: t += 𝑔 𝒒 0 + 𝑢 ⋅ 𝒘 0 ; ▪ Sphere Tracing Algorithm Stop: ▪ o After a 100 iterations • Travel 𝑔(𝒒) on ray – Cannot step over an intersection o When 𝑔 𝒒 0 + 𝑢 ⋅ 𝒘 0 is small o When 𝑢 is large [1] HART J. C.: Sphere tracing: A geometric method for the antialiased ray tracing of implicit surfaces. The Visual Computer 12 (1994), 527 – 545 6 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
SDFE – Signed Distance Function Estimate • 𝑔(𝒒) is a lower bound to the actual distance [1] HART J. C.: Sphere tracing: A geometric method for the antialiased ray tracing of implicit surfaces. The Visual Computer 12 (1994), 527 – 545 7 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Slowdown • Large overlap – could have taken a larger step 8 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Relaxed Sphere Stracing • Take a 1.6 x larger step • Check if spheres overlap • Step back if they don’t [2] KEINERT B., Schäfer H., Korndörfer J., Ganse U., Stamminger M.: Enhanced Sphere Tracing. The Eurographics Association (2014) 9 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Divergent case – Sphere Tracing • 11 tracing steps • 11 function evaluations 10 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Divergent case – Relaxed Sphere Tracing • 11 tracing steps • 13 function evaluations 11 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Divergent case – (Our) Enhanced Sphere Tracing • 11 tracing steps • 12 function evaluations 12 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Enhanced Sphere Tracing Step I • Idea: Approximate flat surfaces optimally Previous 𝑠 𝑗−1 Next ? 𝑠 𝑗 13 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Enhanced Sphere Tracing Step II • Unbounding sphere is expected to touch ✓ The previous unbounding sphere ✓ The flat surface Next step size to try: 𝑒 𝑗+1 = 𝑠 𝑗 + 𝑠 𝑗+1 𝑒 𝑗 𝑠 𝑗 𝑠 𝑗−1 𝑠 𝑗+1 𝑠 𝑗 𝑠 𝑗+1 = ? Tangent 14 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Enhanced Sphere Tracing Step III Solution: 𝑗 ⋅ 𝑒 𝑗 − 𝑠 𝑗−1 + 𝑠 𝑗 𝑠 𝑗+1 = 𝑠 𝑒 𝑗 + 𝑠 𝑗−1 + 𝑠 𝑗 Next step size to try: 𝑒 𝑗+1 = 𝑠 𝑗 + 𝑠 𝑗+1 What if the surface is curved? 𝑒 𝑗 Similar 𝑠 𝑗 Triangles 𝑠 𝑗−1 𝑠 𝑗+1 𝑠 𝑗 𝑠 𝑗+1 15 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Enhanced Sphere Tracing Step – Relaxation Relax enhanced step: 𝑒 𝑗+1 = 𝑠 𝑗 + 𝜕 ⋅ 𝑠 𝑗+1 Eg.: 𝜕 = 0.9 relaxation parameter. Different goal: fix slight concavity Optimal on smooth surfaces 𝑒 𝑗 𝑠 𝑗 𝑠 𝑗−1 𝑠 𝑗+1 𝑠 𝑗 𝑠 𝑗+1 16 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Test Scene I: CSG composition 17 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Test Scene II: Village Accelerating Sphere Tracing , Csaba Bálint, Valasek Gábor 18
Non-smooth surface! Scene III: Mandelbulb 3D Fractal 19 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Enhanced Sphere Tracing: Relative runtimes Classic ST Faster than relaxed ST But why? • 20 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Enahnced Sphere Tracing: Step back rato Enhanced sphere tracing → Only a few fallbacks → Better thread coherence → Even faster on the GPU Ratio of overshoots visualized White pixels: • 100% wrong prediction Black pixels: • 100% good prediction 21 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Enhanced Sphere Tracing: Relative Error Close to the surface our algorithm overtakes 22 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Enhanced Sphere Tracing: Relative Performance 1.6 times better than Relaxed ST 23 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Cone Tracing Unbounding sphere [1] HART J. C.: Sphere tracing: A geometric method for the antialiased ray tracing of implicit surfaces. The Visual Computer 12 (1994), 527 – 545 24 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Iteratively Increase Resolution 4 new cones penetrate the scene further 25 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Iteratively Increasing Resolution Results Multiple resolution change is expencive Baseline: single res. Using 2 different resolutions: 20% 26 Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Summary ➢ Enhanced Sphere Tracing ✓ Optimally approximates smooth surfaces ✓ 50% faster than relaxed sphere tracing ➢ Iteratively Increasing Resolution ✓ Increases resolution while rendering ✓ 20% faster & Interactive or real-time rendering Thank you for your attention! [1] HART J. C.: Sphere tracing: A geometric method for the antialiased ray tracing of implicit surfaces. The Visual Computer 12 (1994) [2] KEINERT B., Schäfer H., Korndörfer J., Ganse U., Stamminger M.: Enhanced Sphere Tracing. The Eurographics Association (2014) Accelerating Sphere Tracing , Csaba Bálint, Gábor Valasek
Recommend
More recommend