Spring 2009 Prof. Hyesoon Kim

Similar documents
Spring 2011 Prof. Hyesoon Kim

CS451Real-time Rendering Pipeline

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

CS8803SC Software and Hardware Cooperative Computing GPGPU. Prof. Hyesoon Kim School of Computer Science Georgia Institute of Technology

Rasterization Overview

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

Graphics Hardware. Instructor Stephen J. Guy

CS427 Multicore Architecture and Parallel Computing

Mattan Erez. The University of Texas at Austin

Lecture 2. Shaders, GLSL and GPGPU

The Rasterization Pipeline

CHAPTER 1 Graphics Systems and Models 3

Graphics Processing Unit Architecture (GPU Arch)

Rendering Objects. Need to transform all geometry then

Mattan Erez. The University of Texas at Austin

Scanline Rendering 2 1/42

Programming Graphics Hardware

X. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1

Threading Hardware in G80

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Tutorial on GPU Programming #2. Joong-Youn Lee Supercomputing Center, KISTI

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

Evolution of GPUs Chris Seitz

CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

Architectures. Michael Doggett Department of Computer Science Lund University 2009 Tomas Akenine-Möller and Michael Doggett 1

GPU Architecture and Function. Michael Foster and Ian Frasch

CS130 : Computer Graphics. Tamar Shinar Computer Science & Engineering UC Riverside

Models and Architectures

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

2.11 Particle Systems

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

1. Introduction 2. Methods for I/O Operations 3. Buses 4. Liquid Crystal Displays 5. Other Types of Displays 6. Graphics Adapters 7.

Shaders. Slide credit to Prof. Zwicker

Mattan Erez. The University of Texas at Austin

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

The Application Stage. The Game Loop, Resource Management and Renderer Design

Graphics Hardware. Graphics Processing Unit (GPU) is a Subsidiary hardware. With massively multi-threaded many-core. Dedicated to 2D and 3D graphics

CSE4030 Introduction to Computer Graphics

Graphics Hardware, Graphics APIs, and Computation on GPUs. Mark Segal

CS 130 Final. Fall 2015

The Graphics Pipeline

Spring 2009 Prof. Hyesoon Kim

CS130 : Computer Graphics Lecture 2: Graphics Pipeline. Tamar Shinar Computer Science & Engineering UC Riverside

Pipeline Operations. CS 4620 Lecture 14

Rendering Grass with Instancing in DirectX* 10

A Trip Down The (2011) Rasterization Pipeline

Could you make the XNA functions yourself?

CS 428: Fall Introduction to. OpenGL primer. Andrew Nealen, Rutgers, /13/2010 1

Programmable GPUs. Real Time Graphics 11/13/2013. Nalu 2004 (NVIDIA Corporation) GeForce 6. Virtua Fighter 1995 (SEGA Corporation) NV1

GeForce4. John Montrym Henry Moreton

Spring 2010 Prof. Hyesoon Kim. AMD presentations from Richard Huddy and Michael Doggett

Cornell University CS 569: Interactive Computer Graphics. Introduction. Lecture 1. [John C. Stone, UIUC] NASA. University of Calgary

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

The Rendering Pipeline (1)

Introduction to CUDA (1 of n*)

Optimizing Games for ATI s IMAGEON Aaftab Munshi. 3D Architect ATI Research

Introduction to Computer Graphics with WebGL

CS 354R: Computer Game Technology

From Vertices to Fragments: Rasterization. Reading Assignment: Chapter 7. Special memory where pixel colors are stored.

The Rasterization Pipeline

Performance OpenGL Programming (for whatever reason)

Windowing System on a 3D Pipeline. February 2005

Ciril Bohak. - INTRODUCTION TO WEBGL

Adaptive Point Cloud Rendering

Lecture 15: Introduction to GPU programming. Lecture 15: Introduction to GPU programming p. 1

Drawing Fast The Graphics Pipeline

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

Antonio R. Miele Marco D. Santambrogio

PROFESSIONAL. WebGL Programming DEVELOPING 3D GRAPHICS FOR THE WEB. Andreas Anyuru WILEY. John Wiley & Sons, Ltd.

Graphics Performance Optimisation. John Spitzer Director of European Developer Technology

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

3D Rendering Pipeline

CS 130 Exam I. Fall 2015

Current Trends in Computer Graphics Hardware

Line Drawing. Introduction to Computer Graphics Torsten Möller / Mike Phillips. Machiraju/Zhang/Möller

Module 13C: Using The 3D Graphics APIs OpenGL ES

3D buzzwords. Adding programmability to the pipeline 6/7/16. Bandwidth Gravity of modern computer systems

1.2.3 The Graphics Hardware Pipeline

