GPU Tutorial 이윤진 Computer Game 2007 가을 2007 년 11 월 다섯째 주, 12 월 첫째 주.

Slides:



Advertisements
Similar presentations
COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
Advertisements

Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
Prepared 5/24/2011 by T. O’Neil for 3460:677, Fall 2011, The University of Akron.
The Programmable Graphics Hardware Pipeline Doug James Asst. Professor CS & Robotics.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 CS5500 Computer Graphics April 19, 2007.
Control Flow Virtualization for General-Purpose Computation on Graphics Hardware Ghulam Lashari Ondrej Lhotak University of Waterloo.
GLSL I May 28, 2007 (Adapted from Ed Angel’s lecture slides)
A Crash Course on Programmable Graphics Hardware Li-Yi Wei 2005 at Tsinghua University, Beijing.
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
Status – Week 277 Victor Moya.
Evolution of the Programmable Graphics Pipeline Patrick Cozzi University of Pennsylvania CIS Spring 2011.
Status – Week 283 Victor Moya. 3D Graphics Pipeline Akeley & Hanrahan course. Akeley & Hanrahan course. Fixed vs Programmable. Fixed vs Programmable.
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.
Mohan Sridharan Based on slides created by Edward Angel GLSL I 1 CS4395: Computer Graphics.
Graphics Processors CMSC 411. GPU graphics processing model Texture / Buffer Texture / Buffer Vertex Geometry Fragment CPU Displayed Pixels Displayed.
Introduction What is GPU? It is a processor optimized for 2D/3D graphics, video, visual computing, and display. It is highly parallel, highly multithreaded.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
GPGPU overview. Graphics Processing Unit (GPU) GPU is the chip in computer video cards, PS3, Xbox, etc – Designed to realize the 3D graphics pipeline.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Under the Hood: 3D Pipeline. Motherboard & Chipset PCI Express x16.
CSE 690 General-Purpose Computation on Graphics Hardware (GPGPU) Courtesy David Luebke, University of Virginia.
General-Purpose Computation on Graphics Hardware.
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.
May 8, 2007Farid Harhad and Alaa Shams CS7080 Over View of the GPU Architecture CS7080 Class Project Supervised by: Dr. Elias Khalaf By: Farid Harhad &
Mapping Computational Concepts to GPUs Mark Harris NVIDIA Developer Technology.
Computer Graphics Graphics Hardware
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.
Cg Programming Mapping Computational Concepts to GPUs.
General-Purpose Computation on Graphics Hardware Adapted from: David Luebke (University of Virginia) and NVIDIA.
General-Purpose Computation on Graphics Hardware.
The programmable pipeline Lecture 3.
GRAPHICS PIPELINE & SHADERS SET09115 Intro to Graphics Programming.
CS662 Computer Graphics Game Technologies Jim X. Chen, Ph.D. Computer Science Department George Mason University.
May 8, 2007Farid Harhad and Alaa Shams CS7080 Overview of the GPU Architecture CS7080 Final Class Project Supervised by: Dr. Elias Khalaf By: Farid Harhad.
Week 3 Lecture 4: Part 2: GLSL I Based on Interactive Computer Graphics (Angel) - Chapter 9.
Fateme Hajikarami Spring  What is GPGPU ? ◦ General-Purpose computing on a Graphics Processing Unit ◦ Using graphic hardware for non-graphic computations.
© David Kirk/NVIDIA and Wen-mei W. Hwu, ECE408, University of Illinois, Urbana-Champaign 1 Programming Massively Parallel Processors Lecture.
David Angulo Rubio FAMU CIS GradStudent. Introduction  GPU(Graphics Processing Unit) on video cards has evolved during the last years. They have become.
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.
Background image by chromosphere.deviantart.com Fella in following slides by devart.deviantart.com DM2336 Programming hardware shaders Dioselin Gonzalez.
Mapping Computational Concepts to GPUs Mark Harris NVIDIA.
OpenGL Shading Language
Programmable Graphics Hardware CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia.
The Graphics Pipeline Revisited Real Time Rendering Instructor: David Luebke.
GPGPU introduction. Why is GPU in the picture Seeking exa-scale computing platform Minimize power per operation. – Power is directly correlated to the.
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.
GPU Architecture and Its Application
COMPUTER GRAPHICS CHAPTER 38 CS 482 – Fall 2017 GRAPHICS HARDWARE
A Crash Course on Programmable Graphics Hardware
CS427 Multicore Architecture and Parallel Computing
Graphics Processing Unit
Deferred Lighting.
Chapter 6 GPU, Shaders, and Shading Languages
The Graphics Rendering Pipeline
Real-time Computer Graphics Overview
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
Graphics Processing Unit
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
Graphics Processing Unit
CIS 6930: Chip Multiprocessor: GPU Architecture and Programming
Presentation transcript:

