background | software solutions | hardware solutions

21
Background | Software Solutions | Hardware Solutions Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson April 27, 2007 Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

Upload: madonna-murphy

Post on 30-Dec-2015

27 views

Category:

Documents


1 download

DESCRIPTION

Background | Software Solutions | Hardware Solutions. Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson April 27, 2007. Ray Tracing: An Alternate Method For Real Time Rendering. Jason Hutcheson. Background | Software Solutions | Hardware Solutions. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Ray Tracing: An Alternate

Method For Real Time Rendering

Jason Hutcheson

April 27, 2007

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

Page 2: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Introduction and OutlineIntroduction and Outline

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

• Developer Goal: To achieve realistic images.

• Rasterization is the most commonly used rendering method.

• Ray tracing provides images with accurate shading and illumination.

• Can ray tracing replace rasterization?

Background - Rasterization

- Ray Tracing

Software Solutions - Acceleration Structures

Hardware Solutions - Standard of Computing Power

- Specialized Hardware

Page 3: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Background – 3D RenderingBackground – 3D Rendering

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

3D Rendering is the process of taking a 3D model (represented by many primitives) and displaying it on a 2D viewport (i.e., computer monitor). Each primitive consists of a polygon, the most simple form being a triangle.

The image on the right is an example of a 3D model and what it looks like after it has

been rendered.

taken from http://graphics.cs.uni-sb.de

Page 4: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Background – RasterizationBackground – Rasterization

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

The basic rasterization algorithm converts a 3D model into a 2D image in three basic steps.

• Transform each primitive from 3D into 2D representation - transformations are done with matrix multiplication

• Clip all primitives that are not visible to the user - primitives need to be checked to see if they are within the scene

• Fill in all visible primitives - for each pixel determine which primitive is in the front

- compare depths between primitives

Page 5: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Background – RasterizationBackground – Rasterization

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

Strengths• very fast for today’s graphic requirements

• most commonly used method (very optimized) [3]

• specialized hardware already exists

Weaknesses• local illumination rendering method [5]

• multiple rendering passes for shading and reflections (need tricks) [3]

• inaccurate shadows, reflections, and refractions

• performance scales poorly scene complexity (polygon count) [1]

Images taken from http://www.q4rt.org

ray tracing rasterization

Page 6: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Background – Ray TracingBackground – Ray Tracing

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

Ray tracing can also be described in just a few steps. However the steps are very different from rasterization.

• The following process is done once for each pixel on the screen

• Shadows, reflections, and refractions are all done in a single rendering pass

Lifespan of a typical ray [1]

Page 7: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Background – Ray TracingBackground – Ray Tracing

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

Ray tracing can also be described in just a few steps. However the steps are very different from rasterization.

Step 1

• Generate a primary ray

• Launch the ray into the scene

• Ray angle is determined by virtual viewpoint and each pixel

Lifespan of a typical ray [1]Lifespan of a typical ray [1]

Page 8: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Background – Ray TracingBackground – Ray Tracing

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

Ray tracing can also be described in just a few steps. However the steps are very different from rasterization.

Step 2

• Determine collision point of primary ray

• Most computationally heavy portion of the algorithm

• Each primitive needs to be checked for a collision

Lifespan of a typical ray [1]Lifespan of a typical ray [1]

Page 9: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Background – Ray TracingBackground – Ray Tracing

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

Ray tracing can also be described in just a few steps. However the steps are very different from rasterization.

Step 3

• Determine color of pixel at collision point

• New rays generated from collision point

• One ray for each active light source

• Reflection ray created and sent through entire process

Lifespan of a typical ray [1]Lifespan of a typical ray [1]

Page 10: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Background – Ray TracingBackground – Ray Tracing

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

Strengths• “embarrassingly parallel” [2]

• each ray is independent

• performance scales logarithmically with scene complexity [1]

• dynamic illumination effects included in basic algorithm(no tricks) [3]

Weaknesses• hardware optimized for rasterization

• simple images are computationally heavy (i.e., rendering a simple cube) [5]

cube rendered with 12 triangles

Page 11: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Background – Ray TracingBackground – Ray Tracing

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

This graph shows the trends of Frame Complexity vs. FPS for 3 software ray tracing implementations (orange lines) and 2 raster

implementations with accelerated hardware (blue lines) [1].

Page 12: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Background – RecapBackground – Recap

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

Rasterization• unrealistic shadows and other advanced lighting effects• fast for today’s complexity standards• scales at least linearly with scene complexity

Ray Tracing• “embarrassingly parallel”• accurate lighting effects in a single rendering pass• computationally heavy for simple images• scales logarithmically with scene complexity

Page 13: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Software – Acceleration StructuresSoftware – Acceleration Structures

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

In addition to the basic ray tracing algorithm it has become integral to use an acceleration structure to speed up the collision detection of the rays [2].

• There are several types (including

grid-based & tree-based)• Trade off between construction time

and traversal time• The most simple of the acceleration structures are grid-based

- grids are comprised of uniformly shaped cells

- construction time is minimal but performance improvement is also• tree-based structures such as kd-trees are more complex but they give greater performance improvement [1]

Example of a grid-based acceleration structure

Page 14: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Software – Boeing 777 modelSoftware – Boeing 777 model

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

Using ray tracing accelerated by a large kd-tree this model was able to run interactively at approximately 15 fps

• model contains 350 million triangles• 12 GByte of raw geometrical data• 20 GByte total with kd-tree• interactive fly through at approximately 15 fps• 8 node cluster (2 x 1.4 Ghz & 4 GByte ram)

Images and information taken from Saarland University:

http://graphics.cs.uni-sb.de/Publications/

2005/LargeModels_VMV200

5.pdf

Page 15: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

HardwareHardware

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

Hardware has always been a major limitation for any approach to rendering high quality graphics. Ray tracing is no exception, but recent hardware trends show promise.

• Standard of computing equipment - processing power increases constantly

- quad core chips available from Intel

- make exploiting extreme parallelism of ray tracing easier

• Specialized hardware - rasterization is hardware accelerated

- hardware optimized for ray tracing

Page 16: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Hardware – Specialized Hardware (RPU)Hardware – Specialized Hardware (RPU)

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

Current hardware is not optimal for ray tracing. That is why a prototype hardware called the “RPU: A Programmable Ray Processing Unit for Real-Time Ray Tracing” was developed by Saarland University [6].

What is not suitable about current hardware?• CPUs - not enough floating point calculation power to accurately traverse acceleration structures

- even with multiple cores memory bandwidth is too limited

• GPUs - not enough flow control to support recursion

- optimized for rasterization (hard coded algorithms)

Page 17: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Hardware – Specialized Hardware (RPU)Hardware – Specialized Hardware (RPU)

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

The goal of the RPU was to combine the best features of CPUs and GPUs and use them along side specialized hardware to exploit the parallelism of ray tracing. Several specific design decisions were made to facilitate this [6].

• Threads: for each primary ray a new thread is started

• Chunks: adjacent rays will have almost identical memory requests

• Control Flow & Recursion: needed to accurately traverse chunks of adjacent rays

• Dedicated Traversal Unit: optimized to traverse acceleration structures

• Scalable Design: each RPU can handle multiple threads and work with other RPUs

Page 18: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Hardware – Specialized Hardware (RPU)Hardware – Specialized Hardware (RPU)

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

The work horse behind the RPU is multiple Shader Processing Units (SPU) working directly with dedicated Traversal Processing Units (TPU) [6].

• SPUs: similar to current GPUs except for a few features - optimized for vector operations (hard coded vector parameters) - allow recursion - special command to call TPUs

• TPUs - special fixed functions optimized for traversal of acceleration structures - dedicated to only traversing

Page 19: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

Hardware – Specialized Hardware (RPU)Hardware – Specialized Hardware (RPU)

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

Each RPU chip is connected to external I/O and memory and may contain multiple independent RPUs. Each RPU contains M SPUs, M TPUs, and one Mailboxed List Processing Unit (MPU). Multiple RPU chips can communicate through the Fast Chip Interconnect Unit [6].

Page 20: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

ConclusionConclusion

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

• Rasterization currently used for most real time rendering• Ray tracing produces higher quality images• Ray tracing scales logarithmically with scene complexity• Ray tracing is highly parallel• Acceleration structures improve render times for ray tracing• Specialized hardware could improve performance

Images taken from the openRT project at

http:www.openrt.org

Page 21: Background  |  Software Solutions  |  Hardware Solutions

Background | Software Solutions | Hardware Solutions

ReferencesReferences

Ray Tracing: An Alternate Method For Real Time Rendering Jason Hutcheson

[1] J. Hurley. Ray tracing goes mainstream, 2005. [Online; accessed 15-April 2007]

[2] S. Parker, W. Martin, P.-P. J. Sloan, P. Shirley, B. Smits, and C. Hansen. Interactive ray tracing. In SIGGRAPH ’05: ACM SIGGRAPH 2005 Courses, page 12, New York, NY, USA, 2005. ACM Press.

[3] J. Schmittler, D. Pohl, T. Dahmen, C. Vogelgesang, and P. Slusallek. Realtime ray tracing for current and future games. In SIGGRAPH ’05: ACM SIGGRAPH 2005 Courses, page 23, New York, NY, USA, 2005. ACM Press.

[4] P. Shirley. Ray tracing. In SIGGRAPH ’05: ACM SIGGRAPH 2005 Courses, page 2, New York, NY, USA, 2005. ACMP Press.

[5] A. van der Ploeg. Interactive ray tracing: the replacement of rasterization?, 2006.

[6] S. Woop, J. Schmittler, and P. Slusallek. Rpu: a programmable ray processing unit for realtime ray tracing. In SIGGRAPH ’05: ACM SIGGRAPH 2005 Papers, pages 434-444, New York, NY, USA, 2005. ACM Press.