Graphics and Interaction Rendering pipeline & object modelling

Similar documents
COMP30019 Graphics and Interaction Rendering pipeline & object modelling

Lecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling

COMP30019 Graphics and Interaction Scan Converting Polygons and Lines

COMP30019 Graphics and Interaction Perspective & Polygonal Geometry

CHAPTER 1 Graphics Systems and Models 3

Pipeline Operations. CS 4620 Lecture 10

Course Title: Computer Graphics Course no: CSC209

3D Rasterization II COS 426

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

Pipeline Operations. CS 4620 Lecture 14

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

CS4620/5620: Lecture 14 Pipeline

Hidden surface removal. Computer Graphics

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

Computer Graphics I Lecture 11

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

Introduction to Computer Graphics

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

Chapter 4. Chapter 4. Computer Graphics 2006/2007 Chapter 4. Introduction to 3D 1

Rasterization Overview

Computer Graphics. Shadows

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

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

CS451Real-time Rendering Pipeline

CEng 477 Introduction to Computer Graphics Fall 2007

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

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

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Visibility: Z Buffering

Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura

Computer Graphics 10 - Shadows

Computer Graphics. Instructor: Oren Kapah. Office Hours: T.B.A.

9. Visible-Surface Detection Methods

COMPUTER GRAPHICS, MULTIMEDIA AND ANIMATION, Second Edition (with CD-ROM) Malay K. Pakhira

Visible-Surface Detection Methods. Chapter? Intro. to Computer Graphics Spring 2008, Y. G. Shin

Triangle Rasterization

Introduction to Visualization and Computer Graphics

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

Real-Time Shadows. André Offringa Timo Laman

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

CS 130 Final. Fall 2015

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

CS 464 Review. Review of Computer Graphics for Final Exam

Computergrafik. Matthias Zwicker. Herbst 2010

Computer Graphics. Chapter 1 (Related to Introduction to Computer Graphics Using Java 2D and 3D)

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

Graphics Hardware and Display Devices

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

OXFORD ENGINEERING COLLEGE (NAAC Accredited with B Grade) DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING LIST OF QUESTIONS

Graphics for VEs. Ruth Aylett

Texture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

Hidden Surfaces II. Week 9, Mon Mar 15

Computer Graphics Fundamentals. Jon Macey

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY CS2401 COMPUTER GRAPHICS QUESTION BANK

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

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

Chapter 5. Projections and Rendering

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

Volume Shadows Tutorial Nuclear / the Lab

Computer Graphics Introduction. Taku Komura

CS GAME PROGRAMMING Question bank

From Vertices To Fragments-1

Clipping & Culling. Lecture 11 Spring Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling

Institutionen för systemteknik

Graphics for VEs. Ruth Aylett

3D Rendering Pipeline

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

The Traditional Graphics Pipeline

3D Polygon Rendering. Many applications use rendering of 3D polygons with direct illumination

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

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Topics. From vertices to fragments

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination

Computer Graphics Shadow Algorithms

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

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

Texture Mapping. Michael Kazhdan ( /467) HB Ch. 14.8,14.9 FvDFH Ch. 16.3, , 16.6

CSE 167: Introduction to Computer Graphics Lecture #10: View Frustum Culling

RASTERISED RENDERING

Models and Architectures

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks)

9. Illumination and Shading

Today. CS-184: Computer Graphics. Lecture #10: Clipping and Hidden Surfaces. Clipping. Hidden Surface Removal

Welcome to CS 4/57101 Computer Graphics

Renderer Implementation: Basics and Clipping. Overview. Preliminaries. David Carr Virtual Environments, Fundamentals Spring 2005

CS 381 Computer Graphics, Fall 2012 Midterm Exam Solutions. The Midterm Exam was given in class on Tuesday, October 16, 2012.

Identifying those parts of a scene that are visible from a chosen viewing position, and only process (scan convert) those parts

Werner Purgathofer

Realtime 3D Computer Graphics Virtual Reality

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Homework #2. Hidden Surfaces, Projections, Shading and Texture, Ray Tracing, and Parametric Curves

