Ray%20Tracing%20using%20Programmable%20Graphics%20Hardware - PowerPoint PPT Presentation

About This Presentation
Title:

Ray%20Tracing%20using%20Programmable%20Graphics%20Hardware

Description:

Title: Ray Tracing using Programmable Graphics Hardware Author: Andrew Wood Last modified by: Computer Science Created Date: 11/20/2004 5:30:56 AM – PowerPoint PPT presentation

Number of Views:132
Avg rating:3.0/5.0
Slides: 14
Provided by: Andrew1843
Category:

less

Transcript and Presenter's Notes

Title: Ray%20Tracing%20using%20Programmable%20Graphics%20Hardware


1
Ray Tracing using Programmable Graphics Hardware
  • Andrew Wood, Brendan McCane Scott A. King

Graphics Vision Research Group Department of
Computer Science University of Otago
IVCNZ 2004
2
Outline
  • Using Cg with OpenGL
  • Where does Cg fit in?
  • Benefits of Programmable Graphics Hardware
  • Mapping applications as Graphics processes
  • General purpose processing on the GPU
  • Ray Casting model
  • Extensions

3
OpenGL Graphics Pipeline
3D Application
3D API OpenGL Or DirectX
GPU Front End
Primitive Assembly
Rasterization Interpolation
Framebuffer Tests
Framebuffer
Programmable Vertex Processor
Programmable Fragment Processor
4
Cg Application model
Application
  • Cg - high level, c-like language
  • Cg compiler to generate assembler
  • Cg Runtime
  • Communication with Hardware

Cg API-specific runtime (OpenGL, DX8 or DX9)
Cg common runtime (includes compiler)
OpenGL or Direct3D Graphics Driver Graphics
Hardware
Mark et al. SIGGRAPH 2003
5
GPU Performance
Sourced from NVIDIA
6
Cg Processing model
Input Registers
Output Registers
Input Registers
Output Registers
Register Interpolation
Vertex Program
Fragment Program
Application
Rasterization
Display
Textures
7
Example Image Filter
  • Draw screen-sized quad
  • Input image to be processed as texture
  • Edge-detection fragment program is run once per
    pixel
  • Output results to screen or save to texture

Laplacian Filter Fragment Program
Images sourced from NVIDIA
8
Cg code example
half4 main(half2 coords TEX0, sampler2D
texture) COLOUR const half offset 1.0 /
256 half4 c tex2D(texture, coords) half4
bl tex2D(texture, coords half2(-offset,
offset)) half4 l tex2D(texture, coords
half2(offset, 0)) half4 b
tex2D(texture, coords half2(0,
offset)) return 8 (c -0.125 (bl l
b))
Laplacian Filter Fragment Program
9
Ray Tracing model
10
Current Ray Casting method
CPU
Current Object
Eye ray texture
Stream of Objects
Object Intersection Shader
Object Intersection Shaders
Current Intersection texture
Eye Rays
Quadric Intersection Shader
Triangle Intersection Shader
Current Object Intersections
New Intersection Texture
Closest Intersections
  • Render to Texture used to store results
  • Updated intersection texture set as input for
    next pass

Lights
Colour Calculation Shader
Object Materials
Output Image
11
Results
Sphereflake test scene
12
Extensions
  • Full recursive model
  • Different rays can be in different states
  • State based processing
  • Limiting processing to one type of ray
  • Application for method Constructive Solid
    Geometry

13
Summary Questions
  • OpenGL Graphics Pipeline
  • Cg Application Processing models
  • Example Image Filter
  • Ray Tracing model
  • Current Ray Casting method
  • Results
  • Extensions
Write a Comment
User Comments (0)
About PowerShow.com