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

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

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

Rendering approaches. 1.image-oriented. 2.object-oriented. foreach pixel... 3D rendering pipeline. foreach object...

3D graphics, raster and colors CS312 Fall 2010

Graphics Hardware and Display Devices

CSC 8470 Computer Graphics. What is Computer Graphics?

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

Graphics Systems and Models

Chapter 1 Introduction

Computer Graphics Fundamentals. Jon Macey

Rendering Objects. Need to transform all geometry then

The Rasterization Pipeline

CS451Real-time Rendering Pipeline

CS4620/5620: Lecture 14 Pipeline

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

Three Main Themes of Computer Graphics

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

CS452/552; EE465/505. Clipping & Scan Conversion

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Spring 2009 Prof. Hyesoon Kim

Spring 2011 Prof. Hyesoon Kim

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

Computer Graphics Lecture 2

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

Pipeline Operations. CS 4620 Lecture 14

Rasterization Overview

Computer Graphics and Visualization. Graphics Systems and Models

National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor

Introduction to Computer Graphics with WebGL

Pipeline Operations. CS 4620 Lecture 10

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL

Lecture 2. Shaders, GLSL and GPGPU

CS 130 Final. Fall 2015

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

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

Lecture 2: Digital Drawing. Computer Graphics and Imaging UC Berkeley CS184/284

Level of Details in Computer Rendering

CSE4030 Introduction to Computer Graphics

2D Drawing Primitives

Models and Architectures

Topics. From vertices to fragments

Computer Graphics 1 Instructor Information. Books. Graphics? Course Goals and Outcomes. Where are computer graphics? Where are computer graphics?

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Graphics Hardware. Instructor Stephen J. Guy

CSE 167: Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

The Viewing Pipeline Coordinate Systems

Graphics Pipeline 2D Geometric Transformations

CS 498 VR. Lecture 18-4/4/18. go.illinois.edu/vrlect18

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

1.2.3 The Graphics Hardware Pipeline

PowerVR Hardware. Architecture Overview for Developers

Triangle Rasterization

CSE 167: Introduction to Computer Graphics Lecture #5: Visibility, OpenGL

ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO EECS 104. Fundamentals of Computer Graphics. OpenGL

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

Game Programming. Bing-Yu Chen National Taiwan University

The Traditional Graphics Pipeline

Drawing Fast The Graphics Pipeline

Computer graphic -- Programming with OpenGL I

Graphics Programming. Computer Graphics, VT 2016 Lecture 2, Chapter 2. Fredrik Nysjö Centre for Image analysis Uppsala University

CS 4620 Program 3: Pipeline

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

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

The Traditional Graphics Pipeline

CS 464 Review. Review of Computer Graphics for Final Exam

Introduction to Computer Graphics. Knowledge basic concepts 2D and 3D computer graphics

VTU QUESTION PAPER SOLUTION UNIT -1 INTRODUCTION

How shapes are represented in 3D Graphics. Aims and objectives By the end of the lecture you will be able to describe

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

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

CS Rasterization. Junqiao Zhao 赵君峤

From 3D World to 2D Screen. Hendrik Speleers

Advanced Rendering Techniques

CS427 Multicore Architecture and Parallel Computing

Computer Graphics (CS 543) Lecture 1 (Part 1): Introduction to Computer Graphics

the gamedesigninitiative at cornell university Lecture 17 Color and Textures

the gamedesigninitiative at cornell university Lecture 16 Color and Textures

Graphics Programming

CS 354R: Computer Game Technology

The Traditional Graphics Pipeline

Drawing Fast The Graphics Pipeline

the gamedesigninitiative at cornell university Lecture 17 Color and Textures

COMPUTER GRAPHICS COURSE. Rendering Pipelines

Lecture 1. Computer Graphics and Systems. Tuesday, January 15, 13

Drawing Fast The Graphics Pipeline

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

CIS 581 Interactive Computer Graphics

E.Order of Operations