GPU Tutorial 이윤진 Computer Game 2007 가을 2007 년 11 월 다섯째 주, 12 월 첫째 주

Contents Introduction to GPU High-level shading languages GPU applications

Introduction to GPU 이윤진 Computer Game 2007 가을 2007 년 11 월 26 일

Slide Credits Marc Olano (UMBC) ◦ SIGGRAPH 2006 Course notes David Luebke (University of Virginia) ◦ SIGGRAPH 2005, 2007 Course notes Mark Kilgard (NVIDIA Corporation) ◦ SIGGRAPH 2006 Course notes Rudolph Balaz and Sam Glassenberg (Microsoft Corporation) ◦ PDC 05 Randy Fernando and Cyril Zeller (NVIDIA Corporation) ◦ I3D 2005

Americas Army GPU GPU: Graphics Processing Unit ◦ Designed for real-time graphics ◦ Present in almost every PC ◦ Increasing realism and complexity

Growth of GPU (NVIDIA)

Performance matrices ◦ since 2000, the amount of horsepower applied to processing 3D vertices and fragments has been growing at a staggering rate

Computational Power GPUs are fast … ◦ 3.0 GHz Intel Core2 Duo (Woodcrest Xeon 5160):  Computation: 48 GFLOPS peak  Memory bandwidth: 21 GB/s peak  Price: $874 (chip) ◦ NVIDIA GeForce 8800 GTX:  Computation: 330 GFLOPS observed  Memory bandwidth: 55.2 GB/s observed  Price: $599 (board) GPUs are getting faster, faster ◦ CPUs: 1.4 × annual growth ◦ GPUs: 1.7 × (pixels) to 2.3 × (vertices) annual growth

Computational Power

Why are GPUs getting faster so fast? ◦ Arithmetic intensity  the specialized nature of GPUs makes it easier to use additional transistors for computation ◦ Economics  multi-billion dollar video game market is a pressure cooker that drives innovation to exploit this property

Flexible and Precise Modern GPUs are deeply programmable ◦ Programmable pixel, vertex, and geometry engines ◦ Solid high-level language support Modern GPUs support “ real ” precision ◦ 32 bit floating point throughout the pipeline  High enough for many (not all) applications  Vendors committed to double precision soon ◦ DX10-class GPUs add 32-bit integers

GPU Fundamentals: Graphics Pipeline A simplified graphics pipeline ◦ Note that pipe widths vary ◦ Many caches, FIFOs, and so on not shown GPUCPU Application Transform & Light Rasterize Shade Video Memory (Textures) Xformed, Lit Vertices (2D) Graphics State Render-to-texture Assemble Primitives Vertices (3D) Screenspace triangles (2D) Fragments (pre-pixels) Final Pixels (Color, Depth)

GPU Transform & Light CPU Application Rasterize Shade Video Memory (Textures) Xformed, Lit Vertices (2D) Graphics State Render-to-texture Assemble Primitives Vertices (3D) Screenspace triangles (2D) Fragments (pre-pixels) Final Pixels (Color, Depth) GPU Fundamentals: Modern Graphics Pipeline Programmable vertex processor! Programmable pixel processor! Fragment Processor Vertex Processor

