1 view coherence acceleration for ray traced animation university of colorado at colorado springs...

28
1 View Coherence Acceleration for Ray Traced Animation University of Colorado at Colorado Springs Master’s Thesis Defense by Philip Glen Gage April 19, 2002

Post on 20-Dec-2015

223 views

Category:

Documents


0 download

TRANSCRIPT

1

View Coherence Acceleration for Ray Traced Animation

University of Colorado at Colorado Springs

Master’s Thesis Defense

by Philip Glen Gage

April 19, 2002

2

Introduction

• Ray tracing generates realistic images

• Ray tracing is slow, realism/speed tradeoff

• Many ray tracing acceleration methods

• Accelerate animation using frame coherence

• Earlier methods have static view limitation

• Thesis adds pan/zoom from fixed viewpoint

3

Ray Tracing

• Trace rays from eye through pixels to scene

• Find closest ray-object intersection point

• Recursive reflection and refraction rays

• Shadow rays to each light source

• Apply shading model to color pixel

4

Ray Tracing Geometry

Eye orcamera

Image Plane

Pixel

Normal

Reflection Ray

Transmission Ray

Light Sources

Object

Shadow Rays

IntersectionPoint

5

Ray Tracing Acceleration

• Faster, fewer ray-object intersection tests– Bounding volume hierarchy– Spatial subdivision into voxels

• Coherence– Image space– Object space– Temporal (frame)– View (new)

Spatial Subdivision

6

Animation Acceleration

Image Space Object Space

Lights Saved light and surface

parameters [SEQU89]

Saved ray trees [BRIE96]

Objects Frame interpolation

[CHAP90]

Temporal coherence

[MURA90, JEVA92]

View Pixel reprojection

[ADEL95, WALD01]

7

Jevans OSTC Paper

• “Object Space Temporal Coherence for Ray Tracing,” D. Jevans, Graphics Interface, 1992

• Accelerate object animation using spatial grid

• Image divided into 16x16 grid of 256 areas

• Voxels save bitmap of dependent image areas

• Ray trace only changed areas of each frame

• Jevans requires a static camera view

8

OSTC Operation

Eye

Spatial Subdivision Voxel Grid

Rays

Image Areas

0 0

1

11

0

0

0

0 0

0

0

0

0

0

0

Rays set image area bit in each traversed voxel bitmap

9

New Pan Algorithm

• Pan by shifting image and retracing new area

• Standard view fails, angle varies per pixel

• Requires an equal-angle view projection

• Cylindrical equirectangular map projection

• 360º panorama view, distorts at wide angles

Standard Cylindrical

10

Pan by Image Shift and Redraw

NewFrame

PreviousFrame

PanDirection

ShiftDirection

Shift andreuse pixels

Ray trace for vertical pan

Ray tracefor

horizpan

Ray traceonlyonce

11

Cylindrical View Projection

Eye

Ray

Longitude (azimuth)

Latitude (elevation)

90

-90-180 180

World MapPanoramic View

45

0

-45

-90 0 90

Unroll Cylinder0

30

-30

-60

60

0

90

180

Latitude (elevation)

Longitude (azimuth)

12

Projection Comparison

a) Standard Projection 30 Angle b) Standard Projection 100 Angle

c) Cylindrical Projection 30 Angle d) Cylindrical Projection 100 Angle

13

New Zoom Algorithm

• Large image buffer to accelerate smooth zoom

• Smaller viewport samples ray traced image

• Ray trace only sampled pixels on demand

• Ray traced image buffer acts as pixel cache

• 2D transforms for zoom, rotate, warp effects

• Viewport range limited by image buffer size

14

Ray Trace and Viewport Images

640x480 ray traced image with sampled pixels

320x200 sampled zoom viewport

320x200 zoom and rotate viewport

15

New Algorithm Summary

• Panimation – Shift previous frame image, ray trace new area– Equal-angle pixels using cylindrical projection– Fast pan, slow zoom, unlimited range

• Ray Sample Viewport (RSVP)– Sample ray traced image, ray trace on demand– Any view projection may be used– Fast pan, zoom, 2D transforms, limited range

16

Algorithm Summary

• OSTC acceleration (Jevans)– Voxels have bitmap of dependent image areas– Fast object and light animation, static camera

• Integrated approach (all three algorithms)– Panimation for large pan and zoom, pixel cache– RSVP for small pan, zoom, other effects– OSTC method for object and light animation– Accelerates all animation except camera motion

17

Integration

• Integrating new pan and zoom algorithms– Draw new areas in null color instead of ray tracing– If viewport samples a null color pixel, ray trace– A viewport transform can fix cylindrical distortion

• Integrating OSTC and new algorithms– Draw areas changed by animation in null color– Keep pan pixel offset for OSTC bitmap areas– Wrap OSTC bitmap area rows/columns for pan

18

Integrated Architecture

Eye

Cylindrical EquidistantView Projection

Ray Traced Panimation and OSTC Image Buffer with

Cylindrical Distortion

Ray SampleViewport (RSVP) without

Cylindrical Distortion

Transforms forpan, zoom, rotate,inverse cylindrical

& other effectsaccelerated bypixel caching

Pan accelerated by image shift,

animation accelerated by OSTC

Panoramic WorldView Plane

Objects

19

Panimation and OSTC

Black areas due to pan and animation need to be ray traced, other pixels are reused from previous frame

20

Camera and Viewport

640x480 ray traced camera image sampled pixels with cylindrical distortion

320x200 viewport image from sampled pixelswith cylindrical distortion removed forstandard view appearance

21

Implementation

• Started with my CS 581 C++ ray tracer

• Converted to Java JDK 1.3.1 on PC

• Added uniform spatial subdivision, OSTC

• Added new Panimation, RSVP algorithms

• Integrated OSTC, Panimation and RSVP

• Tested animation, interactive virtual reality

22

Architecture

• World has lights, objects, cameras, viewports

• Each has an animate(framenumber) method

• World has a uniform spatial subdivision grid

• Each camera contains an OSTC bitmap grid

• Each camera has a framebuffer for ray tracing

• Each viewport has framebuffer for sampling

23

Animation Algorithm

For each frame

Animate lights, if changed, set voxel changed flags

Animate objects, if changed, set voxel changed flags

Animate cameras, update images using Panimation, OSTC

Animate viewports, update images using RSVP

Clear all voxel changed flags

24

ResultsTraditional Algorithm Accelerated Algorithm

Type ofOperation

Number ofFrames

Number ofRays

ExecutionTime (sec)

Number ofRays

ExecutionTime (sec)

1 64000 1.2 64000 1.110 640000 9.4 83800 1.7

Pan

100 6400000 69.6 281800 6.91 64000 1.3 63922 1.810 640000 12.1 154616 4.4

Zoom

100 6400000 120.8 165957 18.91 64000 1.1 64000 1.510 640000 9.8 222160 5.8

Animate

100 6400000 96.2 1633360 43.61 64000 1.3 63922 2.010 640000 11.5 221384 6.4

Pan, ZoomandAnimate 100 6400000 71.3 880475 31.8

25

Future Work

• Panimation 2:1 zoom can reuse 1/4 pixels

• Automatic pan/zoom camera for viewports

• Use shift, redraw areas for delta compression

• Add saved ray trees for faster light changes

• Add reprojection to handle camera motion

26

Conclusion

• Researched ray traced animation acceleration

• Developed new algorithms for fast pan/zoom

• Implemented and tested algorithms in Java

• Integrated new pan/zoom with Jevans method

• Order of magnitude pan/zoom speed increase

• Many uses in animation and virtual reality

27

Demonstration

28