INTRODUCTION. Slides modified from Angel book 6e

Computer Graphics. Bing-Yu Chen National Taiwan University

The Rendering Pipeline (1)

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

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

Rasterization and Graphics Hardware. Not just about fancy 3D! Rendering/Rasterization. The simplest case: Points. When do we care?

Survey in Computer Graphics Computer Graphics and Visualization

Lecture 25: Board Notes: Threads and GPUs

Realtime 3D Computer Graphics Virtual Reality

CHAPTER 1 Graphics Systems and Models 3

Scan line algorithm. Jacobs University Visualization and Computer Graphics Lab : Graphics and Visualization 272

Transcription:

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

Raster Devices and Images

Raster Devices - raster displays show images as a rectangular array of pixels - most printers are also raster devices - image is made by depositing ink at points on a grid - digital cameras - have image sensors made of grid of light-sensitive pixels (2D array) - scanner - linear array of pixels swept across page to create grid of pixels (1D array)

Raster Display Hearn, Baker, Carithers virtually all graphics system are raster based, meaning the image we see is a raster of pixels or a rectangular array of pixels Here a raster scan device display an image as a set of discrete points across each scanline

Transmissive vs. Emissive Display anode LEDs + _ cathodes ON OFF ON [H&B, Fig. 2-16] LCD LED Displays are either transmissive or emissive one pixel of an LCD display: (LEFT)In the off state the front polarizer blocks all the light that passes the back polarizer in the on state the liquid crystal rotates the polarization of the light so it can pass through the front polarizer the degree of rotation can be adjusted by an applied voltage (RIGHT) LED display

Raster Display red, green, blue subpixels get different colors by mixing red, green, and blue this is from an LCD monitor printers are also raster-based. image is made out of points on a grid

What is an image? Continuous image (grayscale) (color) An (continuous) image is a function defined over some 2D area, that maps points to intensity level

What is an image? Sampled image (grayscale) (color) = number of columns = number of rows each pixel value represents the average color of the image over that pixel s area.

in practice, it is sufficient for pixels to have a bounded range e.g., [0,1] They are represented in integers

Raster Image A raster image is 2D array storing pixel values at each pixel (picture element) 3 numbers for color alternative: vector image -- essentially a set of instructions for rendering an image

Monitor Gamma displayed intensity = (max intensity) monitors convert pixel values, a, into displayed intensities monitors are nonlinear with respect to input

Gamma Correction displayed intensity = (max intensity) } gamma-corrected intensity find gamma using, e.g., checkboard then gamma-correct the input find gamma, so that you can give the monitor a^{1/\gamma} - find a such that a^{\gamma} =.5 through checkboard test and solve for gamma

additive color - Primary colors are red, green, blue. form a color by adding these. CRTs, projectors, LCD displays, positive film subtractive color - form a color by filtering white light with cyan, magenta, and yellow filters printing, negative film

Alpha Channel Compositing: two different interpretations: pixel coverage (fraction of pixel covered) and blending

Graphics Pipeline

Modern graphics system [Angel and Shreiner] the pixels are stored in a location in memory call the frame buffer frame buffer resolution determines the details in the image - e.g., 24 bit color full color - high dynamic range or HDR use 12 or more bits for each color frame buffer = color buffers + other buffer

Z-buffer Rendering Z-buffering is very common approach, also often accelerated with hardware OpenGL is based on this approach 3D Polygons GRAPHICS PIPELINE Image Pixels 17

Choice of primitives Which primitives should an API contain? small set - supported by hardware, or lots of primitives - convenient for user

Choice of primitives Which primitives should an API contain? small set - supported by hardware lots of primitives - convenient for user Performance is in 10s millions polygons/sec -- portability, hardware support key

Choice of primitives Which primitives should an API contain? small set - supported by hardware lots of primitives - convenient for user GPUs are optimized for points, lines, and triangles Other geometric shapes will be built out of these

