computer graphics through opengl: from theory to experiments, second edition chapter 13

30
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Upload: melinda-oconnor

Post on 18-Jan-2018

225 views

Category:

Documents


0 download

DESCRIPTION

Figure 13.2: Screenshot of blendRectangles1.cpp with (a) the blue rectangle first in code (b) the red rectangle first in code.

TRANSCRIPT

Page 1: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Computer Graphics Through OpenGL: From Theory to

Experiments, Second Edition

Chapter 13

Page 2: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.1: Assuming depth testing on: T rasterized and rendered (upper row),followed by Q rasterized and rendered (lower row). The starred pixel is considered in anexample below.

Page 3: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.2: Screenshot of blendRectangles1.cpp with (a) the blue rectangle first incode (b) the red rectangle first in code.

Page 4: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.3: Screenshots of blendRectangles2.cpp: (a) Original (b) With rectanglesre-ordered to blue, green, red in the code (c) New ordering seen from the -z-direction.

Page 5: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.4: Screenshotof blendRectangles2.cppwith depth testingdisabled.

Page 6: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.5: Screenshots of blended effects: (a) sphereInGlassBox.cpp (b) fieldAnd-SkyTexturesBlended.cpp (c) ballAndTorusReflected.cpp.

Page 7: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.6: Screenshotof fieldAndSkyFogged.cppwith exponential fogging.

Page 8: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.7: f versus z for various parameter values – the graphs are notmathematically exact. Values of fogStart and fogEnd are 0 and K, respectively.

Page 9: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.8: Billboard-ing: the original placementof the billboard (boldborder) is rotated so itsplane is normal to thedirection of the viewer.

Page 10: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.9: Screenshots of billboard.cpp: (a) Billboarding off (b) Billboarding on.

Page 11: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.10: (a) Dark fragments represent a rasterization of a line segment s, specifiedto be one pixel wide (b) Shaded fragments are those that are intersected by the one-pixelwide rectangle R centered on s: the area that R covers of individual fragments, e.g., Pand Q, varies.

Page 12: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.11: Screenshots of antiAliasing+multisampling.cpp: (a) Antialiasing off(b) Antialiasing on. Multisampling off both cases.

Page 13: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.12:Multisampling using a2 x 2 sampling scheme.

Page 14: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.13: Screenshotof pointSprite.cpp.

Page 15: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.14: Blinn-Newell environment mapping principle: texture coordinates for avertex V on an environment-mapped surface are obtained from the point on the textureimage struck by the reflected ray originating from the eye.

Page 16: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.15: Screenshotof sphereMapping.cpp.

Page 17: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.16: Thevectors involved ingenerating texturecoordinates.

Page 18: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.17: Determining Rx from r.

Page 19: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.18: The maps P → (Rx, Ry) and (Rx, Ry) → (s, t).

Page 20: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.19: Theenvironment S around aperfect mirror vertex V .

Page 21: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.20: Cubemapping.

Page 22: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.21: (a) A complete frame buffer (b) A 4 x 4 buffer with 4-bit precision as astack of four bitplanes: points represent bits.

Page 23: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.22: (a) Square R, which is drawn after calls to glStencilFunc(GL_EQUAL, 1,1) and glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE) (b) Stencil bufferconfiguration before R is drawn (c) Stencil buffer configuration after R is drawn. Onlyeach lowest bit in the stencil buffer is shown.

Page 24: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.23: Potentialoutcomes for a fragmentthrough the stencil anddepth tests.

Page 25: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.24: Screenshotof ballAndTorus-Stenciled.cpp.

Page 26: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.25: Screenshotof imageManipulation.-cpp.

Page 27: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.26: Rearrangethe tiles from the order onthe top to that on thebottom.

Page 28: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.27: Bump mapping: (a) The original curve c and its true unit normalsn(u) (b) The wrinkled curve c’ and its unit normal n’(u) at a single point c’(u) (c)Bump mapped c with redefined normals n’(u).

Page 29: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.28: Thebumped surface s’ isobtained from s bydisplacing each points(u, v) a distance d(u, v)along the normal n(u, v) ats(u, v).

Page 30: Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 13

Figure 13.29: Screenshots of bumpMapping.cpp: (a) Bump mapping off (b) Bumpmapping on.