CIS 581 Interactive Computer Graphics

Graphics Hardware and Display Devices

Standard Graphics Pipeline

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

Advanced Rendering Techniques

Line Drawing. Foundations of Computer Graphics Torsten Möller

Optimisation. CS7GV3 Real-time Rendering

CS 4620 Program 3: Pipeline

Motivation Hardware Overview Programming model. GPU computing. Part 1: General introduction. Ch. Hoelbling. Wuppertal University

Introduction to Visualization and Computer Graphics

Portland State University ECE 588/688. Graphics Processors

CS 179: GPU Programming

Drawing Fast The Graphics Pipeline

RASTERISED RENDERING

- Rasterization. Geometry. Scan Conversion. Rasterization

ECE 571 Advanced Microprocessor-Based Design Lecture 20

Monday Morning. Graphics Hardware

NVIDIA nfinitefx Engine: Programmable Pixel Shaders

Shading Shades. Frank Jargstorff. June 1, Abstract

Introduction to Shaders.

Transcription:

Spring 2009 Prof. Hyesoon Kim

Application Geometry Rasterizer CPU Each stage cane be also pipelined The slowest of the pipeline stage determines the rendering speed. Frames per second (fps)

Executes on the CPU - Collision detection may provide the feedback - Global acceleration -.. algorithms, etc - Generate rendering primitives, points, lines, triangles.. - Input from other sources (keyboard, mouse..)

The majority of the per-polygon and per-vertex operations (Floating point operations) Intel s MMX/SSE Old time: Software implementation. Move objects (matrix multiplication) Move the camera (matrix multiplication) Compute lighting at vertices of triangle Model & View Transform Vertex Shading Project onto screen (3D to 2D) Clipping (avoid triangles outside screen) Map to window Projection Clipping Screen Mapping

The defining corners of a primitive Often means a triangle A Triangle Vertices David Kirk/NVIDIA and Wen-mei W. Hwu, 2007 ECE 498AL, UIUC

From GEOMETRY to visible pixels on screen Add textures and various other per-pixel operations And visibility is resolved here: sorts the primitives in the z- direction Per pixel operation Mostly integer operations

Application Geometry Rasterizer Frame Buffer

2D array of R,G,B color pixel values 8 bits (256 levels) per color component Three 8-bit components can represent 16 million different colors, including 256 shades of gray 4 th component: alpha; used for blending David Kirk/NVIDIA and Wen-mei W. Hwu, 2007 ECE 498AL, UIUC

AGP: Advanced Graphics Port an interface between the computer core logic and the graphics processor AGP 1x: 266 MB/sec twice as fast as PCI AGP 2x: 533 MB/sec AGP 4x: 1 GB/sec AGP 8x: 2 GB/sec 256 MB/sec readback from graphics to system AGP PCI-E: PCI Express a faster interface between the computer core logic and the graphics processor PCI-E 1.0: 4 GB/sec each way 8 GB/sec total PCI-E 2.0: 8 GB/sec each way 16 GB/sec total

One of the first true 3D game cards Worked by supplementing standard 2D video card. Did not do vertex transformations: these were done in the CPU Did do texture mapping, z-buffering. http://accelenation.com/?ac.id.123.2 Vertex Transforms Primitive Assembly Rasterization and Interpolation Raster Operations Frame Buffer CPU PCI GPU http://ww w.cis.up

Main innovation: shifting the transformation and lighting calculations to the GPU Allowed multi-texturing: giving bump maps, light maps, and others.. Faster AGP bus instead of PCI http://accelenation.com/?ac.id.123.5 Vertex Transforms Primitive Assembly Rasterization and Interpolation Raster Operations Frame Buffer AGP GPU http://ww w.cis.up

For the first time, allowed limited amount of programmability in the vertex pipeline Also allowed volume texturing and multi-sampling (for antialiasing) http://accelenation.com/?ac.id.123.7 Vertex Transforms Primitive Assembly Rasterization and Interpolation Raster Operations Frame Buffer AGP Small vertex shaders GPU http://ww w.cis.up

This generation is the first generation of fully-programmable graphics cards Different versions have different resource limits on fragment/vertex programs http://accelenation.com/?ac.id.123.8 Vertex Transforms Primitive Assembly Rasterization and Interpolation Raster Operations Frame Buffer AGP Programmable Vertex shader Programmable Fragment Processor http://ww w.cis.up

Not exactly a quantum leap, but Simultaneous rendering to multiple buffers True conditionals and loops Higher precision throughput in the pipeline (64 bits end-to-end, compared to 32 bits earlier.) PCIe bus More memory/program length/texture accesses http://ww w.cis.up

3D API: OpenGL or Direct3D GPU Command & Data Stream GPU Front End 3D API Commands Vertex Index Stream Primitive Assembly 3D Application Or Game Assembled Primitives Fixed-function pipeline CPU-GPU Boundary (AGP/PCIe) Rasterization and Interpolation Pixel Location Stream Raster Operations Pixel Updates Frame Buffer Pre-transformed Vertices Programmable Vertex Processor Transformed Vertices Pre-transformed Fragments Programmable Fragment Processor Transformed Fragments http://ww w.cis.up

16 highly threaded SM s, >128 FPU s, 367 GFLOPS, 768 MB DRAM, 86.4 GB/S Mem BW, 4GB/S BW to CPU Host Input Assembler Thread Execution Manager Parallel Data Cache Parallel Data Cache Parallel Data Cache Parallel Data Cache Parallel Data Cache Parallel Data Cache Parallel Data Cache Parallel Data Cache Texture Texture Texture Texture Texture Texture Texture Texture Load/store Load/store Load/store Load/store Load/store Load/store Global Memory David Kirk/NVIDIA and Wen-mei W. Hwu, 2007 ECE 498AL, UIUC

Xbox 360 : Unified shader (ATI/AMD) Playstation 3: a modified version of GeForce 78000 (NVIDIA) Cuda: unified shader (NVIDIA)

The model transform Originally, an object is in model space Move, orient, and transform geometrical objects into world space Example, a sphere is defined with origin at (0,0,0) with radius 1 Translate, rotate, scale to make it appear elsewhere Done per vertex with a 4x4 matrix multiplication! The user can apply different matrices over time to animate objects Tomas Akenine-Mőller 2002

You can move the camera in the same manner But apply inverse transform to objects, so that camera looks down negative z-axis Tomas Akenine-Mőller 2002 z x

Compute lighting at vertices light blue Rastrizer (interpolation) Geometry red green Try to mimic how light in nature behaves Empirical models and some real theory Tomas Akenine-Mőller 2002

Application Geometry Rasterizer Two major ways to do it Orthogonal (useful in few applications) Perspective (most often used) Mimics how humans perceive the world, i.e., objects apparent size decreases with distance Tomas Akenine-Mőller 2002

Application Geometry Rasterizer Also done with a matrix multiplication! Pinhole camera (left), analog used in CG (right) Tomas Akenine-Mőller 2002

Square (cube) after projection Clip primitives to square Screen mapping, scales and translates square so that it ends up in a rendering window These screen space coordinates together with Z (depth) are sent to the rasterizer stage Tomas Akenine-Mőller 2002

model space world space world space camera space compute lighting projection image space clip map to screen Tomas Akenine-Mőller 2002

Scan-conversion Find out which pixels are inside the primitive Texturing Put images on triangles Interpolation over triangle Z-buffering Make sure that what is visible from the camera really is displayed Double buffering And more Tomas Akenine-Mőller 2002

Triangle vertices from GEOMETRY is input Find pixels inside the triangle Or on a line, or on a point Do per-pixel operations on these pixels: Interpolation Texturing Z-buffering And more Tomas Akenine-Mőller 2002

Interpolate colors over the triangle Called Gouraud interpolation blue red green Tomas Akenine-Mőller 2002

One application of texturing is to glue images onto geometrical object Associate points in an image to points in a geometric object + = Tomas Akenine-Mőller 2002

From wikipedia 1. Without texture mapping 2. With texture mapping

+ = From wikipedia

The fixed graphics hardware just draws triangles However, a triangle that is covered by a more closely located triangle should not be visible Assume two equally large tris at different depths incorrect correct Triangle 1 Triangle 2 Draw 1 then 2 Tomas Akenine-Mőller 2002 Draw 2 then 1

Would be nice to avoid sorting The Z-buffer (aka depth buffer) solves this Idea: Store z (depth) at each pixel When scan-converting a triangle, compute z at each pixel on triangle Compare triangle s z to Z-buffer z-value If triangle s z is smaller, then replace Z-buffer and color buffer Else do nothing Can render in any order Tomas Akenine-Mőller 2002

The monitor displays one image at a time So if we render the next image to screen, then rendered primitives pop up And even worse, we often clear the screen before generating a new image A better solution is double buffering Tomas Akenine-Mőller 2002

Use two buffers: one front and one back The front buffer is displayed The back buffer is rendered to When new image has been created in back buffer, swap front and back Tomas Akenine-Mőller 2002

Aliased rendering: color sample at pixel center is the color of the whole pixel Anti-aliasing accounts for the contribution of all the primitives that intersect the pixel David Kirk/NVIDIA and Wen-mei W. Hwu, 2007 ECE 498AL, UIUC