Page 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms

The Traditional Graphics Pipeline

3D Object Representation

CS 4620 Program 3: Pipeline

CPSC GLOBAL ILLUMINATION

The Traditional Graphics Pipeline

Topics and things to know about them:

Transcription:

433-324 Graphics and Interaction Rendering pipeline & object modelling Department of Computer Science and Software Engineering The Lecture outline Introduction to Modelling Polygonal geometry The rendering pipeline Z buffering High Performance Visible Surface Detection

How are objects modelled in computer graphics? Aim: understanding polygonal geometry and the basics of the rendering pipeline. Reading: Foley Section 9.1.1 Representing polygon meshes. Foley Sections 14.4 Shadows, 14.9 The rendering pipeline and 14.3 Surface detail. Additional Reading: Section 23.3 Level of detail in Computer graphics and virtual environments: from realism to real-time by Mel Slater, Anthony Steed and Yiorgos Crysanthou, Addison Wesley 22 ISBN: 2162426. Introduction to modelling The first problem in modelling geometric objects and their motion is to formulate a suitable mathematical model (does it have a solution? is the solution unique?). A model based on general theories and laws of particular discipline (e.g. luminosity model of a 3D surface or physical model of a soccer ball). You may need to simplify the model and approximate to ensure tractability (use polyhedra model of soccer ball instead of parametric surface.) There will be a balance between what to include for completeness, and what to remove for tractability (don t model the effect of wind on the soccer ball).

Polygonal geometry In general, a polygon is any plane figure bounded by straight line segments and but can comprise these forms polygonal arcs (polylines) polygonal boundaries (closed polylines) and filled polygons Polygons are very useful, both in themselves and as building blocks for approximating arbitrary curved arcs and regions. Representation Either as a set of line segments, or an ordered sequence of vertices using absolute or relative coordinates, Walking order convention often applies, e.g. anti-clockwise for outer and clockwise for inner

Polygon mesh: vertex list V 2 V 1 P 1 P 2 V 3 V 4 V =(V 1, V 2, V 3, V 4 )=((x 1, y 1, z 1 ),...,(x 4, y 4, z 4 )) P 1 =(1, 2, 4) P 2 =(4, 2, 3) Polygon mesh: edge list V = (V 1, V 2, V 3, V 4 ) = ((x 1, y 1, z 1 ),, (x 4, y 4, z 4 )) V 2 E 1 = (V 1, V 2, P 1, l) E 1 E 2 E 2 = (V 2, V 3, P 2, l) E 3 = (V 3, V 4, P 2, l) V 1 P 1 P 2 E 4 V 3 E 4 =(V 4, V 2, P 1, P 2 ) E E 3 V 4 E = (V 4, V 1, P 1, l) P 1 = (E 1, E 4, E ) P 2 = (E 2, E 3, E 4 ) Polygons represented as line segments (edges) makes polygon clipping and scan-line filling operations easier (we will see later).

Polygon types Convex Non-simple Star Concave Multiple-boundary Polygon Properties In a convex polygon no internal angle is greater than 18 degrees In a concave polygon there are internal angles that can be greater than 18 degrees Concave polygons can be represented as a conjunction of convex polygons, sometimes desired as convex polygons have certain properties that simplify some geometric operations and tesselations. the multiple boundary polygons would need some classification of region (like Tasmania connected to the mainland of Australia).

The Rendering pipeline and the z-buffer db traversal Modeling transformation Trivial accept/reject Lighting Viewing transformation Clipping Divide by W, map to 3D viewport Rasterization Display (Foley Figure 14.41) Z Buffer As well as pixel frame buffer, keep a parallel Z buffer, which at each point records the depth of corresponding pixel. The Z buffer is initialised to some representation of infinite depth. The frame buffer initialised to background colour then pixel writes take pixel value, x, y, and Z. Updates only take place at (x, y) only if new depth is closer.

