24 Pages

lecture5_p4

Course: CS 543, Fall 2008
School: Uni. Worcester
Rating:
 
 
 
 
 

Word Count: 1130

Document Preview

4731/543: CS Computer Graphics Lecture 5 (Part IV): Hidden Surface Removal Emmanuel Agu Hidden surface Removal n n n n Drawing polygonal faces on screen consumes CPU cycles We cannot see every surface in scene To save time, draw only surfaces we see Surfaces we cannot see and their elimination methods: n n n Occluded surfaces: hidden surface removal (visibility) Back faces: back face culling Faces outside view...

Register Now

Unformatted Document Excerpt

Coursehero >> United Kingdom >> Uni. Worcester >> CS 543

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
4731/543: CS Computer Graphics Lecture 5 (Part IV): Hidden Surface Removal Emmanuel Agu Hidden surface Removal n n n n Drawing polygonal faces on screen consumes CPU cycles We cannot see every surface in scene To save time, draw only surfaces we see Surfaces we cannot see and their elimination methods: n n n Occluded surfaces: hidden surface removal (visibility) Back faces: back face culling Faces outside view volume: viewing frustrum culling Object space techniques: applied before vertices are mapped to pixels Image space techniques: applied after vertices have been rasterized n Definitions: n n Visibility (hidden surface removal) n n A correct rendering requires correct visibility calculations Correct visibility when multiple opaque polygons cover the same screen space, only the closest one is visible (remove the other hidden surfaces) wrong visibility Correct visibility Visibility (hidden surface removal) n Goal: determine which objects are visible to the eye n Determine what colors to use to paint the pixels n Active research subject - lots of algorithms have been proposed in the past (and is still a hot topic) Visibility (hidden surface removal) n Where is visiblity performed in the graphics pipeline? v1, m1 modeling and viewing v2, m2 v3, m3 per vertex lighting interpolate vertex colors projection Rasterization texturing Shading visibility viewport mapping clipping Display Note: Map (x,y) values to screen (draw) and use z value for depth testing OpenGL - Image Space Approach Determine which of the n objects is visible to each pixel on the image plane for (each pixel in the image) { determine the object closest to the pixel draw the pixel using the objects color } Image Space Approach Z-buffer Method used in most of graphics hardware (and thus OpenGL): Z-buffer (or depth buffer) algorithm Requires lots of memory Recall: after projection transformation, in viewport transformation n n n n n x,y used to draw screen image, mapped to viewport z component is mapped to pseudo-depth with range [0,1] n n n n Objects/polygons are made up of vertices Hence, we know depth z at polygon vertices Point on object seen through pixel may be between vertices Need to interpolate to find z Image Space Approach Z-buffer Basic Z-buffer idea: n n n n n rasterize every input polygon For every pixel in the polygon interior, calculate its corresponding z value (by interpolation) Track depth values of closest polygon (smallest z) so far Paint the pixel with the color of the polygon whose z value is the closest to the eye. Z (depth) buffer algorithm n n How to choose the polygon that has the closet Z for a given pixel? Example: eye at z = 0, farther objects have increasingly positive values, between 0 and 1 1. 2. 3. Initialize (clear) every pixel in the z buffer to 1.0 Track polygon zs. As we rasterize polygons, check to see if polygons z through this pixel is less than current minimum z through this pixel Run the following loop: 4. Z (depth) Buffer Algorithm For each polygon { for each pixel (x,y) inside the polygon projection area { if (z_polygon_pixel(x,y) < depth_buffer(x,y) ) { depth_buffer(x,y) = z_polygon_pixel(x,y); } color_buffer(x,y) = polygon color at (x,y) } } Note: know depths at vertices. Interpolate for interior z_polygon_pixel(x, y) depths Z buffer example Z = 0.5 Z = 0.3 Correct Final image eye Top View Z buffer 1: example Step Initialize the depth buffer 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 Z buffer example Step 2: Draw the blue polygon (assuming the OpenGL program draws blue polyon first the order does not affect the final result any way). Z = 0.5 1.0 1.0 0.5 0.5 1.0 1.0 0.5 0.5 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 eye Z = 0.3 Z buffer example Step 3: Draw the yellow polygon 1.0 1.0 0.5 0.5 1.0 0.3 0.3 0.5 1.0 0.3 0.3 1.0 1.0 1.0 1.0 1.0 Z = 0.5 Z = 0.3 eye z-buffer drawback: wastes resources by rendering a face and then drawing over it Combined z-buffer and Gouraud Shading (fig 8.31) for(int y = ybott; y <= ytop; y++) // for each scan line { for(each polygon){ find xleft and xright find dleft and dright, and dinc find colorleft and colorright, and colorinc for(int x = xleft, c = colorleft, d = dleft; x <= xright; x++, c+= colorinc, d+= dinc) color3 if(d < d[x][y]) ytop { color4 y4 put c into the pixel at (x, y) d[x][y] = d; // update closest depth ys }} } ybott color2 color1 xleft xright Z-Buffer Depth Compression n n n n n Recall that we chose parameters a and b to map z from range [near, far] to pseudodepth range[0,1] This mapping is almost linear close to eye Non-linear further from eye, approaches asymptote Also limited number of bits Thus, two z values close to far plane may map to same pseudodepth: Errors!! F+N Actual z 1 N F -1 -Pz a = F N aPz + b Pz FN b = 2 N F OpenGL HSR Commands n Primarily three commands to do HSR glutInitDisplayMode(GLUT_DEPTH | GLUT_RGB) instructs openGL to create depth buffer glEnable(GL_DEPTH_TEST) enables depth testing glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) initializes the depth buffer every time we draw a new picture n n n Back Face Culling n n Back faces: faces of opaque object which are pointing away from viewer Back face culling remove back faces (supported by OpenGL) Back face n How to detect back faces? Back Face Culling n n n n n n If we find backface, do not draw, save rendering resour...

Textbooks related to the document above:
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Uni. Worcester - CS - 543
CS 4731/543: Computer Graphics Lecture 7 (Part III): Raytracing (Part II) Emmanuel AguWhere are we?Define the objects and light sources in the scene Set up the camera for(int r = 0; r &lt; nRows; r+= blockSize){ for(int c = 0; c &lt; nCols; c+= blockSiz
Uni. Worcester - CS - 543
CS 543: Computer Graphics Lecture 7 (Part II): Projection Emmanuel Agu3D Viewing and View VolumenRecall: 3D viewing set upProjection Transformationn n nView volume can have different shapes (different looks) Different types of projection: p
Uni. Worcester - CS - 543
CS 4731/543: Computer Graphics Lecture 8 (Part II): Raytracing (Part 4) Emmanuel AguReflection and Transparencyn nRay tracing also handles reflections and refraction of light well We can easily render realistic scenes withn nmirrors, martini
Truman State - CS - 170
CS 170Introduction to Computer ScienceSpring 2009Instructor: John Neitzke Office 8:30 10:20 M W F Office: VH 2242 Hours: 12:30 1:20 M W F Phone: x4529 and by appointment E-Mail: jneitzke@truman.edu Web: http:/www2.truman.edu/~jneitzke Course
Colorado State - FW - 662
Sheet1 vti_encoding:SR|utf8-nl vti_backlinkinfo:VX|overview.htm vti_timelastmodified:TR|23 Jan 1999 14:06:38 -0700 vti_extenderversion:SR|5.0.2.4330 vti_author:SR|gwhite vti_modifiedby:SR|gwhite vti_timecreated:TR|03 Feb 2001 13:49:35 -0000 vti_cache
Colorado State - FW - 662
Sheet1 vti_encoding:SR|utf8-nl vti_backlinkinfo:VX|overview.htm vti_timelastmodified:TR|23 Jan 1999 14:57:58 -0700 vti_extenderversion:SR|5.0.2.4330 vti_author:SR|gwhite vti_modifiedby:SR|gwhite vti_timecreated:TR|23 Jan 1999 21:57:58 -0000 vti_cache
Colorado State - FW - 662
Sheet1 vti_encoding:SR|utf8-nl vti_backlinkinfo:VX|overview.htm vti_timelastmodified:TR|23 Jan 1999 14:36:24 -0700 vti_extenderversion:SR|5.0.2.4330 vti_author:SR|gwhite vti_modifiedby:SR|gwhite vti_timecreated:TR|03 Feb 2001 13:47:46 -0000 vti_cache
Colorado State - FW - 662
Sheet1 vti_encoding:SR|utf8-nl vti_backlinkinfo:VX|overview.htm vti_timelastmodified:TR|23 Jan 1999 14:43:14 -0700 vti_extenderversion:SR|5.0.2.4330 vti_author:SR|gwhite vti_modifiedby:SR|gwhite vti_timecreated:TR|03 Feb 2001 13:51:12 -0000 vti_cache
Colorado State - FW - 662
Sheet1 vti_encoding:SR|utf8-nl vti_backlinkinfo:VX|overview.htm vti_timelastmodified:TR|23 Jan 1999 14:53:16 -0700 vti_extenderversion:SR|5.0.2.4330 vti_author:SR|gwhite vti_modifiedby:SR|gwhite vti_timecreated:TR|23 Jan 1999 21:53:16 -0000 vti_cache
IUPUI - CS - 506
Sample Task Tracking: Form TASKOwner ID: Leader Effort Units Hour Period Units Week Date: 9/16/2006Team ID: Part/Level:1 ProposalProject: Health Package Iterations: 1-3TASK Work Flow Strategy Documentation &quot; Documentation Task Name Mngt. &amp; M
IUPUI - CS - 506
The User's GuideThe Guide must be structured so that it begins with a Title followed by the name and identifier of the author and the date. The first paragraph must be a brief statement of the topic that the Guide is going to explain. It must also
IUPUI - CS - 506
6. DESIGN II: DETAILED DESIGNDevelop Architecture - see chapter 5 Identify corporate practices Plan project Analyze requirements Design ImplementSoftware Engineering Roadmap: Chapter 6 FocusPerform Detailed Design - apply design patterns- acco
IUPUI - CS - 506
10. MAINTENANCESoftware Engineering Roadmap: Chapter 10 FocusIdentify corporate practices Plan project Analyze requirements Design Implement Test unitsAdapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001
IUPUI - CS - 506
8. UNIT TESTINGSoftware Engineering Roadmap: Chapter 8 FocusIdentify corporate practices Plan project Analyze requirements Design Implement Test units Maintain Integrate &amp; test systemTest units (parts) separately - use implementations- apply di
Maple Springs - ECON - 5310
Discussion Questions: Andreoni &amp; Payne (AER 03) 1. There are important differences in government spending across countries. This also implies significant differences in the level of private provision of public goods. Based on the material discussed i
Maple Springs - ECON - 5310
Discussion Questions: Brlhart &amp; Jametti (JPubE 2006) 1. 2. 3. 4. B &amp; J use instruments for the endogenous cantonal taxes. Discuss the choice of instruments. Discuss the control variables included in the regression. Why are they necessary? Is anything
Virginia Tech - CSX - 984
cgcgcgctggcgcgagcgatctcagtatccttagccgtatcccgacttatacaccgatccgagagacttccgtttgaacatcttggtgcgacggcggtccatatcgccgtctagaggttattccctaactccacgcactagatggtttcaggtaaggcgagacgtactcgtcgaagggcagagtcgcaacagccggcatggaagcataggagagccttcggctctcagcttcgtaagtatcaccgttccg
Allan Hancock College - LING - 253
Feelings and attitudes Loaded LanguagePersuasion without argument Affective language Sometimes explicit; sometimes implicit2005-10-17LING253: Reasoning12005-10-17LING253: Reasoning2Kinds of opinionObviously subjective opinion Obv
Allan Hancock College - LING - 253
LING253 figures - Affective language Table 1: Kinds of opinion; how they are expressedOpinion Affect +/+ Judgement + Appreciation + Modalisation + Modularity + Noun pleasure displeasure right wrong beauty ugliness certainty Adjective pleasant Verb l
Allan Hancock College - LING - 253
Example 1Example 2Anexcerptfromadraftprojectreport: Ourfirstmeeting,heldonMarch14th,waswiththeheadofthesales department,TedStevens.Generally,hegaveusanoutlineoftheorganisation, fromCEOtoprocessworker,anddiscussedthevariousdepartmentsthat wouldul
Allan Hancock College - LING - 253
Spoken &amp; written language Genre and Register They are different, but . . . Language is not conveniently split into two halves. Some texts seem to be both, or neither; the distinction is blurred.Language variation according to situation2006-08-
Allan Hancock College - LING - 253
Example 1Letter from a bank, announcing increased feesDear &lt;bank&gt; Customer, A few changes to your &lt;bank&gt; accounts. At &lt;bank&gt;, we are committed to providing our customers with real value when it comes to their everyday banking needs. We're also comm
Allan Hancock College - LING - 253
LING253: Week 3 Workshop, part 1First set of examples - business letters.BackgroundExample 1 is from a bank to a customer, announcing some fee increases and attempting to present them in a favourable light. Example 2 is an unsolicited offer from
Allan Hancock College - LING - 253
LST210 figures - week 4 Figure 1 Figure 2 Example 1The Prime Minister is going to Washington tomorrow. The cat got into a fight last night. Perhaps we should invite Sam and Sally over for dinner. Example 2Sam
Allan Hancock College - LING - 253
Environment chainFeedlots, where cattle are enclosed and fed a high-nutrient diet, have not been popular in Australia. Although there are about a million cattle in feedlots, and this number is predicted to double in five years, growth is held back b
Allan Hancock College - LING - 253
Livestock chainFeedlots, where cattle are enclosed and fed a high-nutrient diet, have not been popular in Australia. Although there are about a million cattle in feedlots, and this number is predicted to double in five years, growth is held back by
Minnesota - MATH - 4707
Math 4707Introduction to Combinatorics and Graph Theory Homework 2, Due Monday September 25Fall 2006Exercises in square brackets [ ] are to be worked out but not handed in. All answers must be supported. If a logical argument is required, use f
Allan Hancock College - LING - 253
Manure chainFeedlots, where cattle are enclosed and fed a high-nutrient diet, have not been popular in Australia. Although there are about a million cattle in feedlots, and this number is predicted to double in five years, growth is held back by env
Allan Hancock College - LING - 253
Place chainFeedlots, where cattle are enclosed and fed a high-nutrient diet, have not been popular in Australia. Although there are about a million cattle in feedlots, and this number is predicted to double in five years, growth is held back by envi
Minnesota - MATH - 4707
Math 4707Introduction to Combinatorics and Graph Theory Homework 4, Due Monday October 23Fall 2006Exercises in square brackets [ ] are to be worked out but not handed in. All answers must be supported. If a logical argument is required, use ful
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Company boxFeedlots,wherecattleareenclosedandfedahighnutrientdiet,havenotbeenpopularin Australia.Althoughthereareaboutamillioncattleinfeedlots,andthisnum
Minnesota - MATH - 4707
Math 4707Introduction to Combinatorics and Graph Theory Homework 6, Due Wednesday November 8Fall 2006Exercises in square brackets [ ] are to be worked out but not handed in. All answers must be supported. If a logical argument is required, use
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Digestion boxFeedlots, where cattle are enclosed and fed a highnutrient diet, have not been popular in Australia. Although there are about a million cat
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Digestion boxFeedlots,wherecattleareenclosedandfedahighnutrientdiet,havenotbeenpopularin Australia.Althoughthereareaboutamillioncattleinfeedlots,andthisn
Minnesota - MATH - 4707
Math 4707Introduction to Combinatorics and Graph Theory Homework 9, Due Monday December 11Fall 2006Reading: Section 14.2; Section 14.3; Exercises: Section 14.2: 4, 14; Section 14.3: 4, 14, 33; Additional Exercises: 1. Using the torus provided,
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Feeding boxFeedlots, where cattle are enclosed and fed a highnutrient diet, have not been popular in Australia. Although there are about a million cattl
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Feeding boxFeedlots, where cattle are enclosed and fed a highnutrient diet, have not been popular in Australia. Although there are about a million cattl
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Product boxFeedlots, where cattle are enclosed and fed a highnutrient diet, have not been popular in Australia. Although there are about a million cattl
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Livestock boxFeedlots, where cattle are enclosed and fed a highnutrient diet, have not been popular in Australia. Although there are about a million cat
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Livestock boxFeedlots,wherecattleareenclosedandfedahighnutrientdiet,havenotbeenpopularin Australia.Althoughthereareaboutamillioncattleinfeedlots,andthisn
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Place boxFeedlots, where cattle are enclosed and fed a highnutrient diet, have not been popular in Australia. Although there are about a million cattle
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Place boxFeedlots, where cattle are enclosed and fed a highnutrient diet, have not been popular in Australia. Although there are about a million cattle
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralFeedlots, where cattle are enclosed and fed a highnutrient diet, have not been popular in Australia. Although there are about a million cattle in feedlots, and this number is predicted to
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralFeedlots,wherecattleareenclosedandfedahighnutrientdiet,havenotbeenpopularinAustralia. Althoughthereareaboutamillioncattleinfeedlots,andthisnumberispredictedtodoubleinfiveyears, growthishel
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Product boxFeedlots, where cattle are enclosed and fed a highnutrient diet, have not been popular in Australia. Although there are about a million cattl
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Science boxFeedlots, where cattle are enclosed and fed a highnutrient diet, have not been popular in Australia. Although there are about a million cattl
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Science boxFeedlots,wherecattleareenclosedandfedahighnutrientdiet,havenotbeenpopularin Australia.Althoughthereareaboutamillioncattleinfeedlots,andthisnum
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Science boxFeedlots,wherecattleareenclosedandfedahighnutrientdiet,havenotbeenpopularin Australia.Althoughthereareaboutamillioncattleinfeedlots,andthisnum
Allan Hancock College - LING - 253
P ress releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Uses boxFeedlots, where cattle are enclosed and fed a highnutrient diet, have not been popular in Australia. Although there are about a million cattle
Allan Hancock College - LING - 253
P ress releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Value boxFeedlots,wherecattleareenclosedandfedahighnutrientdiet,havenotbeenpopularinAustralia. Althoughthereareaboutamillioncattleinfeedlots,andthisnumb
Allan Hancock College - LING - 253
Press releaseZeolite Australia has big plans for the mineralLink highlights in this colour to Value boxFeedlots, where cattle are enclosed and fed a highnutrient diet, have not been popular in Australia. Although there are about a million cattle
Allan Hancock College - LING - 253
Week 4 WorkshopHere's a rough illustration of the structure:CompanyValuePlaceTimeProductScienceUsesEnvironmentLivestockFeedingDigestionManure
Allan Hancock College - LING - 253
LING253: Week 4 Workshop, part 1The first text for close examination is a press release.BackgroundPress releases are written by companies, and published - perhaps with little or no editorial change - in newspapers. Example 1 dates back to 1994.
Allan Hancock College - LING - 253
L I NG253: Week 4 Workshop, pa rt 2Thesecondtextforcloseexaminationisanewsreport.BackgroundThecohesivesystemsinthistextarequitecomplex,reflectingthetightconstraintsofnews reporting.AnalysisThereareelementsofthistextthatpresupposethereadersfami
Allan Hancock College - LING - 253
LING253: Week 4 Workshop, part 2The second text for close examination is a news report. BackgroundThe cohesive systems in this text are quite complex, reflecting the tight constraints of news reporting. AnalysisThere are elements of this tex
Allan Hancock College - LING - 253
Reasoning ReasoningBuilding an argument The nature of argument The elements of an argument Underlying logic Fallacies and unreason2005-10-04LING253: Reasoning12005-10-04LING253: Reasoning2The nature of argument An argument is not
Allan Hancock College - LING - 253
Unlikely lesson in leadingJanet AlbrechtsenThe Australian, September 21, 2005QUITE accidentally, Mark Latham's book is a brilliant lesson on leadership. When the spleen has been vented and the hypocrisy forgotten, the lasting message from The Lath
Allan Hancock College - LING - 253
Feelings and attitudes Loaded LanguagePersuasion without argument Affective language Sometimes explicit; sometimes implicit2005-10-17LING253: Reasoning12005-10-17LING253: Reasoning2Kinds of opinionObviously subjective opinion Obv
Allan Hancock College - LING - 253
LING253 figures Affective language Table 1: Kinds of opinion; how they are expressedOpinion Affect +/+ Judgement + Appreciation + Modalisation + Modularity + Noun pleasure displeasure right wrong beauty ugliness certainty Adjective pleasant Verb li
Allan Hancock College - LING - 253
Unlikely lesson in leadingJanet AlbrechtsenThe Australian, September 21, 2005QUITE accidentally, Mark Latham's book is a brilliant lesson on leadership. When the spleen has been vented and the hypocrisy forgotten, the lasting message from The Lath
Allan Hancock College - LING - 253
LING253 figures - Reasoning Table 1: Types of logical relationshipRelationship Additive Alternative Typical expression and or Example Julius Caesar was a successful Roman general and he later became Dictator. We can regard Napoleon as a great leader