TEXTURES & OTHER GOODIES Computer Graphics. glTexCoord2f(...); + =

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
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Textures II Week 8, Wed.
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.
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.
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.
2IV60 Computer Graphics set 10: Texture mapping Jack van Wijk TU/e.
2002 by Jim X. Chen: 1 Texture Lab At each rendered pixel, selected texels are used either to substitute for or to scale.
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.
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
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.
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.
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.
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.
October 9, 2002Serguei A. Mokhov, 1 COMP471 – Computer Graphics OpenGL: Texture Mapping.
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.
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.
1 Graphics CSCI 343, Fall 2015 Lecture 25 Texture Mapping.
Details of Texture Mapping Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, December 1, 2003.
MP3 Frequently Asked Questions (IN OFFICE HOURS).
第三课. Overview of this Section Concept of Texture Mapping ( 纹理映射 ) 2D Texture 3D Texture Environment Mapping Bump Mapping Others OpenGL Implementation.
MP3.. Start at the very beginning. Almost. Either start from nothing yourself, or use the empty template for this MP. Run through the provided files are.
Module 05 –Bump mapping Module 05 – Bump mapping Module 05 Advanced mapping techniques: Bump mapping.
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.
Texture Mapping CEng 477 Introduction to Computer Graphics.
Recap Last lecture we looked at local shading models –Diffuse and Phong specular terms –Flat and smooth shading Some things were glossed over –Light source.
Texture Mapping Fall, 2016.
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
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
texturing a parametric surface
Advanced Graphics Algorithms Ying Zhu Georgia State University
Advanced Graphics Algorithms Ying Zhu Georgia State University
OpenGL Texture Mapping
Computer Graphics, Lee Byung-Gook, Dongseo Univ.
Assignment 3b Q&A.
Lecture 21: Texture mapping Li Zhang Spring 2010
3D Game Programming Texture Mapping
Computer Graphics Practical Lesson 6
OpenGL Texture Mapping
Programming Textures Lecture 15 Fri, Sep 28, 2007.
3D Game Programming Texture Mapping
OpenGL Texture Mapping
Presentation transcript:

TEXTURES & OTHER GOODIES Computer Graphics

glTexCoord2f(...); + =

+ (0,0)(1,0) (1,1)(0,1) =

glTexCoord2f(...); + (0,0)(1/2,0) (1/2,1/2)(0,1/2) =

glGenTextures(1, &texname); // Generate texture names glPixelStorei(GL_UNPACK_ALIGNMENT, 1); // Set pixel storage modes glBindTexture(GL_TEXTURE_2D, texname); // Bind a texture to a texturing target // Build a 2D mipmap - builds a series of pre-filtered 2D texture maps of decreasing resolutions gluBuild2DMipmaps(GL_TEXTURE_2D, 4, GL_RGBA, GL_UNSIGNED_BYTE, image->getPixels() ); // Set texture parameters glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); // Use GL_MODULATE for standard texturing // GL_DECAL for unlightedness // GL_BLEND for interaction with a background color using the alpha channel of image // GL_REPLACE to completely disregard lighting and replace it with actual colors from the texture image glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); All this done for you!

glBindTexture(GL_TEXTURE_2D, tex1); // tex1 is the identifier for the image you are trying to map on a quad glBegin(GL_POLYGON); glTexCoord2f(0.0, 0.0); glVertex3f(-5, -5, 4); glNormal3f(0, 0, 1); glTexCoord2f(1.0, 0.0); glVertex3f(5, -5, 4); glNormal3f(0, 0, 1); glTexCoord2f(1.0, 1.0); glVertex3f(5, 5, 4); glNormal3f(0, 0, 1); glTexCoord2f(0.0, 1.0); glVertex3f(-5, 5, 4); glNormal3f(0, 0, 1); glEnd();

(0, 0) (1, 0) (1, 1) (0, 1) + (-5, -5, 4)(5, -5, 4) (5, 5, 4)(-5, 5, 4) World coordinates Texture coordinates =

TEXTURING EXAMPLES Simple image loader Texturing example

Advance Texturing Techniques Making things look wicked awesome!!!

LIGHTMAPS +=

BUMPMAPS

Normal Maps +=

Displacement Maps

TERRAINS: SKYBOX

ASSIGNMENT Download ‘PlanetTextures’ zip file Contains textures for various planets Download ‘texturesOnQuadObjects’ zip file Shows how to do texturing on various quadratic objects Now, add textures to your planets to make it look more realistic Download ‘skyboxTextures’ zip file Now, put your solar system in a skybox Insulate translations and scaling on the skybox. Only allow rotations. Why?

ADDITIONAL GOODIES NormalVector.zip Calculates normal vector, given three vertices OpenGLFontRender.zip Write text using OpenGL fonts SimpleImageLoader.zip Simple illustration for loading textures TexturingExample.zip Various things you can do with texture mapping