Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

20
Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University

Transcript of Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

Page 1: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

Interactive Ray Tracing of Dynamic Scenes

Tomáš DAVIDOVIČCzech Technical University

Page 2: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

2

Three types of scenes

Static scenes Contained movement Explosions…

Page 3: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

3

Three types of scenes

Related work Havran et al.

2001 Etc????

Static scenes Build acceleration structure once Trace the structure many times

Page 4: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

4

Three types of scenes

Contained movement Build structure once Alter structure when

necessary Trace many times

Related work: Wald et al. 2007

Page 5: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

5

Three types of scenes

Explosions… Objects appear, disappear, move

wildly Cannot alter structures

Solution Rebuild every frame Use only once

References Wald et al. 2007

Page 6: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

6

What do we need?

Optimize Build + Trace time! Good structure – slow build, fast trace Poor structure – fast build, slow trace Need to find the balance

Fast build of acceleration structure Fast traversal Fast intersection Fast shading

Page 7: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

7

What do we need?

Optimize Build + Trace time! Fast build of acceleration structure

Bounding Volume Hierarchy Surface Area Heuristic approx. [Wald et

al.???] Fast traversal

Packet tracing [Wald et al. ????] Fast intersection

Vertex culling [Reshetov et al. ????] Fast shading

Page 8: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

8

BVH – SAH cost ratio

Influences: Depth of tree Triangles per

leaf

CTCI

Cost TraversalCostIntersect

Ratio = 0.1~30 tris per leaf

Depth ~20

Ratio = 1.0~3 tris per leaf

Depth ~30

Page 9: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

9

Packet traversal

Packets of rays (16x16) Uses SIMD

Traverse the tree Early hit Early miss

When in leaf Intersect triangles

Page 10: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

10

Intersection – Vertex Culling

Packet - triangle Beam plane test Triangle edge

test

Page 11: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

11

Intersection – Vertex Culling

Packet - triangle Beam plane test Triangle edge

test Standard ray-tri

test

Page 12: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

12

Packet shading

For all rays store: Hit point, view direction, normal,

material Go through all hit materials

Store Phong model coefficients Shoot light packets from light to hit

points

Page 13: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

13

Packet shading

For all rays store: Hit point, view direction, normal,

material Go through all hit materials

Store Phong model coefficients Shoot light packets from light to hit

points Compute Phong shading for the packet

Using SIMD Add color to the picture

Page 14: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

14

Models – no shading

Happy Buddha1M tris

A10218k tris

Sibenik’s Cathedral80k tris

Page 15: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

15

Ray tracing performance

less triangles

Primary rays, packets 16x16, resolution 512x512

Page 16: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

16

Build + trace performance

less triangles

Primary rays, packets 16x16, resolution 512x512

Page 17: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

17

Vertex culling speedup

Many combinations tested; packets 16x16

AB – only rays that hit leafBP – Bouding planes testNF – Triangle edge and Near Far test

Page 18: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

18

Shading “speedup”

Packets 16x16, direct illumination, no textures

Page 19: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

19

Summary and future work

Can reach 4fps for 200k tris Optimal leaf sizes

2-4 tris per leaf for Trace optimal 20-40 tris per leaf for Build + Trace

optimal Combine acceleration structures

Dynamic and static parts separated Try different acceleration structures

BIH reported to be 2.5x faster (build)

Page 20: Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.

Thank you for attentionQuestions?

Tomáš DAVIDOVIČCzech Technical University