Dynamic per Object Ray Caching Textures for Real-Time Ray Tracing Christian F. Ruff, Esteban W. G. Clua and Leandro A. F. Fernandes Universidade Federal Fluminense (UFF) 1
Ray Tracing Source: NVidia Source: Wikipedia 2
Ray Tracing Redundant rays image 3
Ray Tracing • Can we store this information somewhere, and use it later? • Can we avoid the recursion of rays? • It is possible to achieve coherent memory access? 4
Related Work • Ray tracing optimization: – A . S. Glassner, “Space subdivision for fast ray tracing,” IEEE Comput.nGraph. Appl., vol. 4, no. 10, pp. 15 – 24, 1984. – T . Foley and J. Sugerman, “KD -tree acceleration structures for a GPU raytracer ,” in Proc. of ACM SIGGRAPH/EUROGRAPHICS Conference on Graphics Hardware, 2005, pp. 15 – 22. – T. L. Sabino et al. “ A hybrid GPU rasterized and ray traced rendering pipeline for real time rendering of per pixel effects,” in Entertainment Computing – ICEC, ser. LNCS. Springer, 2012, vol. 7522, pp. 292 – 305. 5
Related Work • Hybrid Ray Tracer: – Compute the primary rays with deferred rendering in the rasterization step. – Use the OptiX engine only to compute the secondary rays from reflective and refractive objetcs. – Improved the frame rate up to 100% compared to standard OptiX implementation. 6
Content • Our Technique • Results • Limitations and Future Work • Conclusion 7
Our Technique • Use 2D caching textures to store the color information. • Create a cube that contains the object, assign a 2D texture to each face. 8
Our Technique • Use 2D caching textures to store the color information. • Create a cube that contains the object, assign a 2D texture to each face. 9
Our Technique • Store the information of the ray tracing and use it in subsequent frames. • How to store this information? • How to retrieve it? 10
Our Technique • Store the information: 11
Our Technique • Retrieve the information: – The largest coordinate magnitude of the vector will determine the face of the cube. – The formula: where m is the coordinate value related to the major axis direction of s in object space, and t ’ u and t ’ v are defined according to the OpenGL’s convention. 12
Our Technique • The textures begin to be filled and starts to retrieve the valid information. • After the textures are filled, the ray tracing will not be executed anymore. After the first frame After a few frames 13
Results • Image quality comparison: Ray tracing Our Technique 14
Results • Image quality comparison: Ray tracing Our Technique 15
Results • Image quality comparison: Ray tracing Our Technique 16
Results • Image quality comparison: 17
Results • Performance comparison: – Standard OptiX implementation Additional Conventional Ray Tracing Reflective Speed Up With Our Standard Objects Tehcnique 1 56.7 fps 57.8 fps ~ 2% 2 52.0 fps 55.6 fps ~ 7% 4 44.7 fps 51.8 fps ~15 % 8 32.8 fps 43.5 fps ~ 32% 16 17.1 fps 33.4 fps ~ 95% 32 8.0 fps 21.5fps ~ 168% 18
Results • Performance comparison: – Hybrid ray tracing Additional Hybrid Ray Tracing Reflective Speed Up With Our Standard Objects Tehcnique 0 68 fps 125 fps ~ 84% 1 63 fps 120 fps ~ 90% 2 59 fps 117 fps ~ 98% 4 49 fps 98 fps ~ 100% 8 38 fps 85 fps ~ 124% 16 23 fps 63 fps ~ 174% 32 12 fps 42 fps ~ 250% 19
Limitations and Future Work • The tridimensionality of the relex information is lost, since they are stored in 2D textures. Ray tracing Our Technique 20
Limitations and Future Work • The tridimensionality of the relex information is lost, since they are stored in 2D textures. • Use Relief Mapping to enhance the quality of the reflex, restoring its tridimensionality. Ray tracing Our Technique 21
Limitations and Future Work • Dynamic scenes can generate invalid reflex information. 22
Limitations and Future Work • Dynamic scenes can generate invalid reflex information. • Use a visibility-graph-like structure to solve the problems with dynamic objects in the scene. 23
Limitations and Future Work • Concave objects may stored conflicting information on the textures. 24
Limitations and Future Work • Concave objects may stored conflicting information on the textures. Ray tracing Our Technique 25
Limitations and Future Work • Concave objects may stored conflicting information on the textures. • Subdivide concave objects into convex parts to eliminate the conflict when storing information. Ray tracing Our Technique 26
Conclusion • Overview: – Create cubes around each object. – Store the color information in 2D caching textures. – Retrieve the information to use it in later frames. • Contributions : – No more recursive rays. – Coherent memory access. – Improved the performance. 27
Conclusion • Efficient cache strategy improved the frame rate of a ray tracing implementation up to 250%. • Replaces the computationally expensive bouncing of rays by the texture sampling mechanism of the GPU. • We believe that this idea will lead to further benefits in the development of real-time ray tracing. 28
Questions? 29
Recommend
More recommend