Advanced Computer Graphics: Texture

Slides:



Advertisements
Similar presentations
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 9 Adding Realism Through Texture.
Advertisements

9.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 9 Adding Realism Through Texture.
03/16/2009Dinesh Manocha, COMP770 Texturing Surface’s texture: its look & feel Graphics: a process that takes a surface and modifies its appearance using.
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.
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
Computer Graphics Bing-Yu Chen National Taiwan University.
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.
COMPUTER GRAPHICS CS 482 – FALL 2014 OCTOBER 6, 2014 TEXTURE MAPPING TEXTURES BUMP MAPPING ENVIRONMENT MAPPING PROCEDURAL TEXTURING.
Texture Mapping CPSC /24/03 Abhijeet Ghosh.
Computer Graphics (Spring 2008) COMS 4160, Lecture 19: Texture Mapping Many slides from Greg Humphreys, UVA and Rosalee.
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.
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.
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.
1 Texture. 2 Overview Introduction Painted textures Bump mapping Environment mapping Three-dimensional textures Functional textures Antialiasing textures.
Computer Graphics Inf4/MSc Computer Graphics Lecture 7 Texture Mapping, Bump-mapping, Transparency.
Texture Mapping. To add surface details… World of Warcraft, Blizzard Inc. More polygons (slow and hard to handle small details) Less polygons but with.
ECSE 4750: Computer Graphics Rensselaer Polytechnic Institute Nov 5, 2012 Texture and Texture Mapping.
Computer Graphics Texture Mapping
1 Texture Mapping ©Anthony Steed Overview n Texture mapping Inverse and Forward Mapping Bilinear interpolation Perspective correction n Mipmapping.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
Surface Detail and Non-PhotoRealistic Rendering Lecture 3 (Rendering)
Texture Mapping. Scope Buffers Buffers Various of graphics image Various of graphics image Texture mapping Texture mapping.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Mapping method Texture Mapping Environmental mapping (sphere mapping) (cube 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 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.
Computing & Information Sciences Kansas State University Lecture 10 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CHAPTER 8 Color and Texture Mapping © 2008 Cengage Learning EMEA.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Texture Mapping Greg Humphreys University of Virginia CS 445, Fall 2003.
Texturing CMSC 435/ What is Texturing? 2 Texture Mapping Definition: mapping a function onto a surface; function can be: – 1, 2, or 3D – sampled.

Discrete Techniques.
Week 7 - Wednesday CS361.
Madhulika (18010), Assistant Professor, LPU.
CSE 167 [Win 17], Lecture 18: Texture Mapping Ravi Ramamoorthi
Week 7 - Monday CS361.
Texture Mapping cgvr.korea.ac.kr.
ATEC Procedural Animation
ATCM 3310 Procedural Animation
OpenGL Texture Mapping
Graphics, Fall 2017 Lecture 24: Texture Mapping
3D Graphics Rendering PPT By Ricardo Veguilla.
Texture Mapping COMP575/COMP770.
So Far We have assumed that we know: The point The surface normal
Advanced Computer Graphics:
Chapter 14 Shading Models.
Introduction to Computer Graphics with WebGL
Introduction to Texture Mapping
Mipmaps Lecture 16 Mon, Oct 1, 2007.
3D Game Programming Texture Mapping
Procedural Animation Lecture 6: Mapping
ATCM 6317 Procedural Animation
Chapter 14 Shading Models.
OpenGL Texture Mapping
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
3D Game Programming Texture Mapping
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
OpenGL Texture Mapping
Presentation transcript:

Advanced Computer Graphics: Texture James Gain Department of Computer Science University of Cape Town jgain@cs.uct.ac.za Advanced Computer GraphicsCollaborative Visual Computing Laboratory

Advanced Computer Graphics Objectives To motivate for surface detail. To introduce the different forms of texture mapping: Two-dimensional Volumetric Bump. To discuss texture sampling issues. 12/05/2019 Advanced Computer Graphics

Motivation for Surface Detail So far, we have assumed: perfectly smooth, uniformly coloured surfaces. This is unrealistic. In reality surfaces are: Multi-coloured (e.g. a painting, bottle label, page in a book), bumpy (e.g. almost every surface, few things are perfectly smooth), and textured (e.g. wood, leaves) Without Surface Detail With Surface Detail 12/05/2019 Advanced Computer Graphics

Types of Surface Detail Micro-faceting: use objects with hundreds of small polygons. Becomes prohibitively expensive. Surface Detail polygons: Smaller polygons placed across the surface of larger polygons. Do not add to visible surface determination costs. Texture mapping: “Wallpaper” an image across the surface of an object. Adds detail as part of rendering rather than modelling. 12/05/2019 Advanced Computer Graphics

Surface Detail Polygons Using many small differently coloured polygons is impractical because of rendering costs. Alternative: Surface Detail Polygons Overlay co-planar polygons (e.g. doors, windows) onto a base polygon (e.g. a wall). In visible surface determination, surface-detail polygons are ignored. In rendering, the surface-detail polygons take precedence over the base. Not a serious contender. Only good for broad scale detail. 12/05/2019 Advanced Computer Graphics

Advanced Computer Graphics Basic Texture Mapping A texture is simply an image (or a procedure for generating an image), with a 2D co-ordinate system. Each 3D object is parametrized in 2D texture space. Screen pixels map to part of an object’s surface and that part of the surface maps to a portion of the texture. Can be visualized as wrapping an image around an object. 12/05/2019 Advanced Computer Graphics

Advanced Computer Graphics Texture Coordinates Each point on an object needs to have associated texture coordinates: Polygon: Assign co-ordinates to each vertex. Commercial modelling systems use a variety of projections: spherical, cylindrical, planar to assign texcoords over an entire object. Plane: Give -axis and -axis directions in the plane. Cylinder: One axis goes up the cylinder, the other axis around. Surface: Assign each parameter of a surface to and . (e.g. ) 12/05/2019 Advanced Computer Graphics

Advanced Computer Graphics Texture Issues Sliding - The texture can be translated, rotated and scaled relative to a surface by an affine co-ordinate transformation of . Seams - If the texture joins without visual discontinuity across opposite edges then repetition can be used to cover an entire object with a single small texture. Interpolation - During polygon scan conversion care must be taken in interpolating texture co-ordinates. Have to compensate for perspective projection so that the texture is correctly foreshortened. Aliasing – like all discrete techniques, texture maps suffer from sampling problems. 12/05/2019 Advanced Computer Graphics

Advanced Computer Graphics Sampling Basic approach assumes square texel (texture element) geometry. This produces poor visual results. Alternative: Treat each texel (texture element) in a texture map as an (r,g,b) value at a point. A projected pixel may: Cover Several Texels Fall between Texels (oversampling) (undersampling) 12/05/2019 Advanced Computer Graphics

Handling UnderSampling The texture co-ordinates of the pixel’s centre are found. The value at this point in the texture map is a combination of surrounding texels. Interpolation Methods: Nearest neighbour: the pixel value is that of the nearest texel. [Fast with many artefacts] Bilinear reconstruction: the pixel value is the weighted mean of the surrounding texels. [Reasonably fast but blurry] Biquadratic reconstruction: use a quadratic function of distance to weight the mean [slower, good results] Bicubic reconstruction [even slower, slightly better results] 12/05/2019 Advanced Computer Graphics

Handling OverSampling There are several solutions if the pixel covers a large area of the texture: Basic Area: Texels are treated as rectangles. Their contribution is weighted by the texel area covered by a pixel. Filters: A filter (e.g. Gaussian) is used, centred on the pixel centre. Can be very expensive if a single pixel covers a large area of the texture map. Multi-resolution Textures: Store multiple versions of the same texture at different resolutions. Use interpolation between maps to get pixel values. MIP Maps (Multum in Parvo – many things in a small space) are an efficient way to store these textures. 12/05/2019 Advanced Computer Graphics

Advanced Computer Graphics Summary What can a texture map modify? Any, or all, of the colour components Transparency Reflectivity Decaling (blend texture with the object’s colour) Problems: Veneer Effect: textures appear to be wall-papered onto the surface. Looks unrealistic in carved objects. Seams: The match between the shape of a texture (rectangular) and object may cause visible distortion and seams. Classic case: a globe. Bumpy surfaces: A lot of texture is caused by bumps on the surface. 12/05/2019 Advanced Computer Graphics

Advanced Computer Graphics Bump Mapping The surface normal is used in calculating both diffuse and specular reflection. Bump mapping modifies the direction of the surface normal so that the surface appears more or less bumpy. A 2D function (bump map) can be used to vary the surface normal smoothly across the plane. But bump mapping doesn’t change the object’s silhouette. Displacement mapping fixes this by actually adjusting the position of vertices in polygonal fragments but it is very expensive. 12/05/2019 Advanced Computer Graphics

Advanced Computer Graphics Solid Textures Texture mapping applies a 2D texture to a surface Solid textures have colour defined for every point in space Permits the modelling of objects that appear to be carved from a solid material (e.g. wood, marble). Simplifies the mapping to texture space. However, creating 3D texture maps cannot be done by hand. It requires procedural textures (e.g. fractals). From Perlin, K. “An Image Synthesizer”, SIGGRAPH 1985 12/05/2019 Advanced Computer Graphics

Simple Texture Mapping in OpenGL setup: glTexImage2D(GL_TEXTURE_2D, level, components, width, height, border, format, type, image); Texture pattern is stored in a width x height array image with type array elements and components colour depth. level and border give finer control associated with MIP-mapping and joining of textures. Example: glTexImage2D(GL_TEXTURE_2D, 0, 3, 512, 512, 0, GL_RGB, GL_UNSIGNED_BYTE, my_image); A 512x512 RGB texture with 8 bits of resolution for each of 3 colours and no special features. coordinates: glTexCoord3f(u, v); associates texture coordinates with a vertex. 12/05/2019 Advanced Computer Graphics