October 9, 2002Serguei A. Mokhov, 1 COMP471 – Computer Graphics OpenGL: Texture Mapping.

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

1 Understanding of OpenGL TA: Dong Hyun Jeong Instructor : Dr. Kalpathi Subramanian Texture Mapping.
OpenGL Texture Mapping
Texture Mapping. Typical application: mapping images on geometry 3D geometry (quads mesh) + RGB texture 2D (color-map) =
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Textures II Week 8, Wed.
Rendering with Texture Maps CMPS 160 Assignment 5.
Texture Mapping CPSC /24/03 Abhijeet Ghosh.
Hofstra University1 Texture Motivation: to model realistic objects need surface detail: wood grain, stone roughness, scratches that affect shininess, grass,
OpenGL Texture Mapping
OpenGL Texture Mapping Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
TA: Zhicheng Yan, Sushma S Kini, Mary Pietrowicz
Environmental Mapping CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
ADDITIONAL TIPS Multi-texture Slides. Here is a link Workflow: /**************In texture parameter set up******/ call glActiveTextureARB(/*pick texture.
1 Lecture 12 Texture Mapping uploading of the texture to the video memory the application of the texture onto geometry.
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.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee.
Texture Mapping A way of adding surface details Two ways can achieve the goal:  Surface detail polygons: create extra polygons to model object details.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Advanced Texturing Methods Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, December 8, 2003.
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
2IV60 Computer Graphics set 10: Texture mapping Jack van Wijk TU/e.
11/11/04© University of Wisconsin, CS559 Fall 2004 Last Time Shading Interpolation Texture mapping –Barycentric coordinates for triangles.
Lecture 8: Texture Mapping 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271
Texture Mapping. Introduction What is Texture Mapping? Types of Texture Mapping –1D, 2D and 3D SDL and OpenGL.
Texture Mapping. Example Mappings Mapping Techniques Consider the problem of rendering a sphere in the examples The geometry is very simple - a sphere.
Computer Graphics OpenGL - Texture mapping. OpenGL Texture mapping zTexture Mapping allows us to glue an image on polygons. In this method we can produce.
Texture Mapping Course: Computer Graphics Presented by Fan Chen
Computer Graphics Ben-Gurion University of the Negev Fall 2012.
An Interactive Introduction to OpenGL Programming Ed Angel
ECSE-4750 Computer Graphics Fall 2004 Prof. Michael Wozny TA. Abhishek Gattani TA. Stephen
CS380 LAB IV OpenGL Jonghyeob Lee Reference1. [OpenGL course slides by Rasmus Stenholt] Reference2. [
Lecture 27: Texture Mapping Li Zhang Spring 2008
And Some Extra Information From
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.
CS 480/680 Computer Graphics OpenGL Texture Mapping Dr. Frederick C Harris, Jr. Fall 2011.
Texture Mapping in OpenGL. Texture Mapping Imaging we are “pasting” a picture onto a model  Which part of the picture will be pasted onto which part.
Texture Mapping Drawing Pictures on Polygons. Texture Mapping.
TEXTURES & OTHER GOODIES Computer Graphics. glTexCoord2f(...); + =
Computer Science Term 1, 2006 Tutorial 2 Assignment 3 – The Virtual World.
More on Environment Mapping Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Wednesday, December 10, 2003.
2 COEN Computer Graphics I Evening’s Goals n Discuss displaying and reading image primitives n Describe texture mapping n Discuss OpenGL modes and.
Texture Mapping. 2 3 Loading Textures void glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border,
TEXTURE CSE 410. Add Texture to Polygon glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D,texid); // here texid corresponds a bitmap image. glNormal3f(1.0,0.0,0.0);
OpenGL Programming Guide : Texture Mapping Yoo jin wook Korea Univ. Computer Graphics Lab.
Texture Mapping. checker.c Texture-Mapped Squares.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
1 Graphics CSCI 343, Fall 2015 Lecture 25 Texture Mapping.
11/24/ :45 Graphics II Shadow Maps Reflections Session 5.
Module 06 –environment mapping Module 06 – environment mapping Module 06 Advanced mapping techniques: Environment mapping.
CH6 Texture.
第三课. Overview of this Section Concept of Texture Mapping ( 纹理映射 ) 2D Texture 3D Texture Environment Mapping Bump Mapping Others OpenGL Implementation.
Texture Coordinates CS418 Computer Graphics John C. Hart.
Texture Mapping CEng 477 Introduction to Computer Graphics.
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
OpenGL Texture Mapping
Computer Graphics, Lee Byung-Gook, Dongseo Univ.
Assignment 3b Q&A.
Chapters VIII Image Texturing
© University of Wisconsin, CS559 Fall 2004
3D Game Programming Texture Mapping
Computer Graphics Practical Lesson 6
OpenGL Texture Mapping
OpenGL Texture Mapping
Programming Textures Lecture 15 Fri, Sep 28, 2007.
3D Game Programming Texture Mapping
OpenGL Texture Mapping
Presentation transcript:

October 9, 2002Serguei A. Mokhov, 1 COMP471 – Computer Graphics OpenGL: Texture Mapping

October 9, 2002Serguei A. Mokhov, 2 The “Need” Create complex appearance w/o much computational effort

October 9, 2002Serguei A. Mokhov, 3 Texture Def A detailed pattern repeated many times to tile a given plane A multidimensional image mapped to a multidim. space.

October 9, 2002Serguei A. Mokhov, 4 Texture Mapping A technique to improve the appearance of the objects shaded with a light model Function of mapping an image onto a 3D surface Provide color details for complex surfaces

October 9, 2002Serguei A. Mokhov, 5 Viewing 2D Texture Space 3D Model Space 2D Screen Space parameterization projection compound mapping

October 9, 2002Serguei A. Mokhov, 6 Texture in OpenGL Identified by an integer “name” The procedure: –Need to generate names first (glGenTextures()) –Load images (see texture.h for BMPLoader for example) –Bind loaded binary image data to the integer name (glBindTexture) –Set parameters (glTexParameter*()) –Build mipmaps (e.g. gluBuild2DMipmaps()) –When drawing an object Enable texturing Specify a texture by its name Disable texture mode

October 9, 2002Serguei A. Mokhov, 7 Reading Textures readAllTextures()

October 9, 2002Serguei A. Mokhov, 8 Mapping Texture on Flat Surfaces and Quadric Objects Cube Sphere Spheremap

October 9, 2002Serguei A. Mokhov, 9 Cube glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, m_aiTexNames[p_iFaceColor]); … draw cube’s face … glDisable(GL_TEXTURE_2D);

October 9, 2002Serguei A. Mokhov, 10 Sphere glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, m_iTexName); GLUquadricObj* l_poQuadric = gluNewQuadric(); gluQuadricDrawStyle(l_poQuadric, GLU_FILL); gluQuadricNormals(l_poQuadric, GLU_SMOOTH); gluQuadricTexture(l_poQuadric, GL_TRUE); gluSphere(l_poQuadric, 0.5, 30, 30); gluDeleteQuadric(l_poQuadric); glDisable(GL_TEXTURE_2D);

October 9, 2002Serguei A. Mokhov, 11 Spheremap Spheremap texture looks like reflection of a sphere projected to a plane eye

October 9, 2002Serguei A. Mokhov, 12 Spheremap Spheremap texture is indexed from a reflection vector All computations are relative to the eye position Texture looks like a reflection from a chrome hemisphere All mapping is done as reflection from hemisphere. Map’s center reflects back to eyes

October 9, 2002Serguei A. Mokhov, 13 Generating Spheremap: OpenGL glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); computeNormalsForYourObject(); drawYourObject();

October 9, 2002Serguei A. Mokhov, 14 References Jianxiang Dong Slides from Fall 2001