Computer Graphics Texture Mapping

Slides:



Advertisements
Similar presentations
9.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 9 Adding Realism Through Texture.
Advertisements

Technische Universität München Fakultät für Informatik Computer Graphics SS 2014 Sampling Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
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.
Lecture 6: 3D Rendering Pipeline (III) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
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.
Texture Mapping CPSC /24/03 Abhijeet Ghosh.
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.
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.
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.
Computer Graphics Inf4/MSc Computer Graphics Lecture 7 Texture Mapping, Bump-mapping, Transparency.
Computer Graphics Texture Mapping Eriq Muhammad Adams
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
11/11/04© University of Wisconsin, CS559 Fall 2004 Last Time Shading Interpolation Texture mapping –Barycentric coordinates for triangles.
1 Texture Mapping ©Anthony Steed Overview n Texture mapping Inverse and Forward Mapping Bilinear interpolation Perspective correction n Mipmapping.
1 9. Textures v Create the illusion of detail by wraping a complex image (texture) around a simple geometry –realism is increased without the need for.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Texture Mapping Course: Computer Graphics Presented by Fan Chen
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.
Advanced Computer Graphics Depth & Stencil Buffers / Rendering to Textures CO2409 Computer Graphics Week 19.
Emerging Technologies for Games Alpha Sorting and “Soft” Particles CO3303 Week 15.
Computer Graphics Bitmaps & Sprites CO2409 Computer Graphics Week 3.
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 The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
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.
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.
Computer Graphics Basic 3D Geometry CO2409 Computer Graphics Week 5-1.
CS418 Computer Graphics John C. Hart
Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Computer Graphics Rendering 2D Geometry CO2409 Computer Graphics Week 2.
Computer Graphics Blending CO2409 Computer Graphics Week 14.
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
Graphics Graphics Korea University 1 Jang Sumi Texture Mapping Environment Mapping Stencil Buffer.
Computer Graphics Matrices
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.
Texturing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Discrete Techniques.
Week 7 - Wednesday CS361.
Week 7 - Monday CS361.
Texture Mapping cgvr.korea.ac.kr.
OpenGL Texture Mapping
Graphics, Fall 2017 Lecture 24: Texture Mapping
Chapters VIII Image Texturing
Interactive Graphics Algorithms Ying Zhu Georgia State University
3D Game Programming Texture Mapping
Textures Lecture 11 Wed, Oct 5, 2005.
Computer Graphics Introduction to Shaders
Chapter XV Shadow Mapping
Computer Graphics Material Colours and Lighting
OpenGL Texture Mapping
Advanced Computer Graphics: Texture
3D Game Programming Texture Mapping
OpenGL Texture Mapping
Presentation transcript:

Computer Graphics Texture Mapping CO2409 Computer Graphics Week 13

Lecture Contents Textures Texture Coordinates Texture Addressing Modes Texture Filtering Mip-Mapping

Textures We can vastly improve on simple coloured and lit models by using textures Sometimes called texture maps or more simply maps Textures are rather like a wallpaper, shrink-wrapped around the model geometry A texture is simply a bitmap held off-screen Typically loaded from standard bitmap file formats Each pixel in the bitmap appears as a square on the geometry called a texel Texture resolution usually high enough so that we don’t notice the texels

Texture Coordinates (UVs) Need to define exactly how a texture is wrapped around the geometry Which part of the texture is attached to each vertex So each vertex in the geometry is assigned a texture coordinate: A texture coordinate is a pair of (float) values usually from 0.0 to 1.0 Measured on U & V axes Written (U,V) and hence very often referred to as UVs The vertex UVs define exactly how the texture maps onto the geometry This is Texture Mapping

Defining Texture Mapping The UV coordinate (0, 0) specifies the top-left of the texture bitmap, (1,1) specifies the bottom-right So (1, 0) defines the top-right (0, 1) the bottom-left (0.5, 0.5) the centre See diagram on last slide The UV for each vertex specifies which part of the texture is on that vertex Choosing a texture pixel for a given UV is sampling the texture UVs are interpolated across the polygon surface to define how the texture is applied This polygon is mapped with the yellow square on the last slide

Artist UV Mapping Tool

Texture Addressing Modes UVs do not have to be in the range 0.0 to 1.0 The texture position represented by UVs outside this range depends on the texture addressing mode: (Note this is DirectX terminology) Wrap: Use only the fractional part of the UVs (e.g. U=2.7 means U=0.7). This is the usual mode. Mirror: Similar to wrap mode, but the texture is mirrored for odd U and V Clamp: UVs are clamped to the nearest valid value (U=2.7 means U=1, V=–2.3 means V=0) Border: UVs out of range return a fixed colour regardless of the texture colours Diagrams on next slide…

Addressing Modes Examples Wrap addressing mode repeats the texture over for large UV ranges Useful for mapping a large polygon with a repeated texture (e.g. a tiled wall) Mirror addressing looks similar but the texture alternately mirrors Clamp addressing ensures we see only one texture Can be used to reduce bleeding problems at the edges of geometry Border addressing is similar Wrap Mirror Clamp Border

Texture Filtering If we zoom in on a textured polygon each texel will cover a small, but noticeable area If all pixels in a texel the same colour we see small small quads: If we zoom out, will be a choice of several texels within a single pixel Could cause aliasing shown in a later slide So when sampling, we blend texels to smooth out these effects Called Texture Filtering Magnification: zoom in Minification: zoom out Texels Visible as Squares

Texture Filtering Modes Choose a filtering mode for both texture minification & magnification: Can be different Point Sampling No filtering, sample nearest texel Bilinear Filtering Sampled colour is a linear blend of the nearest four texels Called bilinear because it blends neighbour texels in X & Y direction Anisotropic Filtering An advanced blending mode Considers polygon angle to the camera Improves the clarity of polygons going into the distance especially Point Sampled Bilinear Bilinear Sampling

Mip-Mapping When a texture is drawn far away, it will use the minification filter However, the available runtime filters are poor when considerable scaling down is required Certain textures will likely exhibit unpleasant aliasing effects Aliasing is when the resolution is not sufficient to display fine detail E.g. “strobing” on regular patterns or noise effects on naturalistic detail Reduce problem by pre-creating smaller versions of the texture to use when it is far away This is called mip-mapping No Mip-Maps With Mip-Maps

Mip-Map Creation A mip-map is a smaller version of a texture created using a high-quality resizing algorithm Done in advance, not during scene rendering A sequence of mip-maps is created, each 50% smaller than the one before Making mip-map chain from original texture potentially down to a 1x1 pixel version When rendering a texture, the mip-map closest to the polygon size is used This minimises aliasing effects [It is also faster: more likely to sequentially sample neighbouring texels with correct sized texture, which is more cache-efficient]

Tri-linear Filtering When a polygon moves toward or away from the viewer, the change in mip-map choice can be seen A clear visual dividing line between mip-maps (hard to show on static diagram – see lab) To remove this we can linearly blend the nearest two mip-maps Instead of just choosing the nearest one Combined with bilinear filtering within each texture, this gives trilinear filtering Blends the mip-map dividing line There is an anisotropic equivalent too Bilinear Trilinear

Comparison

High Resolution Comparison

Texture Blending A polygon can have more than one texture applied Can blend several textures on top of each other to create a composite texture Possible uses: Reflections on a texture Shadows on a texture Merging textures (above) Normal mapping - upcoming lab Use blending modes Like the earlier sprite lab We may need to provide multiple sets of UVs, one for each texture