250 likes | 497 Views
Ray tracing via GPU Rasterization. Wei Hu 1 Yangyu Huang 1 Fan Zhang 1 Guodong Yuan 2 1 Beijing University of Chemical Technology, Beijing 2 Tsinghua University, Beijing. The Goal. Input: A ray and scene objects Output: The intersection position(if exists). GPU Rasterization Method.
E N D
Ray tracing via GPU Rasterization Wei Hu1 Yangyu Huang1 Fan Zhang1 Guodong Yuan2 1Beijing University of Chemical Technology, Beijing 2Tsinghua University, Beijing
The Goal Input: A ray and scene objects Output: The intersection position(if exists)
GPU Rasterization Method • Sampling-based • Environment Map and Shadow Map approximate effects • Layered Depth Images(LDI) too slow for accurate ray-scene intersections GPU Rendering of Secondary Effects[K. Burger et al. 2007] • Voxel-based • Uniform Grid cost too much memory for accurate ray-scene intersections • Sparse Voxel Octree(SVO) use cone tracing to generate glossy reflection, not applicable for rendering fully dynamic scenes Gigavoxels: ray-guided streaming for efficient and detailed voxel rendering[C. Crassin et al. 2009]
Our Method Introduction • Our idea is simple but very effective • Combine low resolution uniform grid and high resolution A-buffer(LDI) Achieve balance between accuracy and performance • Support various GI effects • Ray casting • Whitted ray tracing(reflections/refractions, shadows) • Ambient occlusion • Soft shadow • Path tracing
Our Ray-tracing Algorithm Scene Representation • Two-level representation of scene(All generated in one pass) • One uniform voxel grid(low resolution, one 3D texture) • Three A-buffers(high resolution, three texture buffers) • A-buffer sorting(One pass) Sort each A-buffer by it’s main axis from near to far(x, y, z axis) • Deferred shading(One pass) Compute first ray-tracing scene informations(vertex, normal, texture, etc.)
Our Ray-tracing Algorithm Ray-scene Intersection • Traverse the ray on the coarse-level uniform grid in the scene(use 3D-DDA) • Select a A-buffer from three A-buffers • Traverse the ray on the selected precise A-buffer in the non-empty grid(2D-DDA) • determine whether the point is inside scene objects by comparing depth values in sorted link-listed values
Our Ray-tracing Algorithm Improve the performance of ray-tracing in A-buffer • Linear search accurate but slow reflection, refration • 1-step binary search fast but Inaccurate ambient occlusion, path tracing • 3-step binary search balance the accuracy and speed shadow A non-empty voxel search in A-buffer
Implementation Challenges Ray-tracing in multiple layers Reasons: • Shader don’t support recursion Solutions: • Replace recursion by loops • Forward compute results • Backward combine results Scene P1 P2 P3 Screen P0 P4
Implementation Challenges Low frequency effect need large sampling rays Reasons: • Shader limit sampling rays number Solutions: • Implement multiple-pass rendering pipeline • Two buffer(FBcurr and FBcomp) maintain result • One for current result • One for final result
Implementation Challenges Multiple-pass rendering methods • General rendering For i = 0:passNum-1 Compute Fbcurr Fbcomp += Fbcurr / passNum End updateScene() • Progressive rendering For i = 0:inf Compute Fbcurr Fbcomp = (i * Fbcomp + Fbcurr) / (i + 1) updateScene() End
Experimental Results & Discussion • Ray Casting • Ray Tracing • Ambient Occlusion • Path Tracing Result Size: 800 600 All generated with full dynamic scenes
Experimental Results & Discussion • Language: OpenGL/GLSL • Equipment: Intel Xeon R CPU E5-1620 3.7GHz NVidia GeForce R780 GTX graphics card • A-buffer: 1280 1280 • Uniform grid: 64 64 64 sqrt(3n)^3 ugrid is a better choice for n^2 A-buffer • Screen buffer: 800 600 • Trace depth: 3 • Fully dynamic scene: uniform voxel grids and A-buffers are reconstructed for each frame
Experimental Results & Discussion A display of video All effects are generated by our method Fully dynamic scene
Experimental Results & Discussion Whitted ray tracing effect Accuracy of ray-scene intersection Result: Our results closely match the references(Optix) • Compare with optix Ours Optix
Experimental Results & Discussion • Compare with uniform grid Ambient occlusion effect • Ours: 64^3 / 256 / 64 / 16.8fps • Ugrid: 64^3 / 64 / 46.3fps • Ugrid: 256^3 / 96 / 7.7fps Result: Reach the approximate same effect, our method is faster than uniform grid
Experimental Results & Discussion • Compare with sparse voxel octree Result: Better for full dynamic scenes, for which high-precision results are usually required.
Comparison bad general good Time slow: -1 medium: 0 fast: +1 Accuracy low: -1 medium: 0 high: +1 Memory large: -1 medium: 0 small: +1 Scene small: -1 medium: 0 large: +1
Applications • Ward BRDF
Applications • Soft shadow
Applications • Slightly larger scene
Limitations • Gracile objects might be missed in A-buffer • Large and complex scenes may beyond the capability of current GPU • When tracing, a ray can‘t branch into two rays in multiple layers
Conclusion & Future Works • Conclusion • A novel ray-scene intersection technique • Balance the accuracy and performance • A new ray-tracing framework • Wide range use in GI effects • Future works • Improve the intersection accuracy • Accelerate representation construction • Apply to more large and complex scenes
Thanks & Questions Contact me: memoryemon@gmail.com Yang-yu Huang the second year of master's degree