1 / 13

Ray Tracing using Programmable Graphics Hardware

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. Outline. Using Cg with OpenGL Where does Cg fit in? Benefits of Programmable Graphics Hardware

olaf
Download Presentation

Ray Tracing using Programmable Graphics Hardware

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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) OpenGL or Direct3D Graphics Driver Graphics Hardware Cg common runtime (includes compiler) Mark et al. SIGGRAPH 2003

  5. GPU Performance Sourced from NVIDIA

  6. Cg Processing model Input Registers Output Registers Register Interpolation Input Registers Output Registers 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 • Render to Texture used to store results • Updated intersection texture set as input for next pass 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 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

More Related