Two classes of primitives ff [Angel and Shreiner] Geometric : points, lines, polygons Image : arrays of pixels

Point and line segment types [Angel and Shreiner]

Polygons Multi-sided planar element composed of edges and vertices. Vertices (singular vertex) are represented by points Edges connect vertices as line segments E1 (x2,y2) (x1,y1) E3 E2 (x3,y3)

Simple Convex Flat Valid polygons

Simple Convex Flat Valid polygons

OpenGL polygons Only triangles are supported (in latest versions) GL_TRIANGLE_STRIP GL_POINTS GL_TRIANGLES GL_TRIANGLE_FAN

Other polygons triangulation triangulation as long as triangles are not collinear, they will be simple, flat, and convex -- easy to render

Pipelining operations An arithmetic pipeline that computes c+(a*b) a b * + c By pipelining the arithmetic operation, the throughput, or rate at which data flows through the system, has been doubled If the pipeline had more boxes, the latency, or time it takes one datum to pass through the system, would be higher throughput and latency must be balanced

3D graphics pipeline Vertices Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Pixels Geometry: primitives - made of vertices Vertex processing: coordinate transformations and color Clipping and primitive assembly: output is a set of primitives Rasterization: output is a set of fragments for each primitive Fragment processing: update pixels in the frame buffer the pipeline is best when we are doing the same operations on many data sets -- good for computer graphics!! where we process larges sets of vertices and pixels in the same manner 1. Geometry: objects - made of primitives - made of vertices 2. Vertex processing: coordinate transformations and color 3. Clipping and primitive assembly: use clipping volume. must be primitive by primitive rather than vertex by vertex. therefore vertices must be assembled into primitives before clipping can take place. Output is a set of primitives. 4. Rasterization: primitives are still in terms of vertices -- must be converted to pixels. E.g., for a triangle specificied by 3 vertices, the rasterizer must figure out which pixels in the frame buffer fill the triangle. Output is a set of fragments for each primitive. A fragment is like a potential pixel. Fragments can carry depth information used to figure out if they lie behind other fragments for a given pixel. 5. Fragment processing: update pixels in the frame buffer. some fragments may not be visible. texture mapping and bump mapping. blending.

Graphics Pipeline (slides courtesy K. Fatahalian)

Vertices Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Pixels Vertex processing Vertices are transformed into screen space v2 v0 v5 v4 v3 v1 Vertices

Vertices Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Pixels Vertex processing Vertices are transformed into screen space v2 v0 v5 v4 EACH VERTEX IS TRANSFORMED INDEPENDENTLY v3 v1 Vertices

Vertices Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Pixels Primitive processing Then organized into primitives that are clipped and culled v2 v0 v5 v2 v0 v5 v4 v4 v3 v1 v3 v1 Vertices Primitives (triangles)

Vertices Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Pixels Rasterization Primitives are rasterized into pixel fragments Fragments

Vertices Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Pixels Rasterization Primitives are rasterized into pixel fragments EACH PRIMITIVE IS RASTERIZED INDEPENDENTLY

Vertices Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Pixels Fragment processing Fragments are shaded to compute a color at each pixel Shaded fragments

Vertices Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Pixels Fragment processing Fragments are shaded to compute a color at each pixel EACH FRAGMENT IS PROCESSED INDEPENDENTLY

Vertices Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Pixels Pixel operations Fragments are blended into the frame buffer at their pixel locations (z-buffer determines visibility) Pixels

Pipeline entities v0 v5 v2 v0 v5 v2 v4 v4 v3 v1 v3 v1 Vertices Primitives Fragments Fragments (shaded) Pixels

Graphics pipeline Vertex Generation Memory Buffers Vertex Data Buffers Fixed-function Vertices Primitives Fragments Pixels Vertex stream Vertex Processing Vertex stream Primitive Generation Primitive stream Primitive Processing Primitive stream Fragment Generation Fragment stream Fragment Processing Fragment stream Pixel Operations Textures Textures Textures Output image (pixels) Programmable