Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.

Slides:



Advertisements
Similar presentations
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 9 Adding Realism Through Texture.
Advertisements

Graphics Pipeline.
Introduction and Basic OpenGL functionality
Computer Graphics(Fall 2003) COMS 4160, Lecture 7: OpenGL 3 Ravi Ramamoorthi Many slides courtesy Greg Humphreys.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
03/16/2009Dinesh Manocha, COMP770 Texturing Surface’s texture: its look & feel Graphics: a process that takes a surface and modifies its appearance using.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
Texture Visual detail without geometry. Texture Mapping desire for heightened realism.
Week 7 - Wednesday.  What did we talk about last time?  Transparency  Gamma correction  Started texturing.
3D Graphics for Game Programming (J. Han) Chapter VIII Image Texturing.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Textures II Week 8, Wed.
Texture Mapping CPSC /24/03 Abhijeet Ghosh.
Texture mapping. Adds realism to computer graphics Texture mapping applies a pattern of color Bump mapping alters the surface Mapping is cheaper than.
CS 4731: Computer Graphics Lecture 17: Texturing Emmanuel Agu.
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.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
1 Texture. 2 Overview Introduction Painted textures Bump mapping Environment mapping Three-dimensional textures Functional textures Antialiasing textures.
Week 8 - Monday.  What did we talk about last time?  Workday  Before that:  Image texturing ▪ Magnification ▪ Minification  Mipmapping  Summed area.
UniS CS293 Graphics with Java and OpenGL Textures.
ECSE 4750: Computer Graphics Rensselaer Polytechnic Institute Nov 5, 2012 Texture and Texture Mapping.
Computer Graphics Texture Mapping
Texture Mapping. Scope Buffers Buffers Various of graphics image Various of graphics image Texture mapping Texture mapping.
Texture Mapping Course: Computer Graphics Presented by Fan Chen
Mapping method Texture Mapping Environmental mapping (sphere mapping) (cube mapping)
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Textures.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
CS380 LAB IV OpenGL Jonghyeob Lee Reference1. [OpenGL course slides by Rasmus Stenholt] Reference2. [
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
CS 480/680 Computer Graphics OpenGL Texture Mapping Dr. Frederick C Harris, Jr. Fall 2011.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Texturing K. H. Ko School of Mechatronics Gwangju Institute of Science.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
CHAPTER 8 Color and Texture Mapping © 2008 Cengage Learning EMEA.
CS418 Computer Graphics John C. Hart
Texture Mapping. 2 3 Loading Textures void glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border,
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
CS 450: COMPUTER GRAPHICS TEXTURE MAPPING SPRING 2015 DR. MICHAEL J. REALE.
Computing & Information Sciences Kansas State University Lecture 12 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
Graphics Graphics Korea University 1 Jang Sumi Texture Mapping Environment Mapping Stencil Buffer.
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.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
GAM666 – Introduction To Game Programming ● Textures are simply 2D images which are spread over the triangles of a 3D shape ● Each vertex has texture coordinates.
CSc4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Texture Mapping.
Mapping: Image Texturing CPSC 591/691. Texture Mapping Two-dimensional techniques place a two-dimensional (flat) image onto an object using methods similar.
Texturing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Ying Zhu Georgia State University
Discrete Techniques.
Week 7 - Wednesday CS361.
Week 7 - Monday CS361.
The Graphic PipeLine
ATEC Procedural Animation
ATCM 3310 Procedural Animation
OpenGL Texture Mapping
So Far We have assumed that we know: The point The surface normal
Chapters VIII Image Texturing
Interactive Graphics Algorithms Ying Zhu Georgia State University
© University of Wisconsin, CS559 Fall 2004
(c) University of Wisconsin, CS 559
3D Game Programming Texture Mapping
Procedural Animation Lecture 6: Mapping
ATCM 6317 Procedural Animation
OpenGL Texture Mapping
Advanced Computer Graphics: Texture
3D Game Programming Texture Mapping
Presentation transcript:

Texture Mapping

Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can be modified  color, material properties, normal vector, location, …  multiple textures can be applied to the same surface  1* for color  1* for diffuse material properties  1* for specular material properties  1* for normal vector  etc

Texturing color + bump + parallax color + bump color

Texturing 

Texture Pipeline  starts with a location, typically defined in the coordinate frame of the object

Texture Pipeline  projector function maps the object space location onto parameter space coordinates which are used to access the texture  e.g., (x, y, z) →(s, t) where 0 ≤ s, t ≤ 1

Texture Pipeline  corresponder function maps the parameters onto texture locations  e.g., (s, t) →(i, j) where i, j are texel indices

Texture Pipeline  texture locations are used retrieve or calculate values from the texture  e.g., texel (i, j) has color (r, g, b)

Texture Pipeline  value transform function transforms the texture value  e.g., normalize (r, g, b) and interpret the normalized texture value to be the normal vector at the object space location  called normal mapping

Texture Pipeline  transformed texture value is used to modify some property of the surface  e.g., compute lighting using the normal map value

Texture Pipeline

Tomas Akenine-Mőller © 2002 Texture coordinates (0,0)(1,0) (1,1)(0,1) (u,v) in [0,1] (u 0,v 0 ) (u 1,v 1 ) (u 2,v 2 )

Projector Functions  projector function assigns a parameter space coordinate to a point on the object  usually the object points are given in object space (but this is not a requirement)  when the object is moved, the texture moves with it  common for object models to store the result of the projector function for each vertex  simple projector functions  spherical, cylindrical, box, planar

Projector Functions sphericalcylindricalplanar“natural”

Projector Functions  spherical  treat the point (x, y, z) as a vector and normalize to get (x’, y’, z’) ; then

Projector Functions  cylindrical  treat the point (x, y, z) as a vector and normalize to get (x’, y’, z’) ; then

Projector Functions  complex objects will typically use many different projector functions over different parts of the object

Corresponder Functions  maps parameter space coordinates to texture space coordinates  parameter coordinates (s, t) in the range [0, 1) will map onto valid texture space coordinates  most common corresponder functions address the problem of what happens for values of (s, t) not in the range [0, 1)  more general functions are possible  e.g., OpenGL has a texture matrix that can be used to transform parameter coordinates (s, t, r, q)

Corresponder Functions  in OpenGL the “wrapping mode” determines what happens when (s, t) are not in the range [0, 1)  repeat  texture repeats across the surface (the integer part of coordinate is dropped)  clamp to edge  values outside the range [0, 1) are clamped to the range causing the edges of the texture to be repeated across the surface  clamp to border  values outside the range [0, 1) are mapped to a separately defined border color

Corresponder Functions repeatmirrorclamp to edgeclamp to border

Texture Values  texture values are typically in RGB or RGBA format  many possible different bit depths for the individual components  8 bit unsigned probably the most common for image textures  32 bit floats are available  your program does not have to interpret the components as colors

Image Textures  texture stored as an RGB or RGBA image  can be 1, 2, or 3 dimensions  problems you should have seen in previous graphics course  texture image size does not match screen size of object  magnification : object size is larger than texture image  texture appears blocky or blurry  minification: object size is smaller than texture image  aliasing occurs

Image Textures  magnification  48x48 texture image on 320x320 pixel square nearest neighbor filteringbilinear filtering cubic filtering

Image Textures  minification  many texels map onto the same pixel nearest neighbor mipmapping summed area tables

Applying the Texture  once the final texture value has been computed, the value is used to modify the fragment color  OpenGL supports various “texture functions” that determine how the final fragment color is calculated  replace  modulate  decal  blend  functions are different if the texture is RGB or RGBA

Applying the Texture

 replace  texture color replaces the fragment color  essentially removes all lighting effects texture RGB texture RGBA

Applying the Texture  modulate  texture and fragment colors are multiplied  combines texture and lighting effects, but attenuates specular highlights texture RGB texture RGBA

Applying the Texture  decal  similar to replace, except for RGBA textures where the the texture and fragment colors are blended based on the texture alpha value  like applying a decal (sticker) on top of a surface texture RGB texture RGBA

Applying the Texture  blend  texture and fragment colors are blended  commonly used for billboarding  C c is a separately defined color called the “texture environment color” texture RGB texture RGBA