GPUCPU Application Vertex Processor Rasterize Fragment Processor Video Memory (Textures) Xformed, Lit Vertices (2D) Graphics State Render-to-texture Vertices (3D) Screenspace triangles (2D) Fragments (pre-pixels) Final Pixels (Color, Depth) GPU Fundamentals: Modern Graphics Pipeline Assemble Primitives Geometry Processor Programmable primitive assembly! More flexible memory access!

GPU Pipeline: Transform Vertex processor (multiple in parallel) ◦ Transform from “ world space ” to “ image space ” ◦ Compute per-vertex lighting

GPU Pipeline: Assemble Primitives Geometry processor ◦ How the vertices connect to form a primitive ◦ Per-Primitive Operations

GPU Pipeline: Rasterize Rasterizer ◦ Convert geometric rep. (vertex) to image rep. (fragment)  Pixel + associated data: color, depth, stencil, etc. ◦ Interpolate per-vertex quantities across pixels

GPU Pipeline: Shade Fragment processors (multiple in parallel) ◦ Compute a color for each pixel ◦ Optionally read colors from textures (images)

GPU Parallelism GeForce 7900 GTX

GPU Programming Simplified computational model ◦ consistent as hardware changes All stages SIMD Fixed conversion / remapping between each stage Buffer Vertex (stream) Geometry (stream) Fragment (array)

Example Vertex shader void main() { gl_FrontColor = gl_Color; gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex; } Pixel shader void main() { gl_FragColor = gl_Color; } Buffer Vertex (stream) Geometry (stream) Fragment (array)

Vertex Shader One element in / one out No communication Can select fragment address Input: ◦ Vertex data (position, normal, color, …) ◦ Shader constants, Texture data Output: ◦ Required: Transformed clip-space position ◦ Optional: Colors, texture coordinates, normals (data you want passed on to the pixel shader) Restrictions: ◦ Can’t create new vertices

Pixel Shader Biggest computational resource One element in / 0 – 1 out Cannot change destination address No communication Input: ◦ Interpolated data from vertex shader ◦ Shader constants, Texture data Output: ◦ Required: Pixel color (with alpha) ◦ Optional: Can write additional colors to multiple render targets Restrictions: ◦ Can’t read and write the same texture simultaneously

Example Vertex shader void main() { vec4 v = vec4(gl_Vertex); v.z = 0.0; gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex; } Pixel shader void main() { gl_FragColor = vec4(0.8,0.4,0.4,1.0); }

Geometry Shader One element in / 0 to ~100 out ◦ Limited by hardware buffer sizes Like vertex: ◦ No communication ◦ Can select fragment address Input: ◦ Entire primitive (point, line, or triangle) ◦ Optional: Adjacency Output: ◦ Zero or more primitives (a homogenous list of points/lines or triangles) Restrictions: ◦ Allow parallel processing but preserve serial order

Geometry Shader Applications ◦ Fur/fins, procedural geometry/detailing, ◦ Data visualization techniques, ◦ Wide lines and strokes, …

Multiple Passes Communication ◦ None in one pass ◦ Arbitrary read addresses between passes Buffer Vertex (stream) Geometry (stream) Fragment (array)

Example Image Space Silhouette Extraction Using Graphics Hardware [Wang 2005] Depth bufferNormal buffer SilhouettesCreases Final result

GPU Applications Bump/Displacement mapping Height map Diffuse light without bumpDiffuse light with bump

GPU Applications Volume texture mapping

GPU Applications Cloth simulation

GPU Applications

Real-time rendering Image processing General purpose GPU (GPGPU) …

Contents Introduction to GPU High level shading languages GPU applications

GPU Applications Soft Shadows Percentage-closer soft shadows [Fernando 2005]