Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.

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.
TEXTURE MAPPING JEFF CHASTINE 1. TEXTURE MAPPING Applying an image (or a texture ) to geometry 2D images (rectangular) 3D images (volumetric – such as.
OpenGL Texture Mapping
Texture Mapping OpenGl and Implementation Details CS
CSC345: Advanced Graphics & Virtual Environments
OpenGL Texture Mapping
OpenGL Texture Mapping Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
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.
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. 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
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Texture Mapping + Texture Object = Texture Mapped Object.
2IV60 Computer Graphics set 10: Texture mapping Jack van Wijk TU/e.
Fundamentals of Computer Graphics Part 9 Discrete Techniques prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared.
2002 by Jim X. Chen: 1 Texture Lab At each rendered pixel, selected texels are used either to substitute for or to scale.
Texture Mapping. Scope Buffers Buffers Various of graphics image Various of graphics image Texture mapping Texture mapping.
Texture Mapping. Introduction What is Texture Mapping? Types of Texture Mapping –1D, 2D and 3D SDL and OpenGL.
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)
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. [
Texture Mapping Fall, Textures Describe color variation in interior of 3D polygon  When scan converting a polygon, vary pixel colors according.
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.
Texture Mapping Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
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.
111/17/ :24 UML Solution Involves Selection of Discrete Representation Values.
2 COEN Computer Graphics I Evening’s Goals n Discuss displaying and reading image primitives n Describe texture mapping n Discuss OpenGL modes and.
CH8 Frame Buffer Object 1. Introduction Name OpenGL :Frame Buffer Object DirectX:Render Target Usage Render to Texture 2.
Texture Mapping. 2 3 Loading Textures void glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border,
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
OpenGL Programming Guide : Texture Mapping Yoo jin wook Korea Univ. Computer Graphics Lab.
1 Graphics CSCI 343, Fall 2015 Lecture 25 Texture Mapping.
Texture Mapping and NURBS Week 7 David Breen Department of Computer Science Drexel University Based on material from Ed Angel, University of New Mexico.
第三课. Overview of this Section Concept of Texture Mapping ( 纹理映射 ) 2D Texture 3D Texture Environment Mapping Bump Mapping Others OpenGL Implementation.
Texture Mapping. For Further Reading Angel 7 th Ed: ­Chapter 7: 7.3 ~ 7.9 Beginning WebGL: ­Chapter 3 2.
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.
Texture Mapping CEng 477 Introduction to Computer Graphics.
Madhulika (18010), Assistant Professor, LPU.
Texture Mapping Fall, 2016.
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
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
OpenGL Texture Mapping
Introduction to Computer Graphics with WebGL
Computer Graphics, Lee Byung-Gook, Dongseo Univ.
Assignment 3b Q&A.
Chapters VIII Image Texturing
Introduction to Texture Mapping
Geb Thomas Adapted from the OpenGL Programming Guide
Lecture 21: Texture mapping Li Zhang Spring 2010
3D Game Programming Texture Mapping
OpenGL Texture Mapping
3D Graphics with OpenGL CSCE 458 Fall 2004
OpenGL Texture Mapping
Programming Textures Lecture 15 Fri, Sep 28, 2007.
Texture Mapping Ed Angel Professor Emeritus of Computer Science
3D Game Programming Texture Mapping
OpenGL Texture Mapping
Presentation transcript:

Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr

Contents Texels and textures Constructing a texture map Texture coordinates Texture parameters A rotating cube with texture Texture mapping with images Exercise kucg.korea.ac.kr

Texels and Textures Texels – texture elements Texture coordinates (s, t) kucg.korea.ac.kr

Constructing a Texture Map Steps: Read an image for the texture map Define parameters that determine how the texture should be applied Define texture coordinates for the vertices Ex: making the image into a 2D texture map GLubyte myimage[64][64][3]; glEnable(GL_TEXTURE_2D); glTexImage2D(GL_TEXTURE_2D, 0, 3, 64, 64, 0, GL_RGB, GL_UNSIGNED_BYTE, myimage); kucg.korea.ac.kr

1D, 2D, & 3D Texture Maps void glTexImage1D(GLenum target, GLint level, GLint iformat, GLsizei width, GLint border, GLenum format, GLenum type, Glvoid *texels); void glTexImage2D(GLenum target, GLint level, GLint iformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, Glvoid *texels); void glTexImage3D(GLenum target, GLint level, GLint iformat, GLsizei width, GLsizei height, Glsizei depth, GLint border, GLenum format, GLenum type, Glvoid *texels); kucg.korea.ac.kr

2D Texture Map Texture map as a continuous image in (s, t) space and as a discrete image Texture Map Texture Image kucg.korea.ac.kr

Texture Coordinates (1/2) Mapping between points on geometric objects and texels Ex: mapping the texture to a quadrilateral void glTexCoord{1234}{sifd}(TYPE scoord, ...); void glTexCoord{1234}{sifd}v(TYPE *coord); glBegin(GL_QUADS); glTexCoord2f(0.0, 0.0); glVertex3fv(vertex[0]); glTexCoord2f(0.0, 1.0); glVertex3fv(vertex[1]); glTexCoord2f(1.0, 1.0); glVertex3fv(vertex[2]); glTexCoord2f(1.0, 0.0); glVertex3fv(vertex[3]); glEnd(); kucg.korea.ac.kr

Texture Coordinates (2/2) Applying a checkerboard texture to a quadrilateral Texture Map Quadrilateral kucg.korea.ac.kr

Texture Parameters (1/3) Control over how the texture is applied to the surface Ex: deciding what to do if values are out of (0, 1) GL_CLAMP void glTexParameter{if}(GLenum target, GLenum name, TYPE value); void glTexParameter{if}v(GLenum target, GLenum name, TYPE *value); glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, kucg.korea.ac.kr

Texture Parameters (2/3) Preimage of the pixel Texture mapping is not really applied to the surface but rather a pixel in screen coordinates Magnification – each texel covers multiple pixels Minification – each pixel covers multiple texels Magnification Minification kucg.korea.ac.kr

Texture Parameters (3/3) Point sampling OpenGL uses to average a 2X2 array of neighboring texels GL_LINEAR glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, kucg.korea.ac.kr

A Rotating Cube with Texture kucg.korea.ac.kr

Constructor kucg.korea.ac.kr

DrawQuad( ) kucg.korea.ac.kr

DrawScene( ) kucg.korea.ac.kr

A Color Cube kucg.korea.ac.kr

Texture Image kucg.korea.ac.kr

LoadTexture( ) kucg.korea.ac.kr

DrawQuad( ) kucg.korea.ac.kr

DrawScene( ) kucg.korea.ac.kr

A Color Cube with Texture kucg.korea.ac.kr

Exercise (1) Change the texture coordinates, parameters for texture mapping kucg.korea.ac.kr

Texture Images Load a BMP file for a texture image kucg.korea.ac.kr

OpenGL Auxiliary Library kucg.korea.ac.kr

Project Settings kucg.korea.ac.kr

New Definition kucg.korea.ac.kr

LoadTexture( ) kucg.korea.ac.kr

Result – Texture Mapping (1) kucg.korea.ac.kr

Multiple Texture Images kucg.korea.ac.kr

LoadTexture( ) kucg.korea.ac.kr

DrawScene( ) kucg.korea.ac.kr

Result – Texture Mapping (2) kucg.korea.ac.kr

Exercise (2) Set the background by texture mapping kucg.korea.ac.kr