DirectX 10 Ray Tracing - PowerPoint PPT Presentation

About This Presentation
Title:

DirectX 10 Ray Tracing

Description:

Timothy John Purcell, Ray Tracing on a Stream Processor, 2004. ... Timothy J. Purcell, Ray Tracing on Programmable Graphics Hardware, SIGGRAPH ... – PowerPoint PPT presentation

Number of Views:95
Avg rating:3.0/5.0
Slides: 18
Provided by: tlit7
Learn more at: http://coachk.cs.ucf.edu
Category:
Tags: directx | purcell | ray | tracing

less

Transcript and Presenter's Notes

Title: DirectX 10 Ray Tracing


1
DirectX 10 Ray Tracing
  • Tad Litwiller

2
Background
  • Technique for image generation that traces the
    path of light through pixels of an image plane
  • Produces very realistic images, does well with
    reflection, refraction, accurate shadows, etc.
  • Computationally expensive

3
Algorithm
  • Trace a path from the viewpoint through each
    pixel in an image plane and into the scene
  • Test for intersection with each object in the
    scene
  • If there is a ray-object collision, perform
    shading and generate reflection, refraction, and
    shadow rays
  • Composite results of shaded object material with
    additional rays

4
Algorithm
5
Algorithm
  • Ray can be defined by direction vector, and
    origin
  • My implementation supports spheres as objects
    defined by center point and radius
  • Objects have material with emissive, ambient,
    diffuse, specular, specular power, reflection,
    and refraction
  • Light source defined by position and color

6
Algorithm
  • Use DirectX to set up a Draw of points (ex.
    1024x1024)
  • The vertex shader will be run once per vertex
    (point in this case)
  • Set up the initial eye ray origin and direction
  • The geometry shader is run once per primitive,
    points in this case

7
Algorithm Geometry Shader
  • Eye ray is sent from the VS
  • Test eye ray for intersection with each sphere in
    the scene
  • Use the eye position and sphere center to get the
    distance, multiply by the ray direction, use
    quadratic equation to test intesection
  • If there is an intersection cast additional
    rays and use blinn-phong shading

8
Algorithm Additional Rays
  • Shadow
  • Trace a ray from the intersection point to each
    light source if this ray hits any other object
    its in a shadow
  • Reflected
  • Angle of incident ray matches angle of outgoing
    ray if reflected ray hits an object, use color
    from that object
  • Refracted
  • Ray passes through object and ray is bent
    depending on properties of object - if refracted
    ray hits an object, use color from that object

9
Algorith Blinn-Phong Shading
  • Use light vector, view vector, and the normal
  • Ambient
  • Constant doesnt depend on vectors
  • Diffuse
  • Light and normal vectors intensity is the same
    when viewed from any angle
  • Specular
  • Depends on all highlights vary depending on
    viewing angle
  • Emissive
  • Constant object emits light

10
Testing
  • Implemented same algorithm for both a CPU and GPU
  • Tested resolutions of 512x512, 1024x1024, and
    2048x2048
  • CPU AMD Phenom X4
  • 2.5 GHz
  • 4GB RAM
  • GPU ATI Radeon HD 4670
  • 750 MHz Core
  • 512 MB
  • 320 Stream Processors

11
CPU
12
GPU - Video
13
Results
14
Conclusion
  • This is a very simplistic algorithm only
    spheres and no acceleration structure
  • Can be much more optimized on both CPU and GPU,
    so speed up will likely change, but still be very
    high because of the high level of data parallelism

15
Future Work
  • Add ray-triangle intersection so much more robust
    objects could be loaded
  • Add an acceleration structure such as uniform
    grid, bounding volume, or k d-tree
  • Use geometry shader more effectively for
    additional ray bounces stream out and DrawAuto

16
References
  • Timothy John Purcell, Ray Tracing on a Stream
    Processor, 2004.
  • Martin Christen, Ray Tracing on GPU, 2005.
  • Timothy J. Purcell, Ray Tracing on Programmable
    Graphics Hardware, SIGGRAPH
  • Colleagues Vineet Goel, Mangesh Nijasure and
    Marcos Zini

17
Questions?
Write a Comment
User Comments (0)
About PowerShow.com