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

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

CS4620/5620: Lecture 14 Pipeline

CS 130 Exam I. Fall 2015

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

CS 130 Exam I. Fall 2015

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

Rasterization. CS4620/5620: Lecture 12. Announcements. Turn in HW 1. PPA 1 out. Friday lecture. History of graphics PPA 1 in 4621.

Surface shading: lights and rasterization. Computer Graphics CSE 167 Lecture 6

Rasterization. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 16

From Ver(ces to Fragments: Rasteriza(on

Rasterization. CS4620 Lecture 13

Realtime 3D Computer Graphics Virtual Reality

CS 4731: Computer Graphics Lecture 21: Raster Graphics: Drawing Lines. Emmanuel Agu

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

The graphics pipeline. Pipeline and Rasterization. Primitives. Pipeline

Pipeline and Rasterization. COMP770 Fall 2011

CS 130 Final. Fall 2015

Line Drawing. Foundations of Computer Graphics Torsten Möller

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

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

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

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives.

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Painter s HSR Algorithm

Rendering. A simple X program to illustrate rendering

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

Rasterization. COMP 575/770 Spring 2013

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

Tópicos de Computação Gráfica Topics in Computer Graphics 10509: Doutoramento em Engenharia Informática. Chap. 2 Rasterization.

CS770/870 Fall 2015 Advanced GLSL

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

Lecture 2. Shaders, GLSL and GPGPU

Drawing Fast The Graphics Pipeline

CS Rasterization. Junqiao Zhao 赵君峤

Rendering. A simple X program to illustrate rendering

Einführung in Visual Computing

Rasterizing triangles

Pipeline Operations. CS 4620 Lecture 10

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

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

Graphics Pipeline 2D Geometric Transformations

CS 4300 Computer Graphics. Prof. Harriet Fell Fall 2012 Lecture 5 September 13, 2012

Rasterization Overview

Drawing Fast The Graphics Pipeline

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

CS 130. Scan Conversion. Raster Graphics

WebGL and GLSL Basics. CS559 Fall 2015 Lecture 10 October 6, 2015

The Rasterization Pipeline

Chapter 8: Implementation- Clipping and Rasterization

- Rasterization. Geometry. Scan Conversion. Rasterization

Rendering Objects. Need to transform all geometry then

Introduction to Visualization and Computer Graphics

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

Shaders (some slides taken from David M. course)

Graphics System. Processor. Output Display. Input Devices. Frame Buffer. Memory. Array of pixels. Resolution: # of pixels Depth: # of bits/pixel

Pipeline Operations. CS 4620 Lecture 14

Drawing Fast The Graphics Pipeline

A SIMD-efficient 14 Instruction Shader Program for High-Throughput Microtriangle Rasterization

2D Image Synthesis. 2D image synthesis. Raster graphics systems. Modeling transformation. Vectorization. u x u y 0. o x o y 1

Computer Graphics 7 - Rasterisation

WebGL and GLSL Basics. CS559 Fall 2016 Lecture 14 October

Rasterization: Geometric Primitives

From 3D World to 2D Screen. Hendrik Speleers

Case 1:17-cv SLR Document 1-3 Filed 01/23/17 Page 1 of 33 PageID #: 60 EXHIBIT C

1 Introduction to Graphics

Topics. From vertices to fragments

Spring 2009 Prof. Hyesoon Kim

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

COMP371 COMPUTER GRAPHICS

Computer Graphics. - Rasterization - Philipp Slusallek

CS 112 The Rendering Pipeline. Slide 1

Advanced Rendering Techniques

Spring 2011 Prof. Hyesoon Kim

Line Drawing Week 6, Lecture 9

CS451Real-time Rendering Pipeline

Project 1, 467. (Note: This is not a graphics class. It is ok if your rendering has some flaws, like those gaps in the teapot image above ;-)

The Traditional Graphics Pipeline

lecture 18 - ray tracing - environment mapping - refraction

CS 543: Computer Graphics. Rasterization

1.2.3 The Graphics Hardware Pipeline

Rasterization, or What is glbegin(gl_lines) really doing?

COMP30019 Graphics and Interaction Scan Converting Polygons and Lines

Topic #1: Rasterization (Scan Conversion)

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

Computer Graphics and GPGPU Programming

Computing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz

Practical Texturing (WebGL) CS559 Fall 2016 Lecture 20 November 7th 2016

The Traditional Graphics Pipeline

CHAPTER 1 Graphics Systems and Models 3

0. Introduction: What is Computer Graphics? 1. Basics of scan conversion (line drawing) 2. Representing 2D curves

The Graphics Pipeline

Computer Graphics: Graphics Output Primitives Line Drawing Algorithms

Getting fancy with texture mapping (Part 2) CS559 Spring Apr 2017

Graphics Hardware and Display Devices

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.

Computer Graphics (CS 543) Lecture 10: Rasterization and Antialiasing

The Graphics Pipeline

Intro to OpenGL III. Don Fussell Computer Science Department The University of Texas at Austin

Introduction to Shaders.

Transcription:

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

3D graphics pipeline Vertices Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Pixels 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

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

Rasterization

What is rasterization? Rasterization is the process of determining which pixels are covered by the primitive

What is rasterization? Vertices Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Pixels input: primitives output: fragments enumerate the pixels covered by a primitive interpolate attributes across the primitive

Rasterization Compute integer coordinates for pixels covered by the 2D primitives Algorithms are invoked many, many times and so must be efficient Output should be visually pleasing, for example, lines should have constant density Obviously, should be able to draw all possible 2D primitives

Screen coordinates

Line Representation

Implicit Line Equation <whiteboard>

Implicit Line Equation decision variable, d

Implicit Line Equation decision variable, d

Implicit Line Equation decision variable, d

Implicit Line Equation decision variable, d

Line Drawing

Which pixels should be used to approximate a line? Draw the thinnest possible line that has no gaps

Line drawing algorithm (case: 0 < m <= 1) y = y0 for x = x0 to x1 do draw(x,y) if (<condition>) then y = y+1 move from left to right choose between (x+1,y) and (x+1,y+1)

Line drawing algorithm (case: 0 < m <= 1) y = y0 for x = x0 to x1 do draw(x,y) if (<condition>) then y = y+1 move from left to right choose between (x+1,y) and (x+1,y+1)

Use the midpoint between the two pixels to choose

Use the midpoint between the two pixels to choose

Use the midpoint between the two pixels to choose

Use the midpoint between the two pixels to choose implicit line equation: <whiteboard> evaluate f at midpoint:

Use the midpoint between the two pixels to choose implicit line equation: evaluate f at midpoint:

Line drawing algorithm (case: 0 < m <= 1) y = y0 for x = x0 to x1 do draw(x,y) if ( ) then y = y+1

We can make the Midpoint Algorithm more efficient y = y0 for x = x0 to x1 do draw(x,y) if ( ) then y = y+1

We can make the Midpoint Algorithm more efficient by making it incremental!

We can make the Midpoint Algorithm more efficient

We can make the Midpoint Algorithm more efficient

We can make the Midpoint Algorithm more efficient y = y0 d = f(x0+1,y0+1/2) for x = x0 to x1 do draw(x,y) if (d<0) then y = y+1 d = d+(y0-y1)+(x1-x0) else d = d+(y0-y1)

Adapt Midpoint Algorithm for other cases case: 0 < m <= 1

Adapt Midpoint Algorithm for other cases case: -1 <= m < 0

Adapt Midpoint Algorithm for other cases case: 1 <= m or m <= -1

Line drawing references the algorithm we just described is the Midpoint Algorithm (Pitteway, 1967), (van Aken and Novak, 1985) draws the same lines as the Bresenham Line Algorithm (Bresenham, 1965)

Triangles

barycentric coordinates

barycentric coordinates

barycentric coordinates

barycentric coordinates

barycentric coordinates

barycentric coordinates What are? <whiteboard>