CS4620/5620: Lecture 14 Pipeline

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

Pipeline Operations. CS 4620 Lecture 14

Pipeline Operations. CS 4620 Lecture 10

Graphics Pipeline 2D Geometric Transformations

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

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

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

Rasterization Overview

The graphics pipeline. Pipeline and Rasterization. Primitives. Pipeline

Pipeline and Rasterization. COMP770 Fall 2011

Rasterization. CS4620 Lecture 13

Rasterization. COMP 575/770 Spring 2013

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

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

Hidden surface removal. Computer Graphics

Lecture 2. Shaders, GLSL and GPGPU

Visibility: Z Buffering

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

VISIBILITY & CULLING. Don t draw what you can t see. Thomas Larsson, Afshin Ameri DVA338, Spring 2018, MDH

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

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

Realtime 3D Computer Graphics Virtual Reality

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

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

Hidden Surfaces II. Week 9, Mon Mar 15

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

3D Rasterization II COS 426

CS 130 Final. Fall 2015

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

University of British Columbia CPSC 314 Computer Graphics Jan-Apr Tamara Munzner. Hidden Surfaces.

The Rasterization Pipeline

CS559: Computer Graphics. Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008

Drawing Fast The Graphics Pipeline

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

Computer Graphics Shadow Algorithms

Graphics and Interaction Rendering pipeline & object modelling

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

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

- Rasterization. Geometry. Scan Conversion. Rasterization

Drawing Fast The Graphics Pipeline

CS 464 Review. Review of Computer Graphics for Final Exam

Rasterization. Computer Graphics Fabio Pellacini and Steve Marschner

The Graphics Pipeline. Interactive Computer Graphics. The Graphics Pipeline. The Graphics Pipeline. The Graphics Pipeline: Clipping

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

Triangle Rasterization

Introduction Rasterization Z-buffering Shading. Graphics 2012/2013, 4th quarter. Lecture 09: graphics pipeline (rasterization and shading)

Drawing Fast The Graphics Pipeline

3D Drawing Visibility & Rasterization. CS559 Spring 2016 Lecture 9 February 23, 2016

CHAPTER 1 Graphics Systems and Models 3

INFOGR Computer Graphics. J. Bikker - April-July Lecture 11: Visibility. Welcome!

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

Advanced Rendering Techniques

Clipping and Scan Conversion

Visibility and Occlusion Culling

Class of Algorithms. Visible Surface Determination. Back Face Culling Test. Back Face Culling: Object Space v. Back Face Culling: Object Space.

CEng 477 Introduction to Computer Graphics Fall 2007

Rendering Objects. Need to transform all geometry then

Clipping. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Introduction to Visualization and Computer Graphics

RASTERISED RENDERING

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

The Rasterization Pipeline

CS Computer Graphics: Hidden Surface Removal

Shadow Algorithms. CSE 781 Winter Han-Wei Shen

The Graphics Pipeline

Adaptive Point Cloud Rendering

CS 112 The Rendering Pipeline. Slide 1

1.2.3 The Graphics Hardware Pipeline

Deferred Rendering Due: Wednesday November 15 at 10pm

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

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

Rasterization. MIT EECS Frédo Durand and Barb Cutler. MIT EECS 6.837, Cutler and Durand 1

E.Order of Operations

8. Hidden Surface Elimination

Hidden Surface Removal

2.11 Particle Systems

Scanline Rendering 2 1/42

Culling. Computer Graphics CSE 167 Lecture 12

Computer Graphics. - Clipping - Philipp Slusallek & Stefan Lemme

Lecture 4. Viewing, Projection and Viewport Transformations

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

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

CS 130 Exam I. Fall 2015

TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students)

Computergrafik. Matthias Zwicker. Herbst 2010

Graphics Pipeline. CS535 Fall Daniel G. Aliaga Department of Computer Science Purdue University

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

CS451Real-time Rendering Pipeline

CSE328 Fundamentals of Computer Graphics: Concepts, Theory, Algorithms, and Applications

Graphics Hardware and Display Devices

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

COMPUTER GRAPHICS COURSE. Rendering Pipelines

Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura

Real-Time Shadows. Last Time? Today. Why are Shadows Important? Shadows as a Depth Cue. For Intuition about Scene Lighting

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

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

Lecture 4: Geometry Processing. Kayvon Fatahalian CMU : Graphics and Imaging Architectures (Fall 2011)

CS 4620 Program 3: Pipeline

Last Time. Why are Shadows Important? Today. Graphics Pipeline. Clipping. Rasterization. Why are Shadows Important?

Transcription:

CS4620/5620: Lecture 14 Pipeline 1 Rasterizing triangles Summary 1! evaluation of linear functions on pixel grid 2! functions defined by parameter values at vertices 3! using extra parameters to determine fragment set 2

Barycentric coordinates A coordinate system for triangles [Shirley 2000] 3 Clipping to the triangle Interpolate three barycentric coordinates across the plane each barycentric coord is 1 at one vert. and 0 at the other two lies between 0 and 1 inside the triangle Output fragments only when all three are > 0. 4

Another way: Edge equations In plane, triangle is the intersection of 3 half spaces 5 Walking edge equations We need to update values of the three edge equations with single-pixel steps in x and y Edge equation already in form of dot product components of vector are the increments 6

Rest of pipeline 7 Clipping Rasterizer tends to assume triangles are on screen particularly problematic to have triangles crossing the plane z = 0 Why? 8

n 0 0 0 P = 0 n 0 0 0 0 n + f fn 0 0 1 0 9 Clipping Eliminate geometry outside frustum How? Clip to world space frustum Clip to clip coordinates (before divide) Both fine, often the latter After projection, before perspective divide clip against the planes x, y, z = 1, 1 (6 planes) primitive operation: clip triangle against axisaligned plane 10

Clipping a triangle against a plane 4 cases, based on sidedness of vertices all in (keep) all out (discard) one in, two out (one clipped triangle) two in, one out (two clipped triangles) Intersect the edge line with the plane x = 0, use y intercept (for example) 11 Pipeline of transformations Standard sequence of transforms object space camera space screen space modeling transformation camera transformation projection transformation viewport transformation world space canonical view volume 12

Pipeline overview you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives to pixels RASTERIZATION FRAGMENTS blending, compositing, shading FRAGMENT PROCESSING user sees this FRAMEBUFFER IMAGE DISPLAY 13 Hidden surface elimination We have discussed how to map primitives to image space projection and perspective are depth cues occlusion is another very important cue 14

Painter s algorithm Simplest way to do hidden surfaces Draw from back to front, use overwriting in framebuffer 15 Painter s algorithm Useful when a valid order is easy to come by Compatible with alpha blending [Foley et al.] 16

Painter s algorithm Amounts to a topological sort of the graph of occlusions that is, an edge from A to B means A sometimes occludes B any sort is valid BA... B...A... A D D if there are cycles B E there is no sort C F B F A E [Foley et al.] Works when valid sort is easy to come by C 17 The z buffer In many (most) applications maintaining a z sort is too expensive changes all the time as the view changes many data structures exist, but complex Solution: draw in any order, keep track of closest surface allocate extra channel per pixel to keep track of closest depth so far when drawing, compare object s depth to current closest depth and discard if greater History: memory use was a concern, not anymore. 18

The z buffer [Foley et al.] Memory-intensive brute force approach that works and has become the standard 19 Precision in z buffer The precision is distributed between the near and far clipping planes this is why these planes have to exist also why you can t always just set them to very small and very large distances Generally use z (not world z) in z buffer More about correct interpolation for z in texturing! 20

Back face culling For closed shapes you will never see the inside therefore only draw surfaces that face the camera implement by checking n. v n v n v 21