LCTS: Ray Shooting using Longest Common Traversal Sequences Vlastimil Havran, Jiří Bittner havran@fel.cvut.cz Dept. of Computer Science Czech Technical University in Prague Department of Computer Science and Engineering Computer Graphics Group http://www.cgg.cvut.cz Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
Outline 1) Introduction (ray shooting, BSP tree) 2) Key Idea of LCTS 3) Simple LCTS 4) Hierarchical LCTS 5) Improvements for LCTS 6) Application and Results 7) Conclusions and Future Work Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
1) Introduction - ray shooting Given a ray, find out the first object intersected. A B D C ray Input: a scene and a ray Output: the object C Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
1) Introduction to BSP trees - construction A 4 B C A 2 B y C 3 C D D x Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
1) Introduction to BSP trees - recursive ray traversal algorithm Left only L R Left, then right Interior node of BSP tree L R Right only L R Right, then left Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
1) Introduction to BSP trees - recursive ray traversal algorithm 4 L R A 2 L R A B 3 4 y ray 2 C R R D B C1 C2 Left | Right 3 Intersection found D Stack: x Left | Right 4 2 Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
1) Introduction to BSP trees - Efficiency of ray shooting Total ray shooting time = time for ray-object intersection tests + time for ray traversal of BSP tree 1) Decreasing number of ray-object intersection tests 2) Faster ray-object intersection tests 3) Decreasing number of traversal steps 4) Faster traversal step Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
2) LCTS - MAIN IDEA 1 B 3 C 2 A D R2 R1: 1 1 3 A D R1 2 3 A B x y B 2 Ray origin A B Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
3) Simple LCTS = sequence of leaves R1, R2: 1 2 3 A B R2 Traversal History for R1: head A tail 1 3 A D B R1 Traversal History for R2: x y B head 2 A tail C B SLCTS(R1, R2): head A tail Ray origin B Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
3) Simple LCTS - Problems 1) No common sequence of leaves exists. 2) When accessing SLCTS, object was not found, and traversal has to continue further. A C B D 1 3 2 4 x y R1 x y A C B D 1 3 4 2 R1 R2 ; R2 Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
4) Hierarchial LCTS 1 B 3 C 2 A D Traversal History for R1: 1(R,L) 1 3 x y B 2 R1 Ray origin C Traversal History for R2: 1(R,L) 2(R) 3(R,L) A B D Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
4) Hierarchial LCTS - contd. Matching two traversal histories into common one: Traversal History for R1: 1 B 3 C 2 A D 1(R,L) 2(L) 3(R,L) C B D Common Traversal History for all rays between R1 and R2: Traversal History for R2: = HLCTS(R1, R2): head 1(R,L) tail 2(?) D B 2(R) 3(R,L) A B D Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
4) Hierarchical LCTS - contd. 1) Matching traversal histories for two or more rays. 2) Matching traversal histories for rays with the previously constructed common traversal history. R1 HLCTS1 - constructed from traversal history of R1 and R2 HLCTS2 R3 HLCTS1 Ray R3 - traversal uses HLCTS1 R2 HLCTS2 - constructed from HLCTS1 and traversal history of R3 Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
5) Further Improvements of LCTS concept 1) Unification of empty leaves. 2) Common termination object. 3) Initial leaf sequence. Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
5) Unification of empty leaves LCTS(R1,R2): head tail 2(?) 2(?) 1 3 D B 5 A 4 R2 y 2 R1 Ray origin head Simplified LCTS(R1,R2): = C x 2(?) tail Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
Termination object must be convex ! tail head Simplified LCTS(R1,R2): C D B 5 A 4 Ray origin y R2 2 R1 C 1 3 = tail head More simplified LCTS(R1,R2): C x Termination object must be convex ! Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
5) Initial Leaf Sequence - only for HLCTS Use: For matching common traversal sequence with new traversal history of ray. How: Initial leaf nodes of HLCTS need not be matched, but they are copied only. R1 HLCTS2 R3 HLCTS1 R2 Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
6) LCTS Application and Results Application - where rays exhibit similarities. 1) Hidden Surface Removal A C B D 1 2 3 x y 4 5 A B 2) Shooting between two patches. Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
ad 6) Application and Results - contd. Hidden Surface Removal Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
ad 6) Application and Results - contd. Hidden Surface Removal: four methods - use of SLCTS and HLCTS - using LCTS concept in one or two dimensions SLCTS + scanline: SLCTS + two dimensions: SLCTS 1 3 4 SLCTS 2 6 7 5 SLCTS 1 5 6 SLCTS 2 15 16 13 7 8 9 17 18 19 10 11 12 20 21 22 3 4 14 Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
ad 6) Application and Results - contd. - Number of traversal steps decreases typically by more than 60 %. - Time devoted to ray shooting decreases typically by 20 %. - Speedup achieved is scene and resolution dependent. Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
7) Conclusions and Further Work - New concept of traversal coherence introduced. (not restricted to BSP tree only.) - SLCTS and HLCTS. - Hidden Surface Removal tested. Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
7) Further Work - automatic setting of image resolution for SLCTS. - application for higher order rays in global illumination algorithms. - other image sampling patterns for HLCTS in hidden surface removal. - use of LCTS in rendering animation sequences. Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences
- Eduard Groeller and Jan Prikryl from Acknowledgements: - Eduard Groeller and Jan Prikryl from Vienna University of Technology. - Czech-Austrian scientific cooperation grant Aktion number 1999/17. - IGP company for partially sponsoring my visit here. Vlastimil Havran, Jiri Bittner: LCTS: Ray Shooting using Longest Common Traversal Sequences