What is Clipping? Why do we Clip? Lecture 9 Comp 236 Spring Clipping is an important optimization
|
|
- Poppy Cox
- 6 years ago
- Views:
Transcription
1 Clipping, Culling, Picking & Selection Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling Picking Selection Programming Assignment #2 Lecture 9 Comp 236 Spring 2005 What is Clipping? 1. Clipping is a procedure for spatially partitioning geometric primitives, according to their containment within some region. Clipping can be used to: Distinguish whether geometric primitives are inside or outside of a viewing frustum Distinguish whether geometric primitives are inside or outside of a picking frustum Detecting intersections between primitives 2/17/2005 Lecture 10 2 What is Clipping? 2. Clipping is a procedure for subdividing geometric primitives. This view of clipping admits several other potential applications. Binning geometric primitives into spatial data structures. Computing analytical shadows. Computing intersections between primitives Determining visibility Clipping is an important optimization Why do we Clip? Clipping is a visibility preprocess. In real-world scenes clipping can remove a substantial percentage of the environment from consideration. Assures that only potentially visible primitives are rasterized. What advantage does this have over twodimensional clipping. Are there cases where you have to clip?
2 Where do we Clip? There are at least 3 different stages in the rendering pipeline where we do various forms of clipping. In the trivial rejection stage we remove objects that can not be seen. The clipping stage removes objects and parts of objects that fall outside of the viewing frustum. And, when rasterizing, clipping is used to remove parts of objects outside of the view port. xmin = (int) (v[sort[xflag][0]].x); xmax =(int) (v[sort[xflag][1]].x + 1); ymin = (int) (v[sort[yflag][1]].y); ymax = (int) (v[sort[yflag][0]].y + 1); /* clip triangle s bounding box to raster */ xmin = (xmin < 0)? 0 : xmin; xmax = (xmax >= width)? width - 1 : xmax; ymin = (ymin < 0)? 0 : ymin; ymax = (ymax >= height)? height - 1 : ymax; 2/17/2005 Lecture 10 5 Trivial Rejection Clipping One of the keys to all clipping algorithms is the notion of half-space partitioning. We ve seen this before when we discussed how edge equations partition the image plane into two regions, one negative the other non-negative. The same notion extends to 3-dimensions, but partitioning elements are planes rather than lines. The equation of a plane in point-normal form 3D is given as: x y z 1 [ n n n 0] d A vector dotted with a point. The vector is the plane s normal. The points of the plane are a fixed distance, d, from the origin, after projection onto the normal. x y z = 2/17/2005 Lecture 10 6 Trivial Rejection Clipping Here is a simple Example: If we orient a plane so that it passes through our viewing position and our look-at direction is aligned with its normal. Then we can easily partition objects into three classes, those behind our viewing frustum, those in front, and those that are partially in both half-spaces. Outcode Clipping (a.k.a. Cohen-Sutherland Clipping) The extension of plane partitioning to multiple planes, gives a simple form of clipping called Cohen-Sutherland Clipping. This is a rough approach to clipping in that it only classifies each of it s input primitives, rather than forces them to conform to the viewing window. A simple 2-D example is shown on the right. This technique classifies each vertex of a primitive, by generating an outcode. An outcode identifies the appropriate half space location of each vertex relative to all of the clipping planes. Outcodes are usually stored as bit vectors. By comparing the bit vectors from all of the vertices associated with a primitive we can develop conclusions about the whole primitive.
3 Outcode Clipping of Lines First, let s consider line segments. if (outcode1 == 0) and (outcode2 == 0) : line segment is inside if ((outcode1 & outcode2) == 0): line segment potentially crosses clip region line is entirely outside of clip region Outcode Clipping of Triangles For triangles we modify the tests so all vertices are considered: if (outcode1 == 0) and (outcode2 == 0) and (outcode3 == 0): triangle is inside if ((outcode1 & outcode2 & outcode3) == 0): line segment potentially crosses clip region line is entirely outside of clip region Notice that the test cannot conclusively state whether the segment crosses the clip region. This might cause some segments that are located entirely outside of the clipping volume to be subsequently processed. This form of clipping is not limited to triangles or convex polygons. Is is simple to implement. But, it won t handle all of our problems... 2/17/2005 Lecture /17/2005 Lecture Dealing with Crossing Cases The hard part of clipping is handling objects and primitives that straddle clipping planes. In some cases we can ignore these problems because the combination of screen-space clipping and outcode clipping will handle most cases. However, there is one case in general that cannot be handled this way. This is the case when parts of a primitive lies both in front of and behind the viewpoint. This complication is caused by our projection stage. It has the nasty habit of mapping objects behind the viewpoint to positions in front of it. One-Plane-at-a-Time Clipping (a.k.a. Sutherland-Hodgeman Clipping) The Sutherland-Hodgeman triangle clipping algorithm uses a divide-andconquer strategy. It first solves the simple problem of clipping a triangle against a single plane. There are four possible relationships that a triangle can have relative to a clipping plane as shown in the figures on the right. Each of the clipping planes are applied in succession to every triangle. There is minimal storage requirements for this algorithm, and it is well suited to pipelining. As a result it is often used in hardware implementations.
4 Plane-at-a-Time Clipping The Trick: Interpolating Parameters The results of Sutherland-Hodgeman clipping can get complicated very quickly once multiple clip-planes are considered. However, the algorithm is still very simple. Each clip plane is treated independently, and each traingle is treated by on of the four cases mentioned previously. It is straightforward to extend this algorithm to 3D. The complication of clipping is computing the new vertices. This process is greatly simplified by using NDC. We mentioned last lecture that it is often desirable to introduce an intermediate coordinate frame in-between eye-space and the final projection stage (i.e. the dividing through by w). In this space the viewable region is mapped into a volume that ranges from - 1 to +1 in all dimensions after projection. This space has several advantages. It simplifies the clipping test (all dimensions are compared against the w component of the vertex) and it is the perfect place in the pipeline to transition from a floating-point to a fixed-point representation. It also simplifies the interpolation of the new vertex positions and triangle parameters as shown in the figure. 2/17/2005 Lecture /17/2005 Lecture Recap of Plane-at-a-time Clipping Advantages: Elegant (few special cases) Robust (handles boundary and edge conditions well) Well suited to hardware Canonical clipping makes fixed-point implementations manageable Disadvantages: Hard to write as clean code (Reentrant, objects spawn new short-lived objects) Only works for convex clipping volumes Often generates more than the minimum number of triangles needed Requires a divide per clipped edge Alternatives to Plane-at-a-time Over the years there have been several improvements to plane-at-a-time clipping. Clipping against concave volumes (Wieler-Atherton clipping) Can clip arbitrary polygons against arbitrary polygons Maintains more state than plane-at-a-time clipping Handle all planes at once (Nicholle-Lee-Nicholle clipping) It waits before generating triangles to reduce the number of clip sections generated. Tracks polygon through the 27 sub-regions relative to the clip volume Might need to generate a "corner vertex"
5 2-D/3-D/Outcode Clipping Hybrids Do we really need to implement 6 clipping planes? The trend is to do less and less clipping! If rasterization is limited to a bounding box it is easy to see how only near and far clipping are needed. Olano showed that it is possible to even eliminate this case! Back-Face Culling Back-face culling addresses a special case of occlusion called convex self-occlusion. Basically, if an object is closed (having a well defined inside and outside) then some parts of the outer surface must be blocked by other parts of the same surface. We ll be more precise with our definitions in a minute. On such surfaces we need only consider the normals of surface elements to determine if they are visible. 2/17/2005 Lecture /17/2005 Lecture Manifold We can apply back-face culling to any orientable two-manifold. Orientable two-manifolds have the following properties. 1. Everywhere on their surface are locally like a plane. They have no holes, cracks, or self-intersections. 2. Their boundary partitions 3D space into interior and exterior regions In our case, manifolds will be composite objects made of many primitives, generally triangles. Back-face culling eliminates a subset of these primitives. Assumes that you are outside of all objects. Removing Back-Faces Idea: Compare the normal of each face with the viewing direction Given n, the outward-pointing normal of F foreach face F of object if (n. v> 0) throw away the face Does it work?
6 Fixing the Problem We can t do view direction clipping just anywhere! Culling Technique #2 Detect a change in screen-space orientation. If all face vertices are ordered in a consistent way, back-facing primitives can be found by detecting a reversal in this order. One choice is a counterclockwise ordering when viewed from outside of the manifold. This is consistent with computing face normals (Why?). If, after projection, we ever see a clockwise face, it must be back facing. Downside: Projection comes fairly late in the pipeline. It would be nice to cull objects sooner. Upside: Computing the dot product is simpler. You need only look at the sign of the plane s z component. 2/17/2005 Lecture This approach will work for all cases, but it comes even later in the pipe, at triangle setup. We already do this calculation in our triangle rasterizer. It is equivalent to determining a triangle with negative area. 2/17/2005 Lecture Culling Plane-Test Here is a culling test that will work anywhere in the pipeline. Remove faces that have the eye in their negative half-space. This requires computing a plane equation for each face considered. x y z 1 [ n n n 0] d 0 x y z = Culling Plane-Test Once we have the plane equation, we substitute the coordinate of the viewing point (the eye coordinate in our viewing matrix). If it is negative, then the surface is back-facing. Example: We will still need to compute the normal (How?). But, we don t have to normalize it. (How do we go about computing a value for d?)
7 Back Face Culling in OpenGL Back Face Culling is available as a mode setting in OpenGL. very flexible (can cull fronts as well as backs) it can double your performance! depends on consistent models Models should be a closed manifold Clipping will expose the culling if (cull): gldisable(gl_cull_face) glfrontface(gl_ccw) glenable(gl_cull_face) glcullface(gl_back) # define front faces # enable Culling # tell which faces to cull 2/17/2005 Lecture Picking Picking is a user interface technique that allows the user to get access to all geometry within some picking region on the screen Picking is a variant of Clipping, it defines a small viewport, and all geometry that survives culling and has a fragment within the window is reported back in a Select Buffer to the user. The user can then go through this list to decide which geometry was intended by the application. Basics set-up: Set up a feedback display buffer Set rendering mode to selection Set up a clipping viewport with glupickmatrix() Render the scene See what primitives fell within the pick window 2/17/2005 Lecture Picking Fragments To set up the Selection buffer: glselectbuffer(buffersize, intarray) Set the rendering mode (default is GL_RENDER) glrendermode(gl_select) Set the clipping viewport on the PROJECTION matrix glmatrixmode(gl_projection) glpushmatrix() glgetfloatv(gl_projection_matrix, projection) glgetintegerv(gl_viewport, viewport) glloadidentity() glupickmatrix(x, height - y, width, height, viewport) glmultmatrixd(projection) glmatrixmode(gl_modelview) glinitnames() Render scene using the Name Stack Rendering for Picking def display(): glclearcolor(0, 0, 0, 1) glclear(gl_color_buffer_bit GL_DEPTH_BUFFER_BIT) setcamera() glloadname(1) drawfloor() glloadname(2) drawcow() glloadname(3) drawbet() glflush() glutswapbuffers() frame += 1 The Names will appear in the selection buffer in the order they are drawn, regardless of whether they are visible (assuming they fall in the pick window) An entire OpenGL Name stack to support hierarchy in picking with functions: glpushname(intval) glpopname() glloadname(intval)
8 Selecting Selection is an alternative interaction paradigm in which a user is restricted to choosing only objects that are visible from the current view Depends on Double-buffering On a mousedown() event the application re-renders the scene into the back buffer as a second image where each object is colored with a unique objectid Then use glreadpixels() to read the single pixel at the reported mousedown() Position. The back-buffer is never displayed def unmunge(r, g, b): x = 0 for i in xrange(8): x = (x << 1) + (b & 1) b >>= 1 x = (x << 1) + (g & 1) g >>= 1 x = (x << 1) + (r & 1) r >>= 1 return x Selection Code Fragments def munge(x): r, g, b = 0, 0, 0 for i in xrange(8): r = (r << 1) + (x & 1) x >>= 1 g = (g << 1) + (x & 1) x >>= 1 b = (b << 1) + (x & 1) x >>= 1 r = r/float(255) g = g/float(255) b = b/float(255) return (r, g, b) if (selectmode): gldisable(gl_lighting) r, g, b = munge(32) glcolor3d(r, g, b) drawframe(5) frontcolor = [0.8, 0.2, 0.9, 1.0] glenable(gl_lighting) glmaterialfv(gl_front, GL_AMBIENT, frontcolor) glmaterialfv(gl_front, GL_DIFFUSE, frontcolor) 2/17/2005 Lecture /17/2005 Lecture More Code Fragments A simpler, faster, but less colorful munger def munge(x): r = (x & 255)/float(255) g = ((x >> 8) & 255)/float(255) b = ((x >> 16) & 255)/float(255) return (r, g, b) def unmunge(r, g, b): return (r + (g << 8) + (b << 16)) if (selectmode): gldisable(gl_lighting) r, g, b = munge(32) glcolor3d(r, g, b) drawframe(5) frontcolor = [0.8, 0.2, 0.9, 1.0] glenable(gl_lighting) glmaterialfv(gl_front, GL_AMBIENT, frontcolor) glmaterialfv(gl_front, GL_DIFFUSE, frontcolor) def display(): global frame if (selectmode): glclearcolor(0, 0, 0, 1) glclearcolor(0, 0.6, 0.8, 1) glclear(gl_color_buffer_bit GL_DEPTH_BUFFER_BIT) setcamera() drawfloor() drawcow() drawbet() glflush() if (not selectmode): glutswapbuffers() frame += 1 Hiding Selection
9 Performing the Selection Picking vs Selection def onmousebutton(button, state, x, y): global selectmode, oldx, oldy y = height -y -1 if (button == GLUT_LEFT_BUTTON) and (state == GLUT_DOWN): selectmode = 1 display() glreadbuffer(gl_back) pixel = glreadpixels(x, y, 1, 1, GL_RGB, GL_UNSIGNED_BYTE) print "pixel =", unmunge(ord(pixel[0]),ord(pixel[1]),ord(pixel[2])) selectmode = 0 Picking specifies a region, Selection specify a point Picking gives you everything that falls within the window Selecting only provides the visible object Picking has lower latency (objects are not rasterized) and doesn t mess up a buffer Selection is often much easier to manage, and H/W is so fast that the latency is not an issue additional trick can be used to speed it up like setting and rendering into a sub-viewport (as picking did) Selection is more commonly used these days 2/17/2005 Lecture /17/2005 Lecture Next Time
Clipping & Culling. Lecture 11 Spring Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling
Clipping & Culling Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling Lecture 11 Spring 2015 What is Clipping? Clipping is a procedure for spatially partitioning geometric primitives,
More informationSung-Eui Yoon ( 윤성의 )
CS380: Computer Graphics Clipping and Culling Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/cg/ Class Objectives Understand clipping and culling Understand view-frustum, back-face
More informationComputing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz
Computing Visibility BSP Trees Ray Casting Depth Buffering Quiz Power of Plane Equations We ve gotten a lot of mileage out of one simple equation. Basis for D outcode-clipping Basis for plane-at-a-time
More information3D Rendering Pipeline (for direct illumination)
Clipping 3D Rendering Pipeline (for direct illumination) 3D Primitives 3D Modeling Coordinates Modeling Transformation Lighting 3D Camera Coordinates Projection Transformation Clipping 2D Screen Coordinates
More informationVISIBILITY & CULLING. Don t draw what you can t see. Thomas Larsson, Afshin Ameri DVA338, Spring 2018, MDH
VISIBILITY & CULLING Don t draw what you can t see. Thomas Larsson, Afshin Ameri DVA338, Spring 2018, MDH Visibility Visibility Given a set of 3D objects, which surfaces are visible from a specific point
More informationCSE 167: Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012
CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 Announcements Homework project #2 due this Friday, October
More informationCulling. Computer Graphics CSE 167 Lecture 12
Culling Computer Graphics CSE 167 Lecture 12 CSE 167: Computer graphics Culling Definition: selecting from a large quantity In computer graphics: selecting primitives (or batches of primitives) that are
More informationTransformation Pipeline
Transformation Pipeline Local (Object) Space Modeling World Space Clip Space Projection Eye Space Viewing Perspective divide NDC space Normalized l d Device Coordinatesd Viewport mapping Screen space Coordinate
More informationClipping and Scan Conversion
15-462 Computer Graphics I Lecture 14 Clipping and Scan Conversion Line Clipping Polygon Clipping Clipping in Three Dimensions Scan Conversion (Rasterization) [Angel 7.3-7.6, 7.8-7.9] March 19, 2002 Frank
More informationCSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation
CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013 Announcements Project 2 due Friday, October 11
More informationCSE 167: Introduction to Computer Graphics Lecture #11: Visibility Culling
CSE 167: Introduction to Computer Graphics Lecture #11: Visibility Culling Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017 Announcements Project 3 due Monday Nov 13 th at
More informationMotivation. Culling Don t draw what you can t see! What can t we see? Low-level Culling
Motivation Culling Don t draw what you can t see! Thomas Larsson Mälardalen University April 7, 2016 Image correctness Rendering speed One day we will have enough processing power!? Goals of real-time
More informationCS452/552; EE465/505. Clipping & Scan Conversion
CS452/552; EE465/505 Clipping & Scan Conversion 3-31 15 Outline! From Geometry to Pixels: Overview Clipping (continued) Scan conversion Read: Angel, Chapter 8, 8.1-8.9 Project#1 due: this week Lab4 due:
More informationLast class. A vertex (w x, w y, w z, w) - clipping is in the - windowing and viewport normalized view volume if: - scan conversion/ rasterization
Lecture 6 Last class Last lecture (clip coordinates): A vertex (w x, w y, w z, w) - clipping is in the - windowing and viewport normalized view volume if: - scan conversion/ rasterization normalized view
More informationCSE 167: Introduction to Computer Graphics Lecture #9: Visibility. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018
CSE 167: Introduction to Computer Graphics Lecture #9: Visibility Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018 Announcements Midterm Scores are on TritonEd Exams to be
More informationS 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
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 Copyright 2018 Sung-eui Yoon, KAIST freely available on the internet http://sglab.kaist.ac.kr/~sungeui/render
More informationExamples. Clipping. The Rendering Pipeline. View Frustum. Normalization. How it is done. Types of operations. Removing what is not seen on the screen
Computer Graphics, Lecture 0 November 7, 006 Eamples Clipping Types of operations Accept Reject Clip Removing what is not seen on the screen The Rendering Pipeline The Graphics pipeline includes one stage
More informationFROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU
FROM VERTICES TO FRAGMENTS Lecture 5 Comp3080 Computer Graphics HKBU OBJECTIVES Introduce basic implementation strategies Clipping Scan conversion OCTOBER 9, 2011 2 OVERVIEW At end of the geometric pipeline,
More informationTriangle Rasterization
Triangle Rasterization Computer Graphics COMP 770 (236) Spring 2007 Instructor: Brandon Lloyd 2/07/07 1 From last time Lines and planes Culling View frustum culling Back-face culling Occlusion culling
More informationCSE528 Computer Graphics: Theory, Algorithms, and Applications
CSE528 Computer Graphics: Theory, Algorithms, and Applications Hong Qin Stony Brook University (SUNY at Stony Brook) Stony Brook, New York 11794-2424 Tel: (631)632-845; Fax: (631)632-8334 qin@cs.stonybrook.edu
More informationComputer Graphics (CS 543) Lecture 9 (Part 2): Clipping. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)
Computer Graphics (CS 543) Lecture 9 (Part 2): Clipping Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) OpenGL Stages After projection, several stages before objects drawn
More informationCSE328 Fundamentals of Computer Graphics
CSE328 Fundamentals of Computer Graphics Hong Qin State University of New York at Stony Brook (Stony Brook University) Stony Brook, New York 794--44 Tel: (63)632-845; Fax: (63)632-8334 qin@cs.sunysb.edu
More informationOverview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal
Overview Pipeline implementation I Preliminaries Clipping Line clipping Hidden Surface removal Overview At end of the geometric pipeline, vertices have been assembled into primitives Must clip out primitives
More informationThe Traditional Graphics Pipeline
Last Time? The Traditional Graphics Pipeline Participating Media Measuring BRDFs 3D Digitizing & Scattering BSSRDFs Monte Carlo Simulation Dipole Approximation Today Ray Casting / Tracing Advantages? Ray
More informationLecture 5: Viewing. CSE Computer Graphics (Fall 2010)
Lecture 5: Viewing CSE 40166 Computer Graphics (Fall 2010) Review: from 3D world to 2D pixels 1. Transformations are represented by matrix multiplication. o Modeling o Viewing o Projection 2. Clipping
More informationClass of Algorithms. Visible Surface Determination. Back Face Culling Test. Back Face Culling: Object Space v. Back Face Culling: Object Space.
Utah School of Computing Spring 13 Class of Algorithms Lecture Set Visible Surface Determination CS56 Computer Graphics From Rich Riesenfeld Spring 13 Object (Model) Space Algorithms Work in the model
More information3D Polygon Rendering. Many applications use rendering of 3D polygons with direct illumination
Rendering Pipeline 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination 3D Polygon Rendering What steps are necessary to utilize spatial coherence while drawing
More information2D 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
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 the viewport of the current application window. A pixel
More informationMIT EECS 6.837, Teller and Durand 1
MIT EECS 6.837, Teller and Durand 1 Clipping MIT EECS 6.837 Frédo Durand and Seth Teller Some slides and images courtesy of Leonard McMillan MIT EECS 6.837, Teller and Durand 2 Administrative Assignment
More informationLecture 4. Viewing, Projection and Viewport Transformations
Notes on Assignment Notes on Assignment Hw2 is dependent on hw1 so hw1 and hw2 will be graded together i.e. You have time to finish both by next monday 11:59p Email list issues - please cc: elif@cs.nyu.edu
More informationNotes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment
Notes on Assignment Notes on Assignment Objects on screen - made of primitives Primitives are points, lines, polygons - watch vertex ordering The main object you need is a box When the MODELVIEW matrix
More informationVisibility: Z Buffering
University of British Columbia CPSC 414 Computer Graphics Visibility: Z Buffering Week 1, Mon 3 Nov 23 Tamara Munzner 1 Poll how far are people on project 2? preferences for Plan A: status quo P2 stays
More informationCSE 167: Introduction to Computer Graphics Lecture #10: View Frustum Culling
CSE 167: Introduction to Computer Graphics Lecture #10: View Frustum Culling Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015 Announcements Project 4 due tomorrow Project
More informationReading on the Accumulation Buffer: Motion Blur, Anti-Aliasing, and Depth of Field
Reading on the Accumulation Buffer: Motion Blur, Anti-Aliasing, and Depth of Field 1 The Accumulation Buffer There are a number of effects that can be achieved if you can draw a scene more than once. You
More informationCS123 INTRODUCTION TO COMPUTER GRAPHICS. Clipping. Concepts, Algorithms for line clipping. 1 of 16. Andries van Dam. Clipping - 10/12/17
Clipping Concepts, Algorithms for line clipping 1 of 16 Line Clipping in 2D Clipping endpoints If x min x x max and y min y y max, the point is inside the clip rectangle. Endpoint analysis for lines: if
More informationRasterization Overview
Rendering Overview The process of generating an image given a virtual camera objects light sources Various techniques rasterization (topic of this course) raytracing (topic of the course Advanced Computer
More informationThe Traditional Graphics Pipeline
Last Time? The Traditional Graphics Pipeline Reading for Today A Practical Model for Subsurface Light Transport, Jensen, Marschner, Levoy, & Hanrahan, SIGGRAPH 2001 Participating Media Measuring BRDFs
More informationAdvanced Computer Graphics (CS & SE )
Advanced Computer Graphics (CS & SE 233.420) Topics Covered Picking Pipeline Viewing and Transformations Rendering Modes OpenGL can render in one of three modes selected by glrendermode(mode) GL_RENDER
More informationComputer Graphics. - Clipping - Philipp Slusallek & Stefan Lemme
Computer Graphics - Clipping - Philipp Slusallek & Stefan Lemme Clipping Motivation Projected primitive might fall (partially) outside of the visible display window E.g. if standing inside a building Eliminate
More informationComputer Science 474 Spring 2010 Viewing Transformation
Viewing Transformation Previous readings have described how to transform objects from one position and orientation to another. One application for such transformations is to create complex models from
More informationThe Traditional Graphics Pipeline
Final Projects Proposals due Thursday 4/8 Proposed project summary At least 3 related papers (read & summarized) Description of series of test cases Timeline & initial task assignment The Traditional Graphics
More informationChapter 8: Implementation- Clipping and Rasterization
Chapter 8: Implementation- Clipping and Rasterization Clipping Fundamentals Cohen-Sutherland Parametric Polygons Circles and Curves Text Basic Concepts: The purpose of clipping is to remove objects or
More informationComputer Graphics Geometry and Transform
! Computer Graphics 2014! 5. Geometry and Transform Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2014-10-11! Today outline Triangle rasterization Basic vector algebra ~ geometry! Antialiasing
More informationPerformance OpenGL Programming (for whatever reason)
Performance OpenGL Programming (for whatever reason) Mike Bailey Oregon State University Performance Bottlenecks In general there are four places a graphics system can become bottlenecked: 1. The computer
More informationFrom Vertices To Fragments-1
From Vertices To Fragments-1 1 Objectives Clipping Line-segment clipping polygon clipping 2 Overview At end of the geometric pipeline, vertices have been assembled into primitives Must clip out primitives
More informationComputer Graphics: 7-Polygon Rasterization, Clipping
Computer Graphics: 7-Polygon Rasterization, Clipping Prof. Dr. Charles A. Wüthrich, Fakultät Medien, Medieninformatik Bauhaus-Universität Weimar caw AT medien.uni-weimar.de Filling polygons (and drawing
More informationScan Converting Triangles
Scan Converting Triangles Why triangles? Rasterizing triangles Interpolating parameters Post-triangle rendering Comp 236 Spring 2005 Primitive Rasterization 2-D SAMPLING problem Which pixels (samples)
More informationgraphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1
graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1 graphics pipeline sequence of operations to generate an image using object-order processing primitives processed one-at-a-time
More informationgraphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1
graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1 graphics pipeline sequence of operations to generate an image using object-order processing primitives processed one-at-a-time
More informationRealtime 3D Computer Graphics Virtual Reality
Realtime 3D Computer Graphics Virtual Reality From Vertices to Fragments Overview Overall goal recapitulation: Input: World description, e.g., set of vertices and states for objects, attributes, camera,
More informationAnnouncements. Submitting Programs Upload source and executable(s) (Windows or Mac) to digital dropbox on Blackboard
Now Playing: Vertex Processing: Viewing Coulibaly Amadou & Mariam from Dimanche a Bamako Released August 2, 2005 Rick Skarbez, Instructor COMP 575 September 27, 2007 Announcements Programming Assignment
More informationCS 498 VR. Lecture 18-4/4/18. go.illinois.edu/vrlect18
CS 498 VR Lecture 18-4/4/18 go.illinois.edu/vrlect18 Review and Supplement for last lecture 1. What is aliasing? What is Screen Door Effect? 2. How image-order rendering works? 3. If there are several
More informationCSE 167: Introduction to Computer Graphics Lecture #5: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017
CSE 167: Introduction to Computer Graphics Lecture #5: Projection Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017 Announcements Friday: homework 1 due at 2pm Upload to TritonEd
More informationVisibility and Occlusion Culling
Visibility and Occlusion Culling CS535 Fall 2014 Daniel G. Aliaga Department of Computer Science Purdue University [some slides based on those of Benjamin Mora] Why? To avoid processing geometry that does
More informationCSE328 Fundamentals of Computer Graphics: Concepts, Theory, Algorithms, and Applications
CSE328 Fundamentals of Computer Graphics: Concepts, Theory, Algorithms, and Applications Hong Qin Stony Brook University (SUNY at Stony Brook) Stony Brook, New York 11794-4400 Tel: (631)632-8450; Fax:
More informationCS4620/5620: Lecture 14 Pipeline
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
More informationHidden surface removal. Computer Graphics
Lecture Hidden Surface Removal and Rasterization Taku Komura Hidden surface removal Drawing polygonal faces on screen consumes CPU cycles Illumination We cannot see every surface in scene We don t want
More informationINTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52
cs337 It looks like a matrix Sort of Viewing III Projection in Practice / 52 cs337 Arbitrary 3D views Now that we have familiarity with terms we can say that these view volumes/frusta can be specified
More informationCSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department
CSE 690: GPGPU Lecture 2: Understanding the Fabric - Intro to Graphics Klaus Mueller Stony Brook University Computer Science Department Klaus Mueller, Stony Brook 2005 1 Surface Graphics Objects are explicitely
More informationRendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane
Rendering Pipeline Rendering Converting a 3D scene to a 2D image Rendering Light Camera 3D Model View Plane Rendering Converting a 3D scene to a 2D image Basic rendering tasks: Modeling: creating the world
More informationInteracting with a 3D World
CS380: Computer Graphics Interacting with a 3D World Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/cg/ Announcement Mid-term exam 12:40pm ~ 2:00pm, Mar-26 (Mon.) 2 Class Objectives
More informationEECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing
EECE 478 Rasterization & Scenes Rasterization Learning Objectives Be able to describe the complete graphics pipeline. Describe the process of rasterization for triangles and lines. Compositing Manipulate
More informationHidden Surfaces II. Week 9, Mon Mar 15
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Hidden Surfaces II Week 9, Mon Mar 15 http://www.ugrad.cs.ubc.ca/~cs314/vjan2010 ews yes, I'm granting the request
More informationCS602 MCQ,s for midterm paper with reference solved by Shahid
#1 Rotating a point requires The coordinates for the point The rotation angles Both of above Page No 175 None of above #2 In Trimetric the direction of projection makes unequal angle with the three principal
More informationSurface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:
Surface Graphics Objects are explicitely defined by a surface or boundary representation (explicit inside vs outside) This boundary representation can be given by: - a mesh of polygons: 200 polys 1,000
More informationTwo-Dimensional Viewing. Chapter 6
Two-Dimensional Viewing Chapter 6 Viewing Pipeline Two-Dimensional Viewing Two dimensional viewing transformation From world coordinate scene description to device (screen) coordinates Normalization and
More informationCSE528 Computer Graphics: Theory, Algorithms, and Applications
CSE528 Computer Graphics: Theory, Algorithms, and Applications Hong Qin State University of New York at Stony Brook (Stony Brook University) Stony Brook, New York 11794--4400 Tel: (631)632-8450; Fax: (631)632-8334
More informationCS 591B Lecture 9: The OpenGL Rendering Pipeline
CS 591B Lecture 9: The OpenGL Rendering Pipeline 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination Spring 2007 Rui Wang 3D Polygon Rendering Many applications
More informationThe Graphics Pipeline. Interactive Computer Graphics. The Graphics Pipeline. The Graphics Pipeline. The Graphics Pipeline: Clipping
Interactive Computer Graphics The Graphics Pipeline: The Graphics Pipeline Input: - geometric model - illumination model - camera model - viewport Some slides adopted from F. Durand and B. Cutler, MIT
More informationRobust Stencil Shadow Volumes. CEDEC 2001 Tokyo, Japan
Robust Stencil Shadow Volumes CEDEC 2001 Tokyo, Japan Mark J. Kilgard Graphics Software Engineer NVIDIA Corporation 2 Games Begin to Embrace Robust Shadows 3 John Carmack s new Doom engine leads the way
More informationGraphics Pipeline & APIs
Graphics Pipeline & APIs CPU Vertex Processing Rasterization Fragment Processing glclear (GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT); glpushmatrix (); gltranslatef (-0.15, -0.15, solidz); glmaterialfv(gl_front,
More informationS 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
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 Copyright 2018 Sung-eui Yoon, KAIST freely available on the internet http://sglab.kaist.ac.kr/~sungeui/render
More informationCS602 Midterm Subjective Solved with Reference By WELL WISHER (Aqua Leo)
CS602 Midterm Subjective Solved with Reference By WELL WISHER (Aqua Leo) www.vucybarien.com Question No: 1 What are the two focusing methods in CRT? Explain briefly. Page no : 26 1. Electrostatic focusing
More informationReal-Time Rendering (Echtzeitgraphik) Dr. Michael Wimmer
Real-Time Rendering (Echtzeitgraphik) Dr. Michael Wimmer wimmer@cg.tuwien.ac.at Visibility Overview Basics about visibility Basics about occlusion culling View-frustum culling / backface culling Occlusion
More informationShadows in the graphics pipeline
Shadows in the graphics pipeline Steve Marschner Cornell University CS 569 Spring 2008, 19 February There are a number of visual cues that help let the viewer know about the 3D relationships between objects
More information12. Selection. - The objects selected are specified by hit records in the selection buffer. E.R. Bachmann & P.L. McDowell MV 4202 Page 1 of 13
12. Selection Picking is a method of capturing mouse clicks at some window position and determining what objects are beneath it. The basic idea is to enter the selection rendering mode with a small viewing
More informationCSE 167: Lecture #4: Vertex Transformation. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012
CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 Announcements Project 2 due Friday, October 12
More informationClipping and Intersection
Clipping and Intersection Clipping: Remove points, line segments, polygons outside a region of interest. Need to discard everything that s outside of our window. Point clipping: Remove points outside window.
More informationSpatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology
Spatial Data Structures and Speed-Up Techniques Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology Spatial data structures What is it? Data structure that organizes
More informationHidden Surface Removal
Outline Introduction Hidden Surface Removal Hidden Surface Removal Simone Gasparini gasparini@elet.polimi.it Back face culling Depth sort Z-buffer Introduction Graphics pipeline Introduction Modeling Geom
More informationTopic #1: Rasterization (Scan Conversion)
Topic #1: Rasterization (Scan Conversion) We will generally model objects with geometric primitives points, lines, and polygons For display, we need to convert them to pixels for points it s obvious but
More informationIllumination & Shading: Part 1
Illumination & Shading: Part 1 Light Sources Empirical Illumination Shading Local vs Global Illumination Lecture 10 Comp 236 Spring 2005 Computer Graphics Jargon: Illumination Models Illumination - the
More informationPage 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms
Visible Surface Determination Visibility Culling Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms Divide-and-conquer strategy:
More informationImaging and 2D Transforms
Imaging and 2D Transforms Lecture 3 Comp 236 Spring 2005 Two-Dimensional Geometric Transforms Functions for mapping points from one place to another Geometric transforms can be applied to drawing primitives
More informationCOMP30019 Graphics and Interaction Rendering pipeline & object modelling
COMP30019 Graphics and Interaction Rendering pipeline & object modelling Department of Computer Science and Software Engineering The Lecture outline Introduction to Modelling Polygonal geometry The rendering
More informationLecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling
Lecture outline COMP30019 Graphics and Interaction Rendering pipeline & object modelling Department of Computer Science and Software Engineering The Introduction to Modelling Polygonal geometry The rendering
More informationTopics. From vertices to fragments
Topics From vertices to fragments From Vertices to Fragments Assign a color to every pixel Pass every object through the system Required tasks: Modeling Geometric processing Rasterization Fragment processing
More information3D Graphics Pipeline II Clipping. Instructor Stephen J. Guy
3D Graphics Pipeline II Clipping Instructor Stephen J. Guy 3D Rendering Pipeline (for direct illumination) 3D Geometric Primitives 3D Model Primitives Modeling Transformation 3D World Coordinates Lighting
More informationCS 130 Exam I. Fall 2015
S 3 Exam I Fall 25 Name Student ID Signature You may not ask any questions during the test. If you believe that there is something wrong with a question, write down what you think the question is trying
More informationGraphics Pipeline & APIs
3 2 4 Graphics Pipeline & APIs CPU Vertex Processing Rasterization Processing glclear (GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT); glpushmatrix (); gltranslatef (-0.15, -0.15, solidz); glmaterialfv(gl_front,
More informationClipping. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015
Clipping 1 Objectives Clipping lines First of implementation algorithms Clipping polygons (next lecture) Focus on pipeline plus a few classic algorithms 2 Clipping 2D against clipping window 3D against
More informationReal-Time Graphics Architecture
Real-Time Graphics Architecture Kurt Akeley Pat Hanrahan http://www.graphics.stanford.edu/courses/cs448a-01-fall Geometry Outline Vertex and primitive operations System examples emphasis on clipping Primitive
More informationRenderer Implementation: Basics and Clipping. Overview. Preliminaries. David Carr Virtual Environments, Fundamentals Spring 2005
INSTITUTIONEN FÖR SYSTEMTEKNIK LULEÅ TEKNISKA UNIVERSITET Renderer Implementation: Basics and Clipping David Carr Virtual Environments, Fundamentals Spring 2005 Feb-28-05 SMM009, Basics and Clipping 1
More informationCS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination
CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks) Figure 1: A perspective view of a polyhedron on an infinite plane. Cameras and Perspective Rendering
More informationGraphics and Interaction Rendering pipeline & object modelling
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
More information1.2.3 The Graphics Hardware Pipeline
Figure 1-3. The Graphics Hardware Pipeline 1.2.3 The Graphics Hardware Pipeline A pipeline is a sequence of stages operating in parallel and in a fixed order. Each stage receives its input from the prior
More informationWed, October 12, 2011
Practical Occlusion Culling in Killzone 3 Michal Valient Lead Tech, Guerrilla B.V. Talk takeaway Occlusion culling system used in Killzone 3 The reasons why to use software rasterization (Some) technical
More informationComputer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo
Computer Graphics Bing-Yu Chen National Taiwan University The University of Tokyo Hidden-Surface Removal Back-Face Culling The Depth-Sort Algorithm Binary Space-Partitioning Trees The z-buffer Algorithm
More informationINFOGR Computer Graphics. J. Bikker - April-July Lecture 11: Visibility. Welcome!
INFOGR Computer Graphics J. Bikker - April-July 2016 - Lecture 11: Visibility Welcome! Smallest Ray Tracers: Executable 5692598 & 5683777: RTMini_minimal.exe 2803 bytes 5741858: ASM_CPU_Min_Exe 994 bytes
More informationComputer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura
Computer Graphics Lecture 9 Hidden Surface Removal Taku Komura 1 Why Hidden Surface Removal? A correct rendering requires correct visibility calculations When multiple opaque polygons cover the same screen
More information