Z Buffer Depth must be in camera coordinates, any order-preserving function of true depth will do (pseudo-depth is OK). Z buffer must have sufficient bits to resolve depth finely enough and may use some bits of frame buffer, if enough bits are available, and display lookup tables can be manipulated. Can use buffer with higher spatial resolution, and block-average down for antialiasing. The z-buffer drawing (a) first and (b) second polygons (a) + = (b) 3 4 3 + 4 3 = 6 4 3 7 6 4 3 8 7 6 4 3 6 3 7 6 4 3 8 7 6 4 3 Assume looking down the z axis. Depends on spatial resolution (must have sufficient bits to resolve depth finely enough).

Interpolation of z values along edges for scan lines y 1 y z 1 y z a = z 1 (z 1 z 2 ) 1 y s y 1 y 2 y s z a z p z b Scan line y z b = z 1 (z 1 z 3 ) 1 y s y 1 y 3 y 2 z 2 y 3 z 3 x b x p z p = z b (z b z a ) x b x a Pros and cons of the z buffer + simple to implement. + implementable in hardware (generally is). + works for all kinds of objects (not just polyhedra). - extra storage needed for Z buffer. - many accesses to Z buffer and frame buffer bad for display through a communications link. - limited to space and depth resolution of buffers.

Properties of Z-buffers for each polygon or object in scene (piecewise Z buffering). (z-buffer) for each scan line (single-scan-line Z buffering If shading computation is time-consuming, a rough front-to back depth sort of objects to display closest one first improves efficiency (can use radix sort for this, at resolution of z-buffer). Don t calculate shading for hidden surfaces important if using Phong illumination model as we will see later. Double buffering The problem: animation and motion can cause the display to flicker. The solution: double buffering can be used to reduce the effect of flickering, by sending all drawing commands to an off-screen buffer, then swapping buffers before redrawing. In addition, only those pixels recently drawn are selectively erased at each step in the off-screen buffer.

Rendering pipeline for z-buffer (revisited) db traversal Modeling transformation Trivial accept/reject Lighting Viewing transformation Clipping Divide by W, map to 3D viewport Rasterization Display (Foley Figure 14.41) Rendering pipeline for z-buffer - the steps See page 21 of Foley: db traversal & modelling transformation transform all (relatively defined) polygons or polygonal meshes to their correct location. Trivial accept/reject: Entirely outside & back face culling Lighting: calculate intensity (for vertices only: need to do in 3D before perspective projection) Viewing transformation: perspective transformation (e.g. perspective foreshortening). Clipping: clip to viewport (involves creation of new vertices on border). Map to viewport: Change of coordinate systems (Divide by W: based on homogeneous coordinate system). Rasterisation: scan-line drawing polygons (including z-buffering & shading interpolation)

High performance visible surface determination Many methods and variations of visible surface determination are possible, which performs best depends on hardware available, and nature of graphics drawn, E.g. for a scene made of many small polygons, Z buffering might be best, for a scene made of a few large polygons, binary space partition techniques (BSPs) might be better. The Z-buffer idea can also be used for a variety of tasks, such as piecewise Z buffering (for example polygon-by polygon), or single-scan-line Z buffering (pixel-by-pixel). Level of detail Varying quality with distance - programmer provides several different versions of an object for viewing at different distances.

Example from Stanford University Computer Graphics Lab Despite the difference in the number of used to model the figures (on the left), at a distance (on the right) they appear very similar (Figure from Slater text). Vertex spit method (Figure from Slater text)

Example of levels of detail Texture and bump mapping A texture map is used to scale one or more of the surfaces material properties, such as diffuse colour (RGB) components. A bump map is an array of displacements, each which perturbs the surface normal before it is used in the illumination model.

Summary Polygons are one of the most widely used models in computer graphics and are useful for representing both two-dimensional shapes and three-dimensional objects. The Rendering pipeline, based on z-buffering, is the basis of OpenGL. The rendering pipeline facilitates the systematic modelling, transfmation and rendering of polygons. Various techniques exist for achieving high performance, including level-of-detail, texture and bump mapping.