1 Texture Mapping ©Anthony Steed 1999. 2 Overview n Texture mapping Inverse and Forward Mapping Bilinear interpolation Perspective correction n Mipmapping.

Slides:



Advertisements
Similar presentations
16.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 16 – Some Special Rendering Effects.
Advertisements

Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
1 z-buffer and shading ©Anthony Steed Overview n Coping with depth Scan-line depth buffering Z-buffer Recursive sub-division Trade-offs n gouraud.
03/16/2009Dinesh Manocha, COMP770 Texturing Surface’s texture: its look & feel Graphics: a process that takes a surface and modifies its appearance using.
CSE 681 Texture mapping - other methods Environmental mapping Bump mapping.
3D Graphics Rendering and Terrain Modeling
Computer Graphics Bing-Yu Chen National Taiwan University.
Week 7 - Wednesday.  What did we talk about last time?  Transparency  Gamma correction  Started texturing.
Computer Graphics Inf4/MSc Computer Graphics Lecture 13 Illumination I – Local Models.
 Engineering Graphics & Introductory Design 3D Graphics and Rendering REU Modeling Course – June 13 th 2014.
IN4151 Introduction 3D graphics 1 Introduction 3D Computer Graphics part 1 Projective display Viewing pipeline Graphics hardware Image-based rendering.
Texture Mapping CPSC /24/03 Abhijeet Ghosh.
(conventional Cartesian reference system)
X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that.
CS248 Final Review. CS248 Final Monday, December 6, 3:30 to 6:30 pm, Gates B01 Closed book, closed notes Mainly from material in the second half of the.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Texture Mapping.
CS248 Final Review Derek Chan and Abe Davis. CS248 Final Monday, December 8, 3:30 to 6:30 pm Closed book, closed notes Mainly from material in the second.
Coordinate Systems X Y Z (conventional Cartesian reference system) X Y Z.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Introduction to 3D Graphics Lecture 6: Real-Time Rendering Anthony Steed University College London.
1 Texturing. 2 What is Texturing? 3 Texture Mapping Definition: mapping a function onto a surface; function can be:  1, 2, or 3D  sampled (image) or.
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
CS 445 / 645 Introduction to Computer Graphics Lecture 18 Shading Shading.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
Computer Graphics Panos Trahanias ΗΥ358 Spring 2009.
Review 2: Illumination, Shading, Texturing and Anti-aliasing
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
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
Shading & Texture. Shading Flat Shading The process of assigning colors to pixels. Smooth Shading Gouraud ShadingPhong Shading Shading.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
1 Texture Mapping. 2 Texture Aliasing MIPmaps Environment Mapping Bump Mapping Displacement Mapping Shadow Maps Solid Textures Antialiasing.
Game Programming 06 The Rendering Engine
Computing & Information Sciences Kansas State University Lecture 10 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
CHAPTER 8 Color and Texture Mapping © 2008 Cengage Learning EMEA.
CS418 Computer Graphics John C. Hart
Smooth Shading Gouraud Phong
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Komputer Grafik 2 (AK045206) Shading 1/17 Realisme : Shading.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
Image Space Rendering and Texturing ©Celine Loscos 2004 Anthony Steed 1999.
Lighting and Shading Part 2. Global Ambient Light There are at least 8 OpenGL lights and 1 Global Ambient Setting the Global Ambient globalAmbient[] =
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Texture Mapping Greg Humphreys University of Virginia CS 445, Fall 2003.
CSc4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Texture Mapping.
Texturing CMSC 435/ What is Texturing? 2 Texture Mapping Definition: mapping a function onto a surface; function can be: – 1, 2, or 3D – sampled.
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
Texturing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Texture Mapping cgvr.korea.ac.kr.
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
Chapter 14 Shading Models.
Chapters VIII Image Texturing
Interactive Graphics Algorithms Ying Zhu Georgia State University
CSC461: Lecture 23 Shading Computation
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Chapter 14 Shading Models.
Advanced Computer Graphics: Texture
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
3D Game Programming Texture Mapping
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Texture Mapping Jung Lee.
Presentation transcript:

1 Texture Mapping ©Anthony Steed 1999

2 Overview n Texture mapping Inverse and Forward Mapping Bilinear interpolation Perspective correction n Mipmapping n Other forms of mapping Environment Bump mapping

3 Texture Mapping n Why? Approximation for surface colouring Efficient packing of flat detail n Standard texture mapping modifies diffuse mapping Pasting a picture onto the polygon

4 Inverse Mapping n Each vertex is associated with a point on an image (u,v)

5 Forward Mapping n For points in the image, map onto the polygon much harder to implement correctly, and harder to model n Inverse mapping is much more commonly used Most 3D modelers output U,V co-ordinates for texture application

6 Quick and Dirty Solution n Yet more parameters in the ET! n Bilinear interpolation of u&v down scene edges, and across scan-lines n Works, but is very ugly Does not consider fore-shortening of image in depth

7 The Problem n Same problem exists with phong and gouraud shading, but it MUCH less noticeable z correct z incorrect

8 The Solution n Need to compensate for fore-shortening by interpolating over 1/z n Interpolate (u’,v’,q) where q=1/z At vertices we know (u 1,v 1,z 1 ), (u 2,v 2,z 2 ) Interpolate between (u 1* z 1,v 1 * z 1,1/z 1 ) and (u 2* z 2,v 2 * z 2,1/z 2 ) to get (u’,v’,q) Restore u,v, by dividing u’ and v’ by q

9 Sanity Check p0=(10,5,10,0,0) p1=(15,15,20,0,1) (x, y, z,u,v) scanlines Y=5 Y=10 Y=15 n At p0 (u’,v’,q) = (0,0.1,0.1) n At p1 (u’,v’,q) = (0,0,0.05) n On scanline 5 (u’,v’,q) = (0,0.05,0.075) (u,v) = z = 1/0.075 = 13.33

10 Minor Issues n Now have two divides per pixel! n Some optimisations only do the divide at end of the spans and interpolate across spans or only do the divide every n pixels n Remaining problem we have not touched upon how to clip u,v values in 3D or 2D!

11 Major Issues n Picking your pixel! image

12 Sampling n A pixel maps to a non-rectangular region n Usually only perform map on centre of pixel n Still have a problem of over-sampling (same texel maps to several pixels) or under-sampling the image (pixels only sparsely sample the texels)

13 Filtering n Nearest neighbour n Pick pixel with closest centre n Bilinear n Weighted average based on distance to pixel centre

14 Filtering n Bilinear filtering solves (partially) the oversampling problem since it provides smooth shading between pixels scanline

15 Mip-Mapping n When undersampling we use mippmapping n Resample image at lower resolution n Create a “pyramid” of textures. n Interpolate texture between two adjacent layers

16 Texture Pyramid 128x128 64x64 32x32 1x1...

17 Sampling n Choose two layers based on texel span Choice is made selecting the two levels where the dv and dv for dx and dy are closest to one n Interpolate between four pixels in higher layer and one in lower layer

18 Environment Mapping n Don’t modulate diffuse colour modulate colour based on normal n Effectively creates a reflective object n The environment map is a surrounding texture

19 Bump Maps n Use a map to perturb the normal for specular lighting