280 likes | 456 Views
Research funded by:. GR/R13685/01. Ray Tracing with the VLF (VLF-RT). Jesper Mortensen j.mortensen@cs.ucl.ac.uk. VLF-RT. Aims of the Virtual Light Field. Efficient data structure for storing directionally dependent radiance Fast generation (propagation of radiance)
E N D
Research funded by: GR/R13685/01 Ray Tracing with the VLF(VLF-RT) Jesper Mortensen j.mortensen@cs.ucl.ac.uk
Aims of the Virtual Light Field • Efficient data structure for storing directionally dependent radiance • Fast generation (propagation of radiance) • Fast rendering of novel views from the data structure
Aims of VLF-RT • Make use of the (existing) VLF data structure • Provide fast ray queries for arbitrary rays • Provide accurate ray queries for arbitrary rays (conservative)
Data structure • Use existing pre-computed tile visibility? • Yes, but tile visibility must be accurate and inclusive, openGL/D3D is approximate • GDI/D3D/OGL e.g. use integer top left rasterization convention • If not done properly:- nasty aliasing….
Rasterization to tiles (cont’d) • Rasterization is done for each polygon in each direction • Creates a list of polygon indices for each tile • Many tiles will be empty • Depth information is lost
Tile BSP trees • Tiles that intersect complex regions of a scene may have long tile lists • Acceleration structure in effect only 2D • Introduce 1D BSP tree for a tile along the direction of the PSF the tile belongs to • We use spatial median subdivision and force polygons to BSP leaves at a fixed depth
Tile BSP trees (cont’d) • Example of a tile BSP tree
Ray projection • The algorithm for intersecting a ray with the acceleration structure is seemingly simple:1) Find PSF that corresponds to ray2) Project ray origin onto PSF to find tile3) Intersect polygons whose id is in the tile4) Return intersected id of closes intersection • However, the ray may not correspond exactly to a PSF in the set
Ray projection (cont’d) • Project ray onto nearest PSF • Compute a list of intersected tiles with relevant t-intersection ranges • This can be done all at once,or incrementally • Incremental approach saveswork due to early raytermination
Ray projection (cont’d) Directional resolution (.5K 2K 8K) Correct image Tile resolution (162 322 642)
Ray intersection overview • To intersect a ray it is projected to the nearest PSF • Tiles are visited in near-far order, incrementally • BSP tree for a tile is searched in near-far order for the intersection range defined by the rays intersection with the tile • Ray can terminate as soon as intersection is found in a BSP node • Traversal must be fast BSP traversal is recursive, we avoid explicit recursion by unrolling and using a stack
Intersection kernels • The acceleration structure provides identifiers of polygons that may intersect the ray, to resolve these we use: • Wald’s optimized intersection- Requires pre-computed information- But very fast • Möller-Trumbore intersection- Only requires triangle vertices- But significantly slower than Wald • Both implemented as macros to ensure inlining
Intersection kernels (Wald) • Barycentric projection method • Pre-compute and store normals, edges, projection case, and simplify terms • Triangle datastructure is 48bytes + vertices • Use cache alignment, ordering matched to algorithm flow • Worst case 10 muls, 1 div, 11 adds • Best case (depth rejection) 4 muls, 1 div, 5 adds • Wald, I, “Realtime Ray Tracing and Interactive Global Illumination”, PhD Thesis, 2004.
Intersection kernels (Möller-Trumbore) • Minimum storage, only triangle vertices • No pre-computation • But no early depth rejection • Worst case 27 muls, 1 div, 23 adds • Best case - barycentric u rejection 12 muls, 16 adds - barycentric v rejection 21 muls, 21 adds • Good for unstructured motion, more on this later… • Möller, T, Trumbore, B, “Fast, minimum storage ray-triangle intersection”. Journal of graphics tools, 2(1):21-28, 1997.
Intersection kernels In the walkthrough scenario shown below the Wald intersection kernel was 20% faster than Möller-Trumbore
Rendering • Flexible ray tracing framework • Shading- Simple diffuse- OpenGL like local illumination- Full Whitted ray tracing
Rendering (cont’d) • Spatial median 3D BSP acceleration structure • Depth first and Breadth first ray tracing • Single and multi-threaded • Support triangles only – automatic triangulation • 3D file format support:- Alias Wavefront (OBJ)- Benchmark for Animated Ray Tracing (BART)- Procedural random triangle clouds
Results • Early results on artificial scenes showed promising performance • Recent results on realistic scenes confirm this • Comparison with single ray 3D BSP ray tracing (CRT) favors VLT-RT
Results (random scene) • Walkthrough of 16K randomly distributed triangles • Superior performance throughout • Less inter frame variation
Results (random scene) SHOW RANDOM SCENE VIDEO
Results (classroom scene) • Walkthrough of 46K realistic scene • Superior performance on average • Again, less inter frame variation • Memory consumption high (>1GB)
Results (classroom scene) SHOW CLASSROOM VIDEO
Future work • SIMD extensions for ray bundle intersection • Hierarchical multi VLF approach • Analytical objects- spheres- parametric surfaces • Transparency (trivial, but missing)
Publications • All publications can be found here: http://www.cs.ucl.ac.uk/research/vr/Projects/VLF/Media/