Texture Mapping CAP4730: Computational Structures in Computer Graphics.

Slides:



Advertisements
Similar presentations
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
Advertisements

Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
Normal Map Compression with ATI 3Dc™ Jonathan Zarge ATI Research Inc.
Ray tracing. New Concepts The recursive ray tracing algorithm Generating eye rays Non Real-time rendering.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
RealityEngine Graphics Kurt Akeley Silicon Graphics Computer Systems.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
Direct Volume Rendering. What is volume rendering? Accumulate information along 1 dimension line through volume.
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.
CAP4730: Computational Structures in Computer Graphics Visible Surface Determination.
Computer Graphics Visible Surface Determination. Goal of Visible Surface Determination To draw only the surfaces (triangles) that are visible, given a.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Textures II Week 8, Wed.
Computer Graphics Hardware Acceleration for Embedded Level Systems Brian Murray
IN4151 Introduction 3D graphics 1 Introduction 3D Computer Graphics part 1 Projective display Viewing pipeline Graphics hardware Image-based rendering.
Computer Graphics (Spring 2008) COMS 4160, Lecture 19: Texture Mapping Many slides from Greg Humphreys, UVA and Rosalee.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Texture Mapping.
Status – Week 277 Victor Moya.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 12 Chapter 12: Making the Applications Interesting.
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.
Texture Mapping A way of adding surface details Two ways can achieve the goal:  Surface detail polygons: create extra polygons to model object details.
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.
3D Computer Graphics: Textures. Textures: texels Texture is a way of assigning a diffuse color to a pixel – can be with 1, 2 or 3D- can use maps, interpolation.
Basic Graphics Concepts Day One CSCI 440. Terminology object - the thing being modeled image - view of object(s) on the screen frame buffer - memory that.
CS 480/680 Computer Graphics Course Overview Dr. Frederick C Harris, Jr. Fall 2012.
Computer Graphics Texture Mapping Eriq Muhammad Adams
Antialiasing CAP4730: Computational Structures in Computer Graphics.
2IV60 Computer Graphics set 10: Texture mapping Jack van Wijk TU/e.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
Texture Mapping. Scope Buffers Buffers Various of graphics image Various of graphics image Texture mapping Texture mapping.
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.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
3D Graphics for Game Programming Chapter IV Fragment Processing and Output Merging.
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.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
CHAPTER 8 Color and Texture Mapping © 2008 Cengage Learning EMEA.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
Hank Childs, University of Oregon Volume Rendering, pt 1.
OpenGL Graphics Textures. Quiz You didn't see that coming!
Background image by chromosphere.deviantart.com Fella in following slides by devart.deviantart.com DM2336 Programming hardware shaders Dioselin Gonzalez.
2 3D Viewing Process  3D viewing process MC Model Space Model Transformation Model Transformation WC World Space Viewing Transformation Viewing Transformation.
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 12.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Texture Mapping Greg Humphreys University of Virginia CS 445, Fall 2003.
Build your own 2D Game Engine and Create Great Web Games using HTML5, JavaScript, and WebGL. Sung, Pavleas, Arnez, and Pace, Chapter 5 Examples 1.
Introduction to Computer Graphics
3D on the Web : Understanding the basics
Textures, Sprites, and Fonts
CSE 167 [Win 17], Lecture 18: Texture Mapping Ravi Ramamoorthi
Week 7 - Monday CS361.
Week 2 - Friday CS361.
Deferred Lighting.
The Graphics Rendering Pipeline
So Far We have assumed that we know: The point The surface normal
© University of Wisconsin, CS559 Fall 2004
3D Game Programming Texture Mapping
Simple Texture Mapping
3D Game Programming Texture Mapping
Presentation transcript:

Texture Mapping CAP4730: Computational Structures in Computer Graphics

Outline n What is texture mapping? n Math behind texture mapping n OpenGL texture mapping n Advanced Topics in texture mapping

Marching towards Visual Realism

How do we do this?

Another Example

Using only Triangles n Using only triangles to model everything is hard n Think about a label on a soup can n Instead of interpolating colors, map a pattern n Run Demo n How do you create a pattern?

Texture n A color array that holds an image n Similar to a framebuffer n gluint buffer[x*y*3] n

Procedural Texture n Calculate pixel values via functions

Image Textures Load pixel values from a file

Let’s look at some games

Texture Space n How would you store this in your program? n How much memory? s t s = [0…1] t = [0…1]

Object Space s t (u 0,v 0 ) (u 1,v 1 ) (u 2,v 2 ) (u 3,v 3 ) Texture -> Object Transformation s = [0…1] t = [0…1] u = [0…1] v = [0…1]

Going from pixels to textures Object -> Texture Transformation Image -> Object Transformation (s,t)(s,t) (u,v) (x,y)(x,y)

What is the question? n A pixel (x,y) corresponds to what texture element (s,t)? n Q: How do we convert (s,t) into texture element coordinates? n TEXture Elements (TEXELS) n A: Linearly Interpolate texture coordinates! n classes/6.837/F98/Lecture2 1/Slide05.html

Tiling n Let’s look at the texture coordinates s t (u 0,v 0 ) (u 1,v 1 ) (u 2,v 2 ) (u 3,v 3 )

Textures built to Tile n Think Windows Background n Why would you want this? Discuss the Pros and Cons of tiling. n Look at code 0,0 1,1 0,1 1,0 0,0 2,2 0,2 2,0

Filtering n Why does this happen? (u 0,v 0 ) (u 1,v 1 ) (u 2,v 2 )

Filtering n Why does this happen? n What are some alternatives? (u j,v j ) (u i,v i )

Combining Lighting + Texturing n If you notice there is no lighting involved with texture mapping! n They are independent operations, which MAY (you decide) be combined n It all depends on how you “apply” the texture to the underlying triangle

Combining Lighting + Texturing n C T = Texture Color n C C = Base Triangle n Replace, C F = C T n Blend, C F = C T * C C n OpenGL: –glTexEnv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND); – es/hardcopy/GL/html/gl/texenv.html

Screen space vs. world space P 0 (x,y,z) P 1 (x,y,z) V 0 (x,y) V 1 (x,y)

Interpolation in Screen Space P 0 (x,y,z) P 1 (x,y,z) V 0 (x’,y’) V 1 (x’,y’) z’=1

Interpolation in World Space P 0 (x,y,z) P 1 (x,y,z) V 0 (x’,y’) V 1 (x’,y’) z’=1

Comparing the two n What do we need to interpolate in screen space now? n What happens if we don’t have Z? What have we discussed that doesn’ n What happens if we don’t have Z? What have we discussed that doesn’t have Z? n n Perspectively Correct Z n es/6.837/F98/Lecture21/Slide14. html

Other solutions n Cost of screen space interpolation now? n Increase # of triangles

Linear Interpolation is wrong? n Gouraud is wrong, but why does it look okay? n Q: Why does Texture mapping not look right even though we are doing the same thing? n A: All about the slope of the interpolation and the “gradualness” or “abruptness” of the change

Transparencies n We will revisit this later, but we can use the alpha channel to stencil out textures. n Thus per pixel, set alpha = 1 or alpha = 0. Where alpha = 0,

Let’s Look at some games n Pick a favorite game from the class