Computer Graphics. Three-Dimensional Graphics VI. Guoying Zhao 1 / 73
|
|
- Earl Gaines
- 5 years ago
- Views:
Transcription
1 Computer Graphics Three-Dimensional Graphics VI Guoying Zhao 1 / 73
2 Texture mapping Guoying Zhao 2 / 73
3 Objectives Introduce Mapping Methods Texture Mapping Environment Mapping Bump Mapping Consider basic strategies Forward vs backward mapping Point sampling vs area averaging Guoying Zhao 3 / 73
4 The Limits of Geometric Modeling Although graphics cards can render over 10 million polygons per second, that number is insufficient for many phenomena Clouds Grass Terrain Skin Guoying Zhao 4 / 73
5 Modeling an Orange Consider the problem of modeling an orange (the fruit) Start with an orange-colored sphere Too simple Replace sphere with a more complex shape Does not capture surface characteristics (small dimples) Takes too many polygons to model all the dimples Guoying Zhao 5 / 73
6 Modeling an Orange (2) Take a picture of a real orange, scan it, and paste onto simple geometric model This process is known as texture mapping Still might not be sufficient because resulting surface will be smooth Need to change local shape Bump mapping Guoying Zhao 6 / 73
7 Texture Mapping Three Types of Mapping Uses images to fill inside of polygons Environment (reflection mapping) Uses a picture of the environment for texture maps Allows simulation of highly specular surfaces Bump mapping Emulates altering normal vectors during the rendering process Guoying Zhao 7 / 73
8 Texture Mapping geometric model texture mapped Guoying Zhao 8 / 73
9 Environment Mapping Guoying Zhao 9 / 73
10 Bump Mapping Guoying Zhao 10 / 73
11 Where does mapping take place? Mapping techniques are implemented at the end of the rendering pipeline Very efficient because few polygons make it past the clipper Guoying Zhao 11 /
12 Is it simple? Although the idea is simple---map an image to a surface---there are 3 or 4 coordinate systems involved 2D image 3D surface Guoying Zhao 12 / 73
13 Coordinate Systems Parametric coordinates May be used to model curves and surfaces Texture coordinates Used to identify points in the image to be mapped Object or World Coordinates Conceptually, where the mapping takes place Window Coordinates Where the final image is really produced Guoying Zhao 13 / 73
14 Texture Mapping parametric coordinates texture coordinates world coordinates window coordinates Guoying Zhao 14 / 73
15 Mapping Functions Basic problem is how to find the maps Consider mapping from texture coordinates to a point on surface Appear to need three functions x = x(s,t) y = y(s,t) z = z(s,t) But we really want to go the other way t s (x,y,z) Guoying Zhao 15 / 73
16 Backward Mapping We really want to go backwards Given a pixel, we want to know to which point on an object it corresponds Given a point on an object, we want to know to which point in the texture it corresponds Need a map of the form s = s(x,y,z) t = t(x,y,z) Such functions are difficult to find in general Guoying Zhao 16 / 73
17 Two-part mapping- First mapping (x,y,z)->(s,t) mapping can be difficult One solution to the mapping problem is to first map the texture to a simple intermediate surface Example: map to cylinder Guoying Zhao 17 / 73
18 Cylindrical Mapping parametric cylinder x = r cos 2π u y = r sin 2πu z = v/h maps rectangle in u,v space to cylinder of radius r and height h in world coordinates s = u t = v maps from texture space Guoying Zhao 18 / 73
19 Spherical Map We can use a parametric sphere x = r cos 2πu y = r sin 2πu cos 2πv z = r sin 2πu sin 2πv in a similar manner to the cylinder but have to decide where to put the distortion Spheres are used in environmental maps Guoying Zhao 19 / 73
20 Box Mapping Easy to use with simple orthographic projection Also used in environment maps Guoying Zhao 20 / 73
21 Two-part mapping- Second Mapping Map from intermediate object to actual object Normals from intermediate to actual Normals from actual to intermediate Vectors from center of intermediate actual intermediate Guoying Zhao 21 / 73
22 Aliasing Point sampling of the texture can lead to aliasing errors miss blue stripes point samples in u,v (or x,y,z) space point samples in texture space Guoying Zhao 22 / 73
23 Area Averaging A better but slower option is to use area averaging preimage pixel Note that preimage of pixel is curved Guoying Zhao 23 / 73
24 OpenGL Texture Mapping Guoying Zhao 24 / 73
25 Objectives Introduce the OpenGL texture functions and options Guoying Zhao 25 / 73
26 Basic Stragegy Three steps to applying a texture 1. specify the texture read or generate image assign to texture enable texturing 2. assign texture coordinates to vertices Proper mapping function is left to application 3. specify texture parameters wrapping, filtering Guoying Zhao 26 / 73
27 Texture Mapping y z x geometry display t image s Guoying Zhao 27 / 73
28 Texture Example The texture (below) is a 256 x 256 image that has been mapped to a rectangular polygon which is viewed in perspective Guoying Zhao 28 / 73
29 Texture Mapping and the OpenGL Pipeline Images and geometry flow through separate pipelines that join at the rasterizer complex textures do not affect geometric complexity vertices image geometry pipeline pixel pipeline rasterizer Guoying Zhao 29 / 73
30 Specifying a Texture Image Define a texture image from an array of texels (texture elements) in CPU memory Glubyte my_texels[512][512]; Define as any other pixel map Scanned image Generate by application code Enable texture mapping glenable(gl_texture_2d) OpenGL supports 1-4 dimensional texture maps Guoying Zhao 30 / 73
31 Define Image as a Texture glteximage2d( target, level, components, w, h, border, format, type, texels ); target: type of texture, e.g. GL_TEXTURE_2D level: used for mipmapping (discussed later) components: elements per texel w, h: width and height of texels in pixels border: used for smoothing (discussed later) format and type: describe texels texels: pointer to texel array glteximage2d(gl_texture_2d, 0, 3, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, my_texels); Guoying Zhao 31 / 73
32 Converting A Texture Image OpenGL requires texture dimensions to be powers of 2 If dimensions of image are not powers of 2 gluscaleimage( format, w_in, h_in, type_in, *data_in, w_out, h_out, type_out, *data_out ); data_in is source image data_out is for destination image Image interpolated and filtered during scaling Guoying Zhao 32 / 73
33 Mapping a Texture Based on parametric texture coordinates gltexcoord*() specified at each vertex t 0, 1 Texture Space a 1, 1 Object Space (s, t) = (0.2, 0.8) A b 0, 0 1, 0 c s (0.4, 0.2) B C (0.8, 0.4) Guoying Zhao 33 / 73
34 Typical Code glbegin(gl_polygon); glcolor3f(r0, g0, b0); //if no shading used glnormal3f(u0, v0, w0); // if shading used gltexcoord2f(s0, t0); glvertex3f(x0, y0, z0); glcolor3f(r1, g1, b1); glnormal3f(u1, v1, w1); gltexcoord2f(s1, t1); glvertex3f(x1, y1, z1);.. glend(); Note that we can use vertex arrays to increase efficiency Guoying Zhao 34 / 73
35 Interpolation OpenGL uses interpolation to find proper texels from specified texture coordinates Can be distortions good selection of tex coordinates poor selection of tex coordinates texture stretched over trapezoid showing effects of bilinear interpolation Guoying Zhao 35 / 73
36 Texture Parameters OpenGL has a variety of parameters that determine how texture is applied Wrapping parameters determine what happens if s and t are outside the (0,1) range Filter modes allow us to use area averaging instead of point samples Mipmapping allows us to use textures at multiple resolutions Environment parameters determine how texture mapping interacts with shading Guoying Zhao 36 / 73
37 Wrapping Mode Clamping: if s,t > 1 use 1, if s,t <0 use 0 Wrapping: use s,t modulo 1 gltexparameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP ) gltexparameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ) t texture s GL_REPEAT wrapping GL_CLAMP wrapping Guoying Zhao 37 / 73
38 Magnification and Minification More than one pixel can cover a texel (magnification) or more than one texel can cover a pixel (minification) or Can use point sampling (nearest texel) or linear filtering ( 2 x 2 filter) to obtain texture values Texture Magnification Polygon Texture Minification Polygon Guoying Zhao 38 / 73
39 Filter Modes Modes determined by gltexparameteri( target, type, mode ) gltexparameteri(gl_texture_2d, GL_TEXURE_MAG_FILTER, GL_NEAREST); gltexparameteri(gl_texture_2d, GL_TEXURE_MIN_FILTER, GL_LINEAR); Note that linear filtering requires a border of an extra texel for filtering at edges (border = 1) Guoying Zhao 39 / 73
40 Mipmapped Textures Mipmapping allows for prefiltered texture maps of decreasing resolutions Lessens interpolation errors for smaller textured objects Declare mipmap level during texture definition glteximage2d(gl_texture_*d, level, ) GLU mipmap builder routines will build all the textures from a given image glubuild*dmipmaps( ) Guoying Zhao 40 / 73
41 Calculating mipmap level Calculate mipmap level so that a unit step in pixels corresponds to a unit step in texels ( ( ) 2 ( ) 2 ( ) 2 ( ) 2 ) u x + v x u y + v y log 2 max, If you move one step in x (screen), how many steps do you move in u direction along the texture? How many levels do you have to filter down by factors of two so that distances on screen and texture space match? If you move one step in y (screen), how many steps do you move in some direction along the texture? Guoying Zhao 41 / 73
42 Example of mipmap level calculation Environment map on a teapot Approximately 9 texels will contribute to 1 pixel Get the texels from levels surrounding 9:1, that is, from level 1 (4:1) and 2 (16:1) Linearly interpolate those Guoying Zhao 42 / 73
43 point sampling Example linear filtering mipmapped point sampling mipmapped linear filtering Guoying Zhao 43 / 73
44 Quality vs. time The cheapest filtering is no filtering just do point sampling, that is, choose the texel that is nearest to current the pixel The next cheapest is to use prefiltering choose the closest mipmap level, perform point sampling there The next one is to do bilinear interpolation can actually do for both minification and magnification need to fetch 4 texels => more memory accesses => slower Combine nearest mipmap and bilinear interpolation a bit more calculation, again fetch 4 texels Trilinear filtering gives best results, but has the highest cost calculate mipmap, do bilinear filtering on both, then linear need to fetch 8 texels, big burden on memory bandwidth! Guoying Zhao 44 / 73
45 Texture Functions Controls how texture is applied gltexenv{fi}[v]( GL_TEXTURE_ENV, prop, param ) GL_TEXTURE_ENV_MODE modes GL_MODULATE: modulates with computed shade GL_BLEND: blends with an environmental color GL_REPLACE: use only texture color GL(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); Set blend color with GL_TEXTURE_ENV_COLOR Guoying Zhao 45 / 73
46 Perspective Correction Hint Texture coordinate and color interpolation either linearly in screen space or using depth/perspective values (slower) Noticeable for polygons on edge glhint( GL_PERSPECTIVE_CORRECTION_HINT, hint) ) where hint is one of GL_DONT_CARE GL_NICEST GL_FASTEST Guoying Zhao 46 / 73
47 Generating Texture Coordinates OpenGL can generate texture coordinates automatically gltexgen{ifd}[v]() specify a plane generate texture coordinates based upon distance from the plane generation modes GL_OBJECT_LINEAR GL_EYE_LINEAR GL_SPHERE_MAP (used for environmental maps) Guoying Zhao 47 / 73
48 Texture Objects Texture is part of the OpenGL state If we have different textures for different objects, OpenGL will be moving large amounts data from processor memory to texture memory Recent versions of OpenGL have texture objects one image per texture object Texture memory can hold multiple texture objects Guoying Zhao 48 / 73
49 Applying Textures II 1. specify textures in texture objects 2. set texture filter 3. set texture function 4. set texture wrap mode 5. set optional perspective correction hint 6. bind texture object 7. enable texturing 8. supply texture coordinates for vertex coordinates can also be generated Guoying Zhao 49 / 73
50 Environment Maps Other Texture Features Start with image of environment through a wide angle lens Can be either a real scanned image or an image created in OpenGL Use this texture to generate a spherical map Use automatic texture coordinate generation Multitexturing Apply a sequence of textures through cascaded texture units Guoying Zhao 50 / 73
51 Compositing and Blending Guoying Zhao 51 / 73
52 Objectives Learn to use the A component in RGBA color for Blending for translucent surfaces Compositing images Antialiasing Guoying Zhao 52 / 73
53 Opacity and Transparency Opaque surfaces permit no light to pass through Transparent surfaces permit all light to pass Translucent surfaces pass some light translucency = 1 opacity (α) opaque surface α =1 Guoying Zhao 53 / 73
54 The alpha channel In addition to RGB, we store an alpha value for every pixel the set of alpha values for an image is called the alpha channel Two interpretations for α coverage: how large portion of a pixel is covered opaqueness: how much light is blocked to pass through a pixel (opaqueness = 1-transparency) Values transparent / no coverage when α = 0 opaque / full coverage when α = 1 otherwise partially transparent / covered Relationship between α and RGB: computed at same time need comparable resolution can manipulate in almost exactly the same way coverage transparency Guoying Zhao 54 / 73
55 Physical Models Dealing with translucency in a physically correct manner is difficult due to the complexity of the internal interactions of light and matter Using a pipeline renderer Guoying Zhao 55 / 73
56 Writing Model Use A component of RGBA (or RGBα) color to store opacity During rendering we can expand our writing model to use RGBA values source blending factor source component destination blending factor blend Color Buffer destination component Guoying Zhao 56 / 73
57 Blending Equation We can represent source and destination pixels with the four-element (RGBA) arrays: s = [s r, s g, s b, s α ] d = [d r, d g, d b, d α ] Suppose that the source and destination blending factors are b = [b r, b g, b b, b α ] c = [c r, c g, c b, c α ] Blend as d = [b r s r + c r d r, b g s g + c g d g, b b s b + c b d b, b α s α + c α d α ] Guoying Zhao 57 / 73
58 Source (Rs, Gs, Bs, As) the new value Destination (Rd, Gd, Bd, Ad) in the frame buffer Blending factors (Sr, Sg, Sb, Sa) (Dr, Dg, Db, Da) Result multiply with factors, add How does blending work? source color * factor Rs Gs Bs As Sr Sg Sb Sa destination color * factor Rd Gd Bd Ad Dr Dg Db Da + = (Rs Sr, Gs Sg, Bs Sb, As Sa) + (Rd Dr, Gd Dg, Bd Db, Ad Da) = (Rs Sr+Rd Dr, Gs Sg+Gd Dg, Bs Sb+Bd Db, As Sa+Ad Da) R G B A Guoying Zhao 58 / 73
59 OpenGL Blending and Compositing Must enable blending and pick source and destination factors glenable(gl_blend) glblendfunc(source_factor, destination_factor) Only certain factors supported GL_ZERO, GL_ONE GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA See Redbook for complete list Guoying Zhao 59 / 73
60 Example Suppose that we start with the opaque background color (R 0,G 0,B 0,1) This color becomes the initial destination color We now want to blend in a translucent polygon with color (R 1,G 1,B 1,α 1 ) Select GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA as the source and destination blending factors R 1 = α 1 R 1 +(1- α 1 ) R 0, Note this formula is correct if polygon is either opaque or transparent Guoying Zhao 60 / 73
61 Blend 2 images 50% : 50% Blending examples draw first image with src factor GL_ONE (1,1,1,1) dst factor GL_ZERO (0,0,0,0) draw the second image with an alpha of.5 src factor GL_SRC_ALPHA (.5,.5,.5,.5) dst factor GL_SRC_ALPHA (.5,.5,.5,.5) Blend 2 images 75% : 25% draw first image with src factor GL_ONE (1,1,1,1) dst factor GL_ZERO (0,0,0,0) draw the second image with an alpha of.25 src factor GL_SRC_ALPHA (.25,.25,.25,.25) dst factor GL_ONE_MINUS_SRC_ALPHA (.75,.75,.75,.75) Guoying Zhao 61 / 73
62 Clamping and Accuracy All the components (RGBA) are clamped and stay in the range (0,1) However, in a typical system, RGBA values are only stored to 8 bits Can easily loose accuracy if we add many components together Example: add together n images Divide all color components by n to avoid clamping Blend with source factor = 1, destination factor = 1 But division by n loses bits Guoying Zhao 62 / 73
63 Order Dependency Is this image correct? Probably not Polygons are rendered in the order they pass down the pipeline Blending functions are order dependent Guoying Zhao 63 / 73
64 Opaque and Translucent Polygons Suppose that we have a group of polygons some of which are opaque and some translucent How do we use hidden-surface removal? Opaque polygons block all polygons behind them and affect the depth buffer Translucent polygons should not affect depth buffer Render with gldepthmask(gl_false) which makes depth buffer read-only Sort polygons first to remove order dependency Guoying Zhao 64 / 73
65 Fog We can composite with a fixed color and have the blending factors depend on depth Simulates a fog effect Blend source color C s and fog color C f by C s =f C s + (1-f) C f f is the fog factor Exponential Gaussian Linear (depth cueing) Guoying Zhao 65 / 73
66 Fog Functions Guoying Zhao 66 / 73
67 GLfloat fcolor[4] = { }: OpenGL Fog Functions glenable(gl_fog); glfogf(gl_fog_mode, GL_EXP); glfogf(gl_fog_density, 0.5); glfogv(gl_fog, fcolor); Guoying Zhao 67 / 73
68 Line Aliasing Ideal raster line is one pixel wide All line segments, other than vertical and horizontal segments, partially cover pixels Simple algorithms color only whole pixels Lead to the jaggies or aliasing Similar issue for polygons Guoying Zhao 68 / 73
69 Antialiasing Can try to color a pixel by adding a fraction of its color to the frame buffer Fraction depends on percentage of pixel covered by fragment Fraction depends on whether there is overlap no overlap overlap Guoying Zhao 69 / 73
70 Area Averaging Use average area α 1 +α 2 -α 1 α 2 as blending factor Guoying Zhao 70 / 73
71 OpenGL Antialiasing Can enable separately for points, lines, or polygons glenable(gl_point_smooth); glenable(gl_line_smooth); glenable(gl_polygon_smooth); glenable(gl_blend); glblendfunc(gl_src_alpha, GL_ONE_MINUS_SRC_ALPHA); Guoying Zhao 71 / 73
72 Accumulation Buffer Compositing and blending are limited by resolution of the frame buffer Typically 8 bits per color component The accumulation buffer is a high resolution buffer (16 or more bits per component) that avoids this problem Write into it or read from it with a scale factor Slower than direct compositing into the frame buffer Guoying Zhao 72 / 73
73 Applications Compositing Image Filtering (convolution) Whole scene antialiasing Motion effects Guoying Zhao 73 / 73
CS212. OpenGL Texture Mapping and Related
CS212 OpenGL Texture Mapping and Related Basic Strategy Three steps to applying a texture 1. specify the texture read or generate image assign to texture enable texturing 2. assign texture coordinates
More informationObjectives. Texture Mapping and NURBS Week 7. The Limits of Geometric Modeling. Modeling an Orange. Three Types of Mapping. Modeling an Orange (2)
CS 480/680 INTERACTIVE COMPUTER GRAPHICS Texture Mapping and NURBS Week 7 David Breen Department of Computer Science Drexel University Objectives Introduce Mapping Methods Texture Mapping Environmental
More informationOpenGL Texture Mapping. Objectives Introduce the OpenGL texture functions and options
OpenGL Texture Mapping Objectives Introduce the OpenGL texture functions and options 1 Basic Strategy Three steps to applying a texture 1. 2. 3. specify the texture read or generate image assign to texture
More informationTexture Mapping. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science
Texture Mapping CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce Mapping Methods - Texture Mapping - Environment Mapping - Bump Mapping Consider
More informationDiscrete Techniques. 11 th Week, Define a buffer by its spatial resolution (n m) and its depth (or precision) k, the number of
Discrete Techniques 11 th Week, 2010 Buffer Define a buffer by its spatial resolution (n m) and its depth (or precision) k, the number of bits/pixel Pixel OpenGL Frame Buffer OpenGL Buffers Color buffers
More informationBuffers. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015
Buffers 1 Objectives Introduce additional WebGL buffers Reading and writing buffers Buffers and Images 2 Buffer Define a buffer by its spatial resolution (n x m) and its depth (or precision) k, the number
More informationCS335 Graphics and Multimedia. Slides adopted from OpenGL Tutorial
CS335 Graphics and Multimedia Slides adopted from OpenGL Tutorial Texture Poly. Per Vertex Mapping CPU DL Texture Raster Frag FB Pixel Apply a 1D, 2D, or 3D image to geometric primitives Uses of Texturing
More informationCSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science
CSC 307 1.0 Graphics Programming Department of Statistics and Computer Science Graphics Programming Texture Mapping 2 Texture Poly. Per Vertex Mapping CPU DL Pixel Texture Raster Frag FB Apply a 1D, 2D,
More informationBuffers, Textures, Compositing, and Blending. Overview. Buffers. David Carr Virtual Environments, Fundamentals Spring 2005 Based on Slides by E.
INSTITUTIONEN FÖR SYSTEMTEKNIK LULEÅ TEKNISKA UNIVERSITET Buffers, Textures, Compositing, and Blending David Carr Virtual Environments, Fundamentals Spring 2005 Based on Slides by E. Angel Compositing,
More informationCISC 3620 Lecture 7 Lighting and shading. Topics: Exam results Buffers Texture mapping intro Texture mapping basics WebGL texture mapping
CISC 3620 Lecture 7 Lighting and shading Topics: Exam results Buffers Texture mapping intro Texture mapping basics WebGL texture mapping Exam results Grade distribution 12 Min: 26 10 Mean: 74 8 Median:
More informationComputer Graphics. Bing-Yu Chen National Taiwan University
Computer Graphics Bing-Yu Chen National Taiwan University Introduction to OpenGL General OpenGL Introduction An Example OpenGL Program Drawing with OpenGL Transformations Animation and Depth Buffering
More informationCS 5600 Spring
Objectives From: Ed Angel University of New Mexico Introduce Mapping Methods - - Environment Mapping -Bump Mapping Consider basic strategies - Forward vs backward mapping - Point sampling vs area averaging
More informationMost device that are used to produce images are. dots (pixels) to display the image. This includes CRT monitors, LCDs, laser and dot-matrix
Scan Conversion of Lines Raster devices Most device that are used to produce images are raster devices, that is, use rectangular arrays of dots (pixels) to display the image. This includes CRT monitors,
More informationLecture 19: OpenGL Texture Mapping. CITS3003 Graphics & Animation
Lecture 19: OpenGL Texture Mapping CITS3003 Graphics & Animation E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 Objectives Introduce the OpenGL texture functions and options
More informationGraphics. Texture Mapping 고려대학교컴퓨터그래픽스연구실.
Graphics Texture Mapping 고려대학교컴퓨터그래픽스연구실 3D Rendering Pipeline 3D Primitives 3D Modeling Coordinates Model Transformation 3D World Coordinates Lighting 3D World Coordinates Viewing Transformation 3D Viewing
More informationImaging and Raster Primitives
Realtime 3D Computer Graphics & Virtual Reality Bitmaps and Textures Imaging and Raster Primitives Vicki Shreiner Imaging and Raster Primitives Describe OpenGL s raster primitives: bitmaps and image rectangles
More informationCS 432 Interactive Computer Graphics
CS 432 Interactive Computer Graphics Lecture 09 Part 1 Compositing and Anti-Aliasing Matt Burlick - Drexel University - CS432 1 Composite Techniques Compositing is the method of compositing an image from
More informationSurface Rendering. Surface Rendering
Surface Rendering Surface Rendering Introduce Mapping Methods - Texture Mapping - Environmental Mapping - Bump Mapping Go over strategies for - Forward vs backward mapping 2 1 The Limits of Geometric Modeling
More informationCS452/552; EE465/505. Texture Mapping in WebGL
CS452/552; EE465/505 Texture Mapping in WebGL 2-26 15 Outline! Texture Mapping in WebGL Read: Angel, Chapter 7, 7.3-7.5 LearningWebGL lesson 5: http://learningwebgl.com/blog/?p=507 Lab3 due: Monday, 3/2
More informationGRAFIKA KOMPUTER. ~ M. Ali Fauzi
GRAFIKA KOMPUTER ~ M. Ali Fauzi Texture Mapping WHY TEXTURE? Imagine a Chess Floor Or a Brick Wall How to Draw? If you want to draw a chess floor, each tile must be drawn as a separate quad. A large flat
More informationIntroduction to Computer Graphics with WebGL
1 Introduction to Computer Graphics with WebGL Ed Angel Lighting in WebGL WebGL lighting Application must specify - Normals - Material properties - Lights State-based shading functions have been deprecated
More informationPixels and Buffers. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science
Pixels and Buffers CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce additional OpenGL buffers Learn to read from / write to buffers Introduce
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 informationLecture 5. Scan Conversion Textures hw2
Lecture 5 Scan Conversion Textures hw2 Announcements Homework deadlines Mini Project Proposals due June 26th E.T. 06 Vector Graphics Algebraic equations describe shapes. Can render type and large areas
More informationLecture 07: Buffers and Textures
Lecture 07: Buffers and Textures CSE 40166 Computer Graphics Peter Bui University of Notre Dame, IN, USA October 26, 2010 OpenGL Pipeline Today s Focus Pixel Buffers: read and write image data to and from
More informationTexturas. Objectives. ! Introduce Mapping Methods. ! Consider two basic strategies. Computação Gráfica
Texturas Computação Gráfica Objectives! Introduce Mapping Methods! Texture Mapping! Environmental Mapping! Bump Mapping! Light Mapping! Consider two basic strategies! Manual coordinate specification! Two-stage
More informationTexture Mapping. Mike Bailey.
Texture Mapping 1 Mike Bailey mjb@cs.oregonstate.edu This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License TextureMapping.pptx The Basic Idea
More informationRasterization Computer Graphics I Lecture 14. Scan Conversion Antialiasing Compositing [Angel, Ch , ]
15-462 Computer Graphics I Lecture 14 Rasterization March 13, 2003 Frank Pfenning Carnegie Mellon University http://www.cs.cmu.edu/~fp/courses/graphics/ Scan Conversion Antialiasing Compositing [Angel,
More informationCSE 167: Introduction to Computer Graphics Lecture #8: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016
CSE 167: Introduction to Computer Graphics Lecture #8: Textures Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016 Announcements Project 2 due this Friday Midterm next Tuesday
More informationTexture Mapping and Sampling
Texture Mapping and Sampling CPSC 314 Wolfgang Heidrich The Rendering Pipeline Geometry Processing Geometry Database Model/View Transform. Lighting Perspective Transform. Clipping Scan Conversion Depth
More informationCS 432 Interactive Computer Graphics
CS 432 Interactive Computer Graphics Lecture 7 Part 2 Texture Mapping in OpenGL Matt Burlick - Drexel University - CS 432 1 Topics Texture Mapping in OpenGL Matt Burlick - Drexel University - CS 432 2
More informationCap. 3 Textures. Mestrado em Engenharia Informática (6931) 1º ano, 1º semestre
Cap. 3 Textures Mestrado em Engenharia Informática (6931) 1º ano, 1º semestre Overview Objectives Notion of texture Motivation Texture mapping, texture patterns, and texels Mapping textures to polygons,
More informationLecture 22 Sections 8.8, 8.9, Wed, Oct 28, 2009
s The s Lecture 22 Sections 8.8, 8.9, 8.10 Hampden-Sydney College Wed, Oct 28, 2009 Outline s The 1 2 3 4 5 The 6 7 8 Outline s The 1 2 3 4 5 The 6 7 8 Creating Images s The To create a texture image internally,
More informationINF3320 Computer Graphics and Discrete Geometry
INF3320 Computer Graphics and Discrete Geometry Texturing Christopher Dyken Martin Reimers 06.10.2010 Page 1 Texturing Linear interpolation Real Time Rendering: Chapter 5: Visual Appearance Chapter 6:
More informationAnnouncements. Written Assignment 2 is out see the web page. Computer Graphics
Announcements Written Assignment 2 is out see the web page 1 Texture and other Mappings Shadows Texture Mapping Bump Mapping Displacement Mapping Environment Mapping Watt Chapter 8 COMPUTER GRAPHICS 15-462
More informationTexture Mapping and Special Effects
Texture Mapping and Special Effects February 23 rd 26 th 2007 MAE 410-574, Virtual Reality Applications and Research Instructor: Govindarajan Srimathveeravalli HW#5 Due March 2 nd Implement the complete
More informationCSE 167: Introduction to Computer Graphics Lecture #7: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018
CSE 167: Introduction to Computer Graphics Lecture #7: Textures Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018 Announcements Project 2 due this Friday at 2pm Grading in
More informationCSE 167: Lecture 11: Textures 2. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011
CSE 167: Introduction to Computer Graphics Lecture 11: Textures 2 Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011 Announcements Homework assignment #5 due Friday, Nov 4,
More informationINF3320 Computer Graphics and Discrete Geometry
INF3320 Computer Graphics and Discrete Geometry Texturing Christopher Dyken Martin Reimers 06.10.2010 Page 1 Texturing Linear interpolation Real Time Rendering: Chapter 5: Visual Appearance Chapter 6:
More informationLecture 5 3D graphics part 3
Lecture 5 3D graphics part 3 Shading; applying lighting Surface detail: Mappings Texture mapping Light mapping Bump mapping Surface detail Shading: takes away the surface detail of the polygons Texture
More informationCT5510: Computer Graphics. Texture Mapping
CT5510: Computer Graphics Texture Mapping BOCHANG MOON Texture Mapping Simulate spatially varying surface properties Phong illumination model is coupled with a material (e.g., color) Add small polygons
More informationTexture mapping. Computer Graphics CSE 167 Lecture 9
Texture mapping Computer Graphics CSE 167 Lecture 9 CSE 167: Computer Graphics Texture Mapping Overview Interpolation Wrapping Texture coordinates Anti aliasing Mipmaps Other mappings Including bump mapping
More informationCSE 167: Introduction to Computer Graphics Lecture #9: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013
CSE 167: Introduction to Computer Graphics Lecture #9: Textures Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013 Announcements Added Tuesday office hours for Krishna: 11am-12
More informationComputational Strategies
Computational Strategies How can the basic ingredients be combined: Image Order Ray casting (many options) Object Order (in world coordinate) splatting, texture mapping Combination (neither) Shear warp,
More informationTextures. Texture Mapping. Bitmap Textures. Basic Texture Techniques
Texture Mapping Textures The realism of an image is greatly enhanced by adding surface textures to the various faces of a mesh object. In part a) images have been pasted onto each face of a box. Part b)
More informationToday. Texture mapping in OpenGL. Texture mapping. Basic shaders for texturing. Today. Computergrafik
Computergrafik Today Basic shader for texture mapping Texture coordinate assignment Antialiasing Fancy textures Matthias Zwicker Universität Bern Herbst 2009 Texture mapping Glue textures (images) onto
More informationFog example. Fog is atmospheric effect. Better realism, helps determine distances
Fog example Fog is atmospheric effect Better realism, helps determine distances Fog Fog was part of OpenGL fixed function pipeline Programming fixed function fog Parameters: Choose fog color, fog model
More informationTexture Mapping CSCI 4229/5229 Computer Graphics Fall 2016
Texture Mapping CSCI 4229/5229 Computer Graphics Fall 2016 What are texture maps? Bitmap images used to assign fine texture to displayed surfaces Used to make surfaces appear more realistic Must move with
More informationCMSC 425: Lecture 12 Texture Mapping Thursday, Mar 14, 2013
CMSC 425: Lecture 12 Texture Mapping Thursday, Mar 14, 2013 Surface Detail: We have discussed the use of lighting as a method of producing more realistic images. This is fine for smooth surfaces of uniform
More informationTexture and other Mappings
Texture and other Mappings Texture Mapping Bump Mapping Displacement Mapping Environment Mapping Example: Checkerboard Particularly severe problems in regular textures 1 The Beginnings of a Solution: Mipmapping
More informationComputergrafik. Matthias Zwicker Universität Bern Herbst 2016
Computergrafik Matthias Zwicker Universität Bern Herbst 2016 2 Today Basic shader for texture mapping Texture coordinate assignment Antialiasing Fancy textures 3 Texture mapping Glue textures (images)
More informationCSE 167: Introduction to Computer Graphics Lecture #8: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017
CSE 167: Introduction to Computer Graphics Lecture #8: Textures Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017 Announcements Project 2 is due this Friday at 2pm Next Tuesday
More information三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒
三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒 1 In this chapter, you will learn The basics of texture mapping Texture coordinates Texture objects and texture binding Texture specification
More informationBuffers and Processing Fragments
Buffers and Processing Fragments 2017 Autumn Animação e Visualização Tridimensional 2017/2018 1 OGL Framebuffer Color Buffers: (front back)- (left right) Depth Buffer Stencil Buffer 2 Buffers Intro Buffer
More information+ = Texturing: Glue n-dimensional images onto geometrical objects. Texturing. Texture magnification. Texture coordinates. Bilinear interpolation
Texturing Slides done bytomas Akenine-Möller and Ulf Assarsson Chalmers University of Technology Texturing: Glue n-dimensional images onto geometrical objects Purpose: more realism, and this is a cheap
More informationTexturing. Slides done bytomas Akenine-Möller and Ulf Assarsson Department of Computer Engineering Chalmers University of Technology
Texturing Slides done bytomas Akenine-Möller and Ulf Assarsson Department of Computer Engineering Chalmers University of Technology 1 Texturing: Glue n-dimensional images onto geometrical objects l Purpose:
More informationTexturing Theory. Overview. All it takes is for the rendered image to look right. -Jim Blinn 11/10/2018
References: Real-Time Rendering 3 rd Edition Chapter 6 Texturing Theory All it takes is for the rendered image to look right. -Jim Blinn Overview Introduction The Texturing Pipeline Example The Projector
More informationImage Processing. CSCI 420 Computer Graphics Lecture 22
CSCI 42 Computer Graphics Lecture 22 Image Processing Blending Display Color Models Filters Dithering [Ch 7.13, 8.11-8.12] Jernej Barbic University of Southern California 1 Alpha Channel Frame buffer Simple
More informationImage Processing. Alpha Channel. Blending. Image Compositing. Blending Errors. Blending in OpenGL
CSCI 42 Computer Graphics Lecture 22 Image Processing Blending Display Color Models Filters Dithering [Ch 6, 7] Jernej Barbic University of Southern California Alpha Channel Frame buffer Simple color model:
More informationGrafica Computazionale
Grafica Computazionale lezione36 Informatica e Automazione, "Roma Tre" June 3, 2010 Grafica Computazionale: Lezione 33 Textures Introduction Steps in Texture Mapping A Sample Program Texturing algorithms
More informationComputer Graphics Texture Mapping
! Computer Graphics 2013! 13. Texture Mapping Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2013-10-28 About the final examination - Next Friday (Nov. 8th) Night, - 7:30PM - 9:00PM (one and
More informationCS 130 Final. Fall 2015
CS 130 Final Fall 2015 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 informationShading. Flat shading Gouraud shading Phong shading
Shading Flat shading Gouraud shading Phong shading Flat Shading and Perception Lateral inhibition: exaggerates perceived intensity Mach bands: perceived stripes along edges Icosahedron with Sphere Normals
More informationก ก ก.
418382 ก ก ก ก 5 pramook@gmail.com TEXTURE MAPPING Textures Texture Object An OpenGL data type that keeps textures resident in memory and provides identifiers
More informationCS179: GPU Programming
CS179: GPU Programming Lecture 4: Textures Original Slides by Luke Durant, Russel McClellan, Tamas Szalay Today Recap Textures What are textures? Traditional uses Alternative uses Recap Our data so far:
More informationTextures. Texture coordinates. Introduce one more component to geometry
Texturing & Blending Prof. Aaron Lanterman (Based on slides by Prof. Hsien-Hsin Sean Lee) School of Electrical and Computer Engineering Georgia Institute of Technology Textures Rendering tiny triangles
More informationOverview. Goals. MipMapping. P5 MipMap Texturing. What are MipMaps. MipMapping in OpenGL. Generating MipMaps Filtering.
Overview What are MipMaps MipMapping in OpenGL P5 MipMap Texturing Generating MipMaps Filtering Alexandra Junghans junghana@student.ethz.ch Advanced Filters You can explain why it is a good idea to use
More informationWorkshop 3D capture, modelling and augmented reality Capture 3D, modélisation et réalité augmentée
International Master Program «Biometrics» Workshop sessions Workshop 3D capture, modelling and augmented reality Capture 3D, modélisation et réalité augmentée Jean-Marc Vézien (LIMSI-CNRS, équipe VENISE)
More informationCHAPTER 1 Graphics Systems and Models 3
?????? 1 CHAPTER 1 Graphics Systems and Models 3 1.1 Applications of Computer Graphics 4 1.1.1 Display of Information............. 4 1.1.2 Design.................... 5 1.1.3 Simulation and Animation...........
More information3D Rasterization II COS 426
3D Rasterization II COS 426 3D Rendering Pipeline (for direct illumination) 3D Primitives Modeling Transformation Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation
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 informationQUESTION 1 [10] 2 COS340-A October/November 2009
2 COS340-A QUESTION 1 [10] a) OpenGL uses z-buffering for hidden surface removal. Explain how the z-buffer algorithm works and give one advantage of using this method. (5) Answer: OpenGL uses a hidden-surface
More informationAssignment #5: Scalar Field Visualization 3D: Direct Volume Rendering
Assignment #5: Scalar Field Visualization 3D: Direct Volume Rendering Goals: Due October 4 th, before midnight This is the continuation of Assignment 4. The goal is to implement a simple DVR -- 2D texture-based
More informationLets assume each object has a defined colour. Hence our illumination model is looks unrealistic.
Shading Models There are two main types of rendering that we cover, polygon rendering ray tracing Polygon rendering is used to apply illumination models to polygons, whereas ray tracing applies to arbitrary
More informationChapter IV Fragment Processing and Output Merging. 3D Graphics for Game Programming
Chapter IV Fragment Processing and Output Merging Fragment Processing The per-fragment attributes may include a normal vector, a set of texture coordinates, a set of color values, a depth, etc. Using these
More informationCSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2014
CSE 167: Introduction to Computer Graphics Lecture #6: Lights Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2014 Announcements Project 2 due Friday, Oct. 24 th Midterm Exam
More informationShading/Texturing. Dr. Scott Schaefer
Shading/Texturing Dr. Scott Schaefer Problem / Problem / Problem 4/ Problem / Problem / Shading Algorithms Flat Shading Gouraud Shading Phong Shading / Flat Shading Apply same color across entire polygon
More informationCPSC / Texture Mapping
CPSC 599.64 / 601.64 Introduction and Motivation so far: detail through polygons & materials example: brick wall problem: many polygons & materials needed for detailed structures inefficient for memory
More informationReview of Tuesday. ECS 175 Chapter 3: Object Representation
Review of Tuesday We have learnt how to rasterize lines and fill polygons Colors (and other attributes) are specified at vertices Interpolation required to fill polygon with attributes 26 Review of Tuesday
More informationCS4621/5621 Fall Basics of OpenGL/GLSL Textures Basics
CS4621/5621 Fall 2015 Basics of OpenGL/GLSL Textures Basics Professor: Kavita Bala Instructor: Nicolas Savva with slides from Balazs Kovacs, Eston Schweickart, Daniel Schroeder, Jiang Huang and Pramook
More informationComputer Graphics. Lecture 8 Antialiasing, Texture Mapping
Computer Graphics Lecture 8 Antialiasing, Texture Mapping Today Texture mapping Antialiasing Antialiasing-textures Texture Mapping : Why needed? Adding details using high resolution polygon meshes is costly
More informationProgramming Graphics Hardware
Tutorial 5 Programming Graphics Hardware Randy Fernando, Mark Harris, Matthias Wloka, Cyril Zeller Overview of the Tutorial: Morning 8:30 9:30 10:15 10:45 Introduction to the Hardware Graphics Pipeline
More informationDefinition. Blending & Compositing. Front & Back Buffers. Left & Right Buffers. Blending combines geometric objects. e.g.
Blending & Compositing COMP 3003 Autumn 2005 Definition Blending combines geometric objects e.g. transparency Compositing combines entire images multi-pass textures accumulating results Both depend on
More informationTexturing. Slides done by Tomas Akenine-Möller and Ulf Assarsson Department of Computer Engineering Chalmers University of Technology
Texturing Slides done by Tomas Akenine-Möller and Ulf Assarsson Department of Computer Engineering Chalmers University of Technology 1 Texturing: Glue n-dimensional images onto geometrical objects l Purpose:
More informationTexture Mapping. Texture (images) lecture 16. Texture mapping Aliasing (and anti-aliasing) Adding texture improves realism.
lecture 16 Texture mapping Aliasing (and anti-aliasing) Texture (images) Texture Mapping Q: Why do we need texture mapping? A: Because objects look fake and boring without it. Adding texture improves realism.
More informationlecture 16 Texture mapping Aliasing (and anti-aliasing)
lecture 16 Texture mapping Aliasing (and anti-aliasing) Texture (images) Texture Mapping Q: Why do we need texture mapping? A: Because objects look fake and boring without it. Adding texture improves realism.
More information-=Catmull's Texturing=1974. Part I of Texturing
-=Catmull's Texturing=1974 but with shaders Part I of Texturing Anton Gerdelan Textures Edwin Catmull's PhD thesis Computer display of curved surfaces, 1974 U.Utah Also invented the z-buffer / depth buffer
More informationScan line algorithm. Jacobs University Visualization and Computer Graphics Lab : Graphics and Visualization 272
Scan line algorithm The scan line algorithm is an alternative to the seed fill algorithm. It does not require scan conversion of the edges before filling the polygons It can be applied simultaneously to
More informationThe Application Stage. The Game Loop, Resource Management and Renderer Design
1 The Application Stage The Game Loop, Resource Management and Renderer Design Application Stage Responsibilities 2 Set up the rendering pipeline Resource Management 3D meshes Textures etc. Prepare data
More informationTEXTURE MAPPING. DVA338 Computer Graphics Thomas Larsson, Afshin Ameri
TEXTURE MAPPING DVA338 Computer Graphics Thomas Larsson, Afshin Ameri OVERVIEW Motivation Texture Mapping Coordinate Mapping (2D, 3D) Perspective Correct Interpolation Texture Filtering Mip-mapping Anisotropic
More informationComputergraphics Exercise 15/ Shading & Texturing
Computergraphics Exercise 15/16 3. Shading & Texturing Jakob Wagner for internal use only Shaders Vertex Specification define vertex format & data in model space Vertex Processing transform to clip space
More informationTexture Mapping 1/34
Texture Mapping 1/34 Texture Mapping Offsets the modeling assumption that the BRDF doesn t change in u and v coordinates along the object s surface Store a reflectance as an image called a texture Map
More informationLectures Transparency Case Study
Lectures Transparency Case Study By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma State University Rohnert Park, California 2004, Tom Duff and George Ledin Jr 1 How
More informationComputer Graphics - Week 7
Computer Graphics - Week 7 Bengt-Olaf Schneider IBM T.J. Watson Research Center Questions about Last Week? Comments about the Assignment Specific comments The clip volume does not need to be closed Rotate
More informationImage Processing. Blending. Blending in OpenGL. Image Compositing. Blending Errors. Antialiasing Revisited Computer Graphics I Lecture 15
15-462 Computer Graphics I Lecture 15 Image Processing Blending Display Color Models Filters Dithering Image Compression March 18, 23 Frank Pfenning Carnegie Mellon University http://www.cs.cmu.edu/~fp/courses/graphics/
More informationPipeline Operations. CS 4620 Lecture 10
Pipeline Operations CS 4620 Lecture 10 2008 Steve Marschner 1 Hidden surface elimination Goal is to figure out which color to make the pixels based on what s in front of what. Hidden surface elimination
More informationImage Processing Computer Graphics I Lecture 15
15-462 Computer Graphics I Lecture 15 Image Processing Blending Display Color Models Filters Dithering Image Compression March 18, 23 Frank Pfenning Carnegie Mellon University http://www.cs.cmu.edu/~fp/courses/graphics/
More informationC P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev
C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE UGRAD.CS.UBC.C A/~CS314 Mikhail Bessmeltsev 1 WHAT IS RENDERING? Generating image from a 3D scene 2 WHAT IS RENDERING? Generating image
More informationComputer Graphics: Programming, Problem Solving, and Visual Communication
Computer Graphics: Programming, Problem Solving, and Visual Communication Dr. Steve Cunningham Computer Science Department California State University Stanislaus Turlock, CA 95382 copyright 2002, Steve
More informationLSU EE Homework 3 Solution Due: 12 October 2015
LSU EE 4702 1 Homework 3 Solution Due: 12 October 2015 Problem 0: Follow the instruction on the http://www.ece.lsu.edu/koppel/gpup/proc.html page for account setup and programming homework work flow. Compile
More information