Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.

Slides:



Advertisements
Similar presentations
Lecture 8 Transparency, Mirroring
Advertisements

Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Graphics Pipeline.
Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
Week 7 - Wednesday.  What did we talk about last time?  Transparency  Gamma correction  Started texturing.
Texture Mapping CPSC /24/03 Abhijeet Ghosh.
X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that.
Texture mapping. Adds realism to computer graphics Texture mapping applies a pattern of color Bump mapping alters the surface Mapping is cheaper than.
OpenGL Texture Mapping
OpenGL Texture Mapping Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
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.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Guilford County Sci Vis V204.01
Texture Mapping A way of adding surface details Two ways can achieve the goal:  Surface detail polygons: create extra polygons to model object details.
SET09115 Intro Graphics Programming
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
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: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Computer Graphics Texture Mapping Eriq Muhammad Adams
ECSE 4750: Computer Graphics Rensselaer Polytechnic Institute Nov 5, 2012 Texture and Texture Mapping.
Vector vs. Bitmap
Computer Graphics Texture Mapping
Week 2 - Wednesday CS361.
2IV60 Computer Graphics set 10: Texture mapping Jack van Wijk TU/e.
Lecture 8: Texture Mapping 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271
Texture Mapping Course: Computer Graphics Presented by Fan Chen
Computer Graphics Ben-Gurion University of the Negev Fall 2012.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
09/11/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Graphics Pipeline Texturing Overview Cubic Environment Mapping.
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.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
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.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Computer Graphics 2 Lecture 7: Texture Mapping Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
CHAPTER 8 Color and Texture Mapping © 2008 Cengage Learning EMEA.
More on Environment Mapping Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Wednesday, December 10, 2003.
October 9, 2002Serguei A. Mokhov, 1 COMP471 – Computer Graphics OpenGL: Texture Mapping.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
OpenGL Graphics Textures. Quiz You didn't see that coming!
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.
Details of Texture Mapping Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, December 1, 2003.
Textures – Basic Principles Lecture 29 Fri, Nov 14, 2003.
Module 05 –Bump mapping Module 05 – Bump mapping Module 05 Advanced mapping techniques: Bump mapping.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Texture Mapping CEng 477 Introduction to Computer Graphics.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Week 7 - Wednesday CS361.
Madhulika (18010), Assistant Professor, LPU.
Week 7 - Monday CS361.
OpenGL Texture Mapping
IMAGES.
3D Game Programming Texture Mapping
Dr. Jim Rowan ITEC 2110 Vector Graphics II
Chapter 14 Shading Models.
OpenGL Texture Mapping
Dr. Jim Rowan ITEC 2110 Vector Graphics II
OpenGL Texture Mapping
Presentation transcript:

Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College PowerPoint Instructor’s Resource

Texture Mapping Creating more realistic and exciting images

Texture Mapping Adds extra information from an array to graphical objects at the last stage of drawing Can be viewed as “painting” with 1D, 2D, or 3D values –1D - painting that depends on one direction –2D - painting along a surface –3D - painting throughout a solid Painting is not literal; the values can be used in many ways

A Texture Map Is… An array of values stored in a particular memory area in the graphics system The dimension of the texture map is the dimension of the array The values in the texture map are used in the final computation of the colors of each pixel

Texture Mapping Needs… A graphics object that has “texture coordinates” that associate a vertex with texture values An array of values (usually color, but it can have other meanings) An association of each vertex with the texture so it can get a value from the array

Texture Mapping is Complex… … because many things have to go right to make it work, including –Texture memory in the system must be loaded and its format (size and data) known –What is the meaning of the texture (color, …) –How will the texture value will be combined with the object’s pixels –How will the texture value be computed when a pixel does not have an exact texture coordinate or the texture coordinates go out of the unit range

Texture Coordinates Texture coordinates are 1D, 2D, or 3D vectors with values in [0,1] Each vertex in you model may have not only geometric coordinates but also texture coordinates The values in texture coordinates refer proportionately to indices in the texture array

Textures in the Scene Graph Textures do not affect the geometry of a scene, but only the way that geometry appears in the final image Textures are thus specified as part of an appearance node in the scene graph: –Color and shading –Lighting and materials –Texture mapping

Creating Texture Maps From an image: digital photo or scan –Penguins from a trip to South Africa

Creating Texture Maps Synthetically, from a program that writes values to a file –A brick texture

Format for Texture Files Any image file could be used to hold a texture map The only question is reading the file and writing the contents to memory If you use sophisticated files, you may need to use tools to read the files Here we choose to use only raw files (the contents are rgbrgbrgb…) to keep things simple

Noise as Texture Noise is a procedural texture with only one component Filtered random noise 1/f noise

Noise is Very Useful Can be used in any place where you want something random but controlled Can process the noise to get regions –All regions where the value is greater than a fixed value Can use noise for varying blending or varying lightness or intensity …

Texture Interpolation The texture coordinates of points within a region must be interpolated –This is described in detail in the chapter on rendering It is important to realize that the way interpolation is done affects the image

Creative Uses of Textures Texture is often used to “paint realism” onto objects, creating much more interesting images than modeling alone However, there are many ways to use textures creatively

MIP Mapping Hold many different resolutions of the same content in one texture map You can select the version that best fits your geometry, controlling the quality of the image with less computation

Billboards A billboard is a plane object (usually simple, like a rectangle) on which an image is texture mapped’ The image often includes zero-alpha areas so they can be “seen through” The object is rotated to face the viewer so that the viewer sees the image in 3D space, simulating a full 3D object

Creating Complex Textures You can create textures by reading several different images and combining them as you write the texture array You can use multitexturing to create texture layers

Chromadepth Use a 1D texture map that’s red to blue –Color ramp process, but in an array Apply the texture in eye order on a white object Resulting image looks 3D through Chromadepth glasses (diffraction grating)

Environment Maps Environment maps can be made with the sphere map capability Texture map is made with a spherical filter

Some Details Texture coordinates that lie outside of [0,1] -- wrapping or clamping

Some Details Texture coordinates that lie between actual texture map array coordinates -- magnification filters –Nearest (left) and linear (right)

Code For Textures Can Involve Many Stepe A typical 2D texture setup with the texture already in the array texImage glEnable(GL_TEXTURE_2D); glGenTextures(1, texName); // define texture for sixth face glBindTexture(GL_TEXTURE_2D,texName[0]); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexImage2D(GL_TEXTURE_2D,0,GL_RGB8,TEX_WIDTH,TEX_HEIGHT, 0,GL_RGB,GL_UNSIGNED_BYTE,texImage);

This Code Does Many Things Enables textures Generates a texture with a name Binds the texture to a texture type Defines the texture environment Defines many texture parameters Links the array texImage with the texture you have defined