Fundamentals of Computer Graphics Part 9 Discrete Techniques prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared.

Slides:



Advertisements
Similar presentations
Hofstra University1 Texture Motivation: to model realistic objects need surface detail: wood grain, stone roughness, scratches that affect shininess, grass,
Advertisements

Graphics Pipeline.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Computer Graphics Bing-Yu Chen National Taiwan University.
Hofstra University1 Texture Motivation: to model realistic objects need surface detail: wood grain, stone roughness, scratches that affect shininess, grass,
Texture Mapping from Watt, Ch. 8 Jonathan Han. Topics Discussed Texture Map to Models Bump Maps, Light Maps Environment (Reflection) Mapping 3D Textures.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Texture Mapping.
Texture Mapping April 9, The Limits of Geometric Modeling Although graphics cards can render over 10 million polygons per second, that number.
OpenGL Texture Mapping
University of New Mexico
OpenGL Texture Mapping Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Texture Mapping Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
OpenGL Texture Mapping April 16, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Basic Stragegy Three steps to applying a texture.
CS 4731: Computer Graphics Lecture 17: Texturing Emmanuel Agu.
Texture Mapping A way of adding surface details Two ways can achieve the goal:  Surface detail polygons: create extra polygons to model object details.
Texture Mapping. 2 The Limits of Geometric Modeling Although graphics cards can render over 10 million polygons per second, that number is insufficient.
Texture Mapping. To add surface details… World of Warcraft, Blizzard Inc. More polygons (slow and hard to handle small details) Less polygons but with.
Computer Graphics Texture Mapping Eriq Muhammad Adams
ECSE 4750: Computer Graphics Rensselaer Polytechnic Institute Nov 5, 2012 Texture and Texture Mapping.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
Texture Mapping. Scope Buffers Buffers Various of graphics image Various of graphics image Texture mapping Texture mapping.
Texture Mapping. Example Mappings Mapping Techniques Consider the problem of rendering a sphere in the examples The geometry is very simple - a sphere.
Texturing A picture is worth a thousand words. Texturing Texturing is the art of doing this with any picture to any model.  (This is Opus the Penguin.
Texture Mapping Course: Computer Graphics Presented by Fan Chen
Computer Graphics Ben-Gurion University of the Negev Fall 2012.
Mapping method Texture Mapping Environmental mapping (sphere mapping) (cube mapping)
Buffers Textures and more Rendering Paul Taylor & Barry La Trobe University 2009.
ECSE-4750 Computer Graphics Fall 2004 Prof. Michael Wozny TA. Abhishek Gattani TA. Stephen
Graphics Systems and OpenGL. Business of Generating Images Images are made up of pixels.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
OpenGL Conclusions OpenGL Programming and Reference Guides, other sources CSCI 6360/4360.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Texture Mapping. 2 Motivation A typical modern graphics card can handle 10s of millions of polygons a second. How many individual blades of grass are.
OpenGL Texture Mapping. 2 Objectives Introduce the OpenGL texture functions and options.
Texture Mapping Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
CS 480/680 Computer Graphics OpenGL Texture Mapping Dr. Frederick C Harris, Jr. Fall 2011.
1 Texture Mapping. 2 Texture Aliasing MIPmaps Environment Mapping Bump Mapping Displacement Mapping Shadow Maps Solid Textures Antialiasing.
Texture Mapping Software College, Shandong University Instructor: Zhou Yuanfeng
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CHAPTER 8 Color and Texture Mapping © 2008 Cengage Learning EMEA.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
Texture Mapping and NURBS Week 7 David Breen Department of Computer Science Drexel University Based on material from Ed Angel, University of New Mexico.
Texture Mapping. For Further Reading Angel 7 th Ed: ­Chapter 7: 7.3 ~ 7.9 Beginning WebGL: ­Chapter 3 2.
Mapping: Image Texturing CPSC 591/691. Texture Mapping Two-dimensional techniques place a two-dimensional (flat) image onto an object using methods similar.
1 Chapter 7 Texture Mapping. 2 The Limits of Geometric Modeling Although graphics cards can render over 10 million polygons per second, that number is.
CS425 © 2003 Ray S. Babcock Pixels and Bitmaps ● OpenGL allows us to work directly with bits and groups of bits, or pixels, which flow down a parallel.
University of New Mexico
Buffers and texture mapping
Texture Mapping.
Computer Graphics Texture Mapping
Madhulika (18010), Assistant Professor, LPU.
Introduction to Computer Graphics with WebGL
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
Texture Mapping We can improve the realism of graphics models by mapping a texture pattern (image) onto the modeled object surface. We refer to this technique.
OpenGL Texture Mapping
Graphics, Fall 2017 Lecture 24: Texture Mapping
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
OpenGL Texture Mapping
Introduction to Computer Graphics with WebGL
Texture Motivation: to model realistic objects need surface detail: wood grain, stone roughness, scratches that affect shininess, grass, wall paper. Use.
Introduction to Computer Graphics with WebGL
3D Game Programming Texture Mapping
OpenGL Texture Mapping
Texture Mapping Ed Angel Professor Emeritus of Computer Science
OpenGL Texture Mapping
Advanced Computer Graphics: Texture
Texture Mapping Ed Angel Professor Emeritus of Computer Science
OpenGL Texture Mapping
Presentation transcript:

Fundamentals of Computer Graphics Part 9 Discrete Techniques prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.: Interactive Computer Graphics – A Top Down Approach with OpenGL, Addison Wesley, 2001

Fundamentals of Computer Graphics2 Discrete techniques Polygons, lines and others primitives transformed, rasterized and displayed API enables major mapping texture mapping uses pattern to be put on a surface of an object bump mapping – smooth surface is distorted to get variation of the surface environmental mapping (reflection maps) – enables ray-tracing like output

Fundamentals of Computer Graphics3 Discrete techniques All three techniques rely on the map being stored as one-, two- or three-dimensional digital image (!!Texture mapping on a graphics card is limited!!) Causes ANTIALIASING errors buffer – a memory block with spatial resolution n x m and with k bits bitplane – single plane n x m with 1 bit only pixel – picture element

Fundamentals of Computer Graphics4 Texture Mapping Regular patterns are mapped to an object’s surface Two dimensional texture T(s,t) s, t – texture coordinates stored in texture memory as n x m array of texture elements - texels Texture map associate a unique point of T with each point on a geometric object – mapped to screen coordinates

Fundamentals of Computer Graphics5 Texture Mapping Difficulties: -mapping from texture to geometric coordinates -2D texture defined over a rectangular region in the texture space -> mapping to 3D region can be quite complex -rendering based on pixel-to-pixel approach – the inverse mapping from screen coordinates to texture coordinates is needed -because of shading – mapping areas-to-areas and not point-to- point is required -> antialising problems, moire patterns etc.

Fundamentals of Computer Graphics6 Texture Mapping pixel (x s, y s ) – corresponds to (x, y, z) on “curved” object problems with finding inverse mapping difficulties with mapping

Fundamentals of Computer Graphics7 Linear Mapping Most curved surfaces represented parametrically as p(u,v) = [x(u,v), y(u,v), z(u,v)] T a point in the texture map T(s,t) is to be mapped to a point on the surface p(u,v) by a linear map u = as + bt + c v = ds + et + f (if ae  bd mapping is invertible) -mapping is easy to use -it does not respect the curvature of the object

Fundamentals of Computer Graphics8 Linear Mapping Linear mapping is defined as: standard window-viewport approach.

Fundamentals of Computer Graphics9 Texture Mapping Two part mapping - steps 1.map the texture a simple 3D intermediate surface – cylinder cube, sphere etc. 2.the surface containing the mapped texture is mapped to the surface being rendered. Can be applied in geometric or parametric coordinates

Fundamentals of Computer Graphics10 Texture Mapping Suppose a cylinder x = r cos (2  u) y = r sin (2  u) z = v / h and u,v  (0,1) – then s = u & t = v we are able to map the texture WITHOUT distorting its shape for a sphere the Mercator projection can be used x = r cos (2  u) y = r sin (2  u) cos (2  v) z = r sin (2  u) sin (2  v)

Fundamentals of Computer Graphics11 Texture Mapping The second step is to map the texture values on the intermediate object to the desired surface Figure shows THREE possible strategies: texture value is projected on the surface in the normal direction inverse solution from the surface texture element is to be find according to the normal if the center of the object is known – intersection with intermediate surface is computed and texture value assigned

Fundamentals of Computer Graphics12 Texture Mapping in OpenGL OpenGL – many mapping options including 1D, 2D & 3D textures GLubyte my_texels [512][512]; /* generated somehow */ glTexImage2D(GL_TEXTURE, 0, 3, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, my_texels); /* 0 & 3 – level & components, 0 – border, format – see latter*/ glEnable(GL_TEXTURE_2D); /* enables texture mapping */

Fundamentals of Computer Graphics13 Texture Mapping in OpenGL 2D textures specification glTexImage2D(GL_TEXTURE, level, components, width, height, border, format, type, array); components (1 – 4 ) number of components RGBA to be affected with the map level & border – parameters for fine control

Fundamentals of Computer Graphics14 Texture Mapping in OpenGL glBegin(GL_QUAD); glTexCoord2f(0.0, 0.0); glVertex2f(x1, y1, z1); glTexCoord2f(1.0, 0.0); glVertex2f(x2, y2, z2); glTexCoord2f(0.0, 1.0); glVertex2f(x3, y3, z3); glTexCoord2f(1.0, 1.0); glVertex2f(x4, y4, z4); glEnd ( ); range of s, t changed to

Fundamentals of Computer Graphics15 Texture Mapping in OpenGL STOP HERE!!!