Ray Tracing using Programmable Graphics Hardware

Slides:



Advertisements
Similar presentations
COMPUTER GRAPHICS SOFTWARE.
Advertisements

COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
Status – Week 257 Victor Moya. Summary GPU interface. GPU interface. GPU state. GPU state. API/Driver State. API/Driver State. Driver/CPU Proxy. Driver/CPU.
RealityEngine Graphics Kurt Akeley Silicon Graphics Computer Systems.
The Programmable Graphics Hardware Pipeline Doug James Asst. Professor CS & Robotics.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
Control Flow Virtualization for General-Purpose Computation on Graphics Hardware Ghulam Lashari Ondrej Lhotak University of Waterloo.
A Crash Course on Programmable Graphics Hardware Li-Yi Wei 2005 at Tsinghua University, Beijing.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE408, University of Illinois, Urbana-Champaign 1 Programming Massively Parallel Processors Chapter.
3D Graphics Processor Architecture Victor Moya. PhD Project Research on architecture improvements for future Graphic Processor Units (GPUs). Research.
Status – Week 277 Victor Moya.
Pixel Shader Vertex Shader The Real-time Graphics Pipeline Input Assembler Rasterizer Output Merger.
GPU Simulator Victor Moya. Summary Rendering pipeline for 3D graphics. Rendering pipeline for 3D graphics. Graphic Processors. Graphic Processors. GPU.
The Graphics Pipeline CS2150 Anthony Jones. Introduction What is this lecture about? – The graphics pipeline as a whole – With examples from the video.
The programmable pipeline Lecture 10 Slide Courtesy to Dr. Suresh Venkatasubramanian.
Real-Time Stereo Matching on Programmable Graphics Hardware Liang Wei.
Shading Languages By Markus Kummerer. Markus Kummerer 2 / 19 State of the Art Shading.
Status – Week 260 Victor Moya. Summary shSim. shSim. GPU design. GPU design. Future Work. Future Work. Rumors and News. Rumors and News. Imagine. Imagine.
Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Shaders Feb 18, 2011 Creative Commons Attribution 3.0 (Except copyrighted.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
Under the Hood: 3D Pipeline. Motherboard & Chipset PCI Express x16.
REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006 Real-Time Volume.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Geometric Objects and Transformations. Coordinate systems rial.html.
GPU Shading and Rendering Shading Technology 8:30 Introduction (:30–Olano) 9:00 Direct3D 10 (:45–Blythe) Languages, Systems and Demos 10:30 RapidMind.
Chris Kerkhoff Matthew Sullivan 10/16/2009.  Shaders are simple programs that describe the traits of either a vertex or a pixel.  Shaders replace a.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
The Graphics Rendering Pipeline 3D SCENE Collection of 3D primitives IMAGE Array of pixels Primitives: Basic geometric structures (points, lines, triangles,
1 Dr. Scott Schaefer Programmable Shaders. 2/30 Graphics Cards Performance Nvidia Geforce 6800 GTX 1  6.4 billion pixels/sec Nvidia Geforce 7900 GTX.
The programmable pipeline Lecture 3.
CSE 690: GPGPU Lecture 6: Cg Tutorial Klaus Mueller Computer Science, Stony Brook University.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Stream Processing Main References: “Comparing Reyes and OpenGL on a Stream Architecture”, 2002 “Polygon Rendering on a Stream Architecture”, 2000 Department.
GRAPHICS PIPELINE & SHADERS SET09115 Intro to Graphics Programming.
CS662 Computer Graphics Game Technologies Jim X. Chen, Ph.D. Computer Science Department George Mason University.
The Cg Runtime Cyril Zeller. Cg Pipeline Graphics programs are written in Cg and compiled to low-level assembly code... Cg Runtime API...
Accelerated Stereoscopic Rendering using GPU François de Sorbier - Université Paris-Est France February 2008 WSCG'2008.
Introduction to OpenGL  OpenGL is a graphics API  Software library  Layer between programmer and graphics hardware (and software)  OpenGL can fit in.
M. Jędrzejewski, K.Marasek, Warsaw ICCVG, Multimedia Chair Computation of room acoustics using programable video hardware Marcin Jędrzejewski.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
OpenGL-ES 3.0 And Beyond Boston Photo credit :Johnson Cameraface OpenGL Basics.
Computer Graphics 3 Lecture 6: Other Hardware-Based Extensions Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
David Luebke 1 1/25/2016 Programmable Graphics Hardware.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE408, University of Illinois, Urbana-Champaign 1 Programming Massively Parallel Processors Lecture.
From Turing Machine to Global Illumination Chun-Fa Chang National Taiwan Normal University.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
Ray Tracing by GPU Ming Ouhyoung. Outline Introduction Graphics Hardware Streaming Ray Tracing Discussion.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE408, University of Illinois, Urbana-Champaign 1 GPU.
GLSL I.  Fixed vs. Programmable  HW fixed function pipeline ▪ Faster ▪ Limited  New programmable hardware ▪ Many effects become possible. ▪ Global.
An Introduction to the Cg Shading Language Marco Leon Brandeis University Computer Science Department.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
Computer Science – Game DesignUC Santa Cruz Tile Engine.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/XX13 – GLSL Lecture 13: OpenGL Shading Language (GLSL) COMP 175: Computer Graphics April 12, 2016.
Graphics on GPU © David Kirk/NVIDIA and Wen-mei W. Hwu,
Graphics Processing Unit
Chapter 6 GPU, Shaders, and Shading Languages
From Turing Machine to Global Illumination
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Graphics Processing Unit
Computer Graphics Practical Lesson 10
Ray Tracing on Programmable Graphics Hardware
© 2012 Elsevier, Inc. All rights reserved.
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
CIS 6930: Chip Multiprocessor: GPU Architecture and Programming
Presentation transcript:

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 Mapping applications as Graphics processes General purpose processing on the GPU Ray Casting model Extensions

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 Explain normal pipeline Bottom pictures - geometry is rasterized into the fragments that will appear for each pixel Programmable cards allow us to add programs that operate on a per-vertex or per-fragment level Only one vertex and fragment program is active at a time

Cg API-specific runtime 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) Cg compiler to generate assembly code Cg runtime - currently bound program Communication with Hardware - using 3D API Mark et al. SIGGRAPH 2003

GPU Performance Sourced from NVIDIA GPU’s making use of the same technology improvements Improved performance more apparent in parallel Work can be offloaded to an additional processing unit Improved performance for applications that map well as a graphics process Sourced from NVIDIA

Cg Processing model Vertex Program Fragment Program Register Input Registers Output Registers Register Interpolation Input Registers Output Registers Vertex Program Fragment Program Application Rasterization Display Textures Input/output for shaders. Register/texture input, colour/depth output. Register Interpolation alongside rasterization Multiple parallel fragment processors - data-parallel program on indepentant processors Idea is to map your application as a graphics process - processing done at a vertex/fragment level

Images sourced from NVIDIA 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 Draw Screen-Sized Quad Input image to be processed as a texture Bind and execute Fragment Program - Which is then run once per pixel Output result The four-component colour output could also be stored in a texture. Images sourced from NVIDIA

Cg code example Laplacian Filter Fragment Program 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 Can include Cg as a .cg file - compiled at runtime Can still write your own assembler, or modify compiler generated assembler

Ray Tracing model Ray Tracing model - types of rays, primary rays cast from the eye, through the centre of each pixel into the scene Traced primitives using our graphics hardware method Need only one intersection test between a ray and each primitive. If we were using triangles to approximate these primitives, we would need many more intersection tests - requiring ray intersection optimisations.

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 Current Intersection Shader maintains intersection buffer Render to Texture allows storage directly as a texture Updated intersection texture set as input to the next pass ~ depth buffer Using Four component colour output to store vector information in textures - 32bit floating point per component

Sphereflake test scene Results Sphereflake test scene Number of primitives affects performance - method requires an extra texture readback for each object Texture readbacks are slow - fast to send data to a graphics card, slow to get anything back. This is currently a limitation under linux only, not windows Each primitive is being intersected with all rays, no ray optimisation

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 Different rays can be in different states (rays stored as pixels) Can only operate on one type of ray at a time (only one frag prog bound per pass) State based processing method to limit processing of only those fragments in the current state Constructive Solid Geometry - We can implement a lot of different primitives with this method, a general CSG solution will allow very complex pictures to be drawn.

Summary & Questions OpenGL Graphics Pipeline Cg Application & Processing models Example: Image Filter Ray Tracing model Current Ray Casting method Results Extensions