Texture Mapping May 4, 2006. Many slides are borrowed from UNC-CH COMP236 Course (Spring 2003) taught by Leonard McMillan

Slides:



Advertisements
Similar presentations
03/16/2009Dinesh Manocha, COMP770 Texturing Surface’s texture: its look & feel Graphics: a process that takes a surface and modifies its appearance using.
Advertisements

Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
Computer Graphics Bing-Yu Chen National Taiwan University.
Week 7 - Wednesday.  What did we talk about last time?  Transparency  Gamma correction  Started texturing.
Objectives Introduce OpenGL buffers and read/write Introduce OpenGL buffers and read/write Introduce texture mapping Introduce texture mapping Introduce.
Sampling, Aliasing, & Mipmaps
(conventional Cartesian reference system)
Rasterization May 14, Triangles Only We will discuss the rasterization of triangles only. Why? –Polygon can be decomposed into triangles. –A triangle.
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.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
Texture Mapping. 2 The Limits of Geometric Modeling Although graphics cards can render over 10 million polygons per second, that number is insufficient.
Computer Graphics Texture Mapping
1 9. Textures v Create the illusion of detail by wraping a complex image (texture) around a simple geometry –realism is increased without the need for.
Texture Mapping. Scope Buffers Buffers Various of graphics image Various of graphics image Texture mapping Texture mapping.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
Texture Mapping Course: Computer Graphics Presented by Fan Chen
An Interactive Introduction to OpenGL Programming Ed Angel
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
June 9, 2008 Dr. Haim Levkowitz IVPR/CS/UML | 1 Texture.
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
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
Computing & Information Sciences Kansas State University Lecture 10 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
Computer Graphics 2 Lecture 7: Texture Mapping Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
CSCI 440.  So far we have learned how to  build shapes  create movement  change views  add simple lights  But, our objects still look very cartoonish.
Texture Mapping and NURBS Week 7 David Breen Department of Computer Science Drexel University Based on material from Ed Angel, University of New Mexico.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Texture Mapping. For Further Reading Angel 7 th Ed: ­Chapter 7: 7.3 ~ 7.9 Beginning WebGL: ­Chapter 3 2.
2 3D Viewing Process  3D viewing process MC Model Space Model Transformation Model Transformation WC World Space Viewing Transformation Viewing Transformation.
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 12.
CSc4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Texture Mapping.
CS 376 Introduction to Computer Graphics 04 / 13 / 2007 Instructor: Michael Eckmann.
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.
Texturing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
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 cgvr.korea.ac.kr.
Graphics, Fall 2017 Lecture 24: Texture Mapping
Introduction to Computer Graphics with WebGL
Chapter 10: Computer Graphics
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
Interactive Graphics Algorithms Ying Zhu Georgia State University
Introduction to Computer Graphics with WebGL
3D Game Programming Texture Mapping
Texture Mapping Ed Angel Professor Emeritus of Computer Science
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Texture Mapping Ed Angel Professor Emeritus of Computer Science
3D Game Programming Texture Mapping
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
OpenGL Texture Mapping
Presentation transcript:

Texture Mapping May 4, 2006

Many slides are borrowed from UNC-CH COMP236 Course (Spring 2003) taught by Leonard McMillan comp/236/001/handouts.html comp/236/001/handouts.html

Compare the above with what we discussed previously… (Note the different meaning of s and t.)

Derivation of s and t Two end points P 1 =(x 1, y 1, z 1 ) and P 2 =(x 2, y 2, z 2 ). Let P 3 =(1-t)P 1 +(t)P 2 After projection, P 1, P 2, P 3 are projected to (x ’ 1, y ’ 1 ), (x ’ 2, y ’ 2 ), (x ’ 3, y ’ 3 ) in screen coordinates. Let (x ’ 3, y ’ 3 )=(1-s)(x ’ 1, y ’ 1 ) + s(x ’ 2, y ’ 2 ).

(x ’ 1, y ’ 1 ), (x ’ 2, y ’ 2 ), (x ’ 3, y ’ 3 ) are obtained from P 1, P 2, P 3 by:

Since We have:

When P 3 is projected to the screen, we get (x ’ 3, y ’ 3 ) by dividing by w, so: But remember that (x ’ 3, y ’ 3 )=(1-s)(x ’ 1, y ’ 1 ) + s(x ’ 2, y ’ 2 ) Looking at x coordinate, we have

We may rewrite s in terms of t, w 1, w 2, x ’ 1, and x ’ 2. In fact, or conversely Surprisingly, x ’ 1 and x ’ 2 disappear.

Texture Mapping II

What You Will Learn Today? Bump maps Mipmapping for antialiased textures Projective trextures Shadow maps Environment maps

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

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

Modeling an Orange (2) Take a picture of a real orange, scan it, and “paste” onto simple geometric model –This process is texture mapping Still might not be sufficient because resulting surface will be smooth –Need to change local shape –Bump mapping

Three Types of Mapping Texture Mapping –Uses images to fill inside of polygons Environmental (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

Texture Mapping geometric model texture mapped

Environment Mapping

Bump Mapping

Magnification and Minification TexturePolygon MagnificationMinification PolygonTexture More than one texel can cover a pixel (minification) or more than one pixel can cover a texel (magnification) Can use point sampling (nearest texel) or linear filtering ( 2 x 2 filter) to obtain texture values

Aliasing Point sampling of the texture can lead to aliasing errors point samples in u,v (or x,y,z) space point samples in texture space miss blue stripes

Area Averaging A better but slower option is to use area averaging Note that preimage of pixel is curved pixel preimage

Example point sampling mipmapped point sampling mipmapped linear filtering linear filtering

Automatic Texture Coordinate Generation OpenGL can generate texture coordinates automatically glTexGen{ifd}[v]() generation modes –GL_OBJECT_LINEAR –GL_EYE_LINEAR –GL_SPHERE_MAP (used for environmental maps) Check the OpenGL Red Book! –4 th Ed., Chapter 8, pp ,

Shadow Map Similarly, by clever use of glTexGen(), we can cast shadows on objects. Figure 1. These diagrams were taken from Mark Kilgard’s shadow mapping presentation at GDC They illustrate the shadowing comparison that occurs in shadow mapping. With ShadowsWithout Shadows

More Detail For projective texture, see: ctive_Texture_Mapping.html For shadow map, see: adowmap_paper.html

Question: Aren’t shadow and reflection global illumination effects? Why can we do it in the hardware pipeline?