Texturing. Texture Mapping. Texture Mapping. Have seen: colour can be assigned to ver7ces But: don t want to represent all this detail with geometry

Similar documents
CSE528 Computer Graphics: Theory, Algorithms, and Applications

CS 431/636 Advanced Rendering Techniques

Texture-Mapping Tricks. How Bad Does it Look? We've Seen this Sort of Thing Before. Sampling Texture Maps

Programmable GPUS. Last Time? Reading for Today. Homework 4. Planar Shadows Projective Texture Shadows Shadow Maps Shadow Volumes

frame buffer depth buffer stencil buffer

Computer Graphics 7 - Texture mapping, bump mapping and antialiasing

Texture Mapping II. Light maps Environment Maps Projective Textures Bump Maps Displacement Maps Solid Textures Mipmaps Shadows 1. 7.

Announcements. Written Assignment 2 is out see the web page. Computer Graphics

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

3D Rasterization II COS 426

Texture mapping. Computer Graphics CSE 167 Lecture 9

Surface Rendering. Surface Rendering

CS GPU and GPGPU Programming Lecture 11: GPU Texturing 1. Markus Hadwiger, KAUST

CS GPU and GPGPU Programming Lecture 12: GPU Texturing 1. Markus Hadwiger, KAUST

CS GPU and GPGPU Programming Lecture 16+17: GPU Texturing 1+2. Markus Hadwiger, KAUST

CS451 Texturing 4. Bump mapping continued. Jyh-Ming Lien Department of Computer SCience George Mason University. From Martin Mittring,

Texture and other Mappings

CSE 167: Introduction to Computer Graphics Lecture #8: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016

TEXTURE MAPPING. DVA338 Computer Graphics Thomas Larsson, Afshin Ameri

Texture. Texture Mapping. Texture Mapping. CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

CS 475 / CS 675 Computer Graphics. Lecture 11 : Texture

Shading/Texturing. Dr. Scott Schaefer

Texture Mapping and Sampling

Textures and normals in ray tracing

CT5510: Computer Graphics. Texture Mapping

CPSC / Texture Mapping

Input Nodes. Surface Input. Surface Input Nodal Motion Nodal Displacement Instance Generator Light Flocking

AMCS / CS 247 Scientific Visualization Lecture 10: (GPU) Texture Mapping. Markus Hadwiger, KAUST

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

CS 5600 Spring

Complex Features on a Surface. CITS4241 Visualisation Lectures 22 & 23. Texture mapping techniques. Texture mapping techniques

Textures. Texture coordinates. Introduce one more component to geometry

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Topics and things to know about them:

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Texturing Theory. Overview. All it takes is for the rendered image to look right. -Jim Blinn 11/10/2018

CS 450: COMPUTER GRAPHICS TEXTURE MAPPING SPRING 2015 DR. MICHAEL J. REALE

+ = To Do. Texture Mapping. Adding Visual Detail. Parameterization. Option: Varieties of projections. Computer Graphics. geometry

CS 130 Final. Fall 2015

+ = To Do. Adding Visual Detail. Texture Mapping. Parameterization. Option: Varieties of projections. Foundations of Computer Graphics (Fall 2012)

3D Programming. 3D Programming Concepts. Outline. 3D Concepts. 3D Concepts -- Coordinate Systems. 3D Concepts Displaying 3D Models

Today. Texture mapping in OpenGL. Texture mapping. Basic shaders for texturing. Today. Computergrafik

Shading. Flat shading Gouraud shading Phong shading

lecture 18 - ray tracing - environment mapping - refraction

CS 428: Fall Introduction to. Texture mapping and filtering. Andrew Nealen, Rutgers, /18/2010 1

Computer Graphics. Lecture 8 Antialiasing, Texture Mapping

INFOGR Computer Graphics

Reading. Texture Mapping. Non-parametric texture mapping. Texture mapping. Required. Angel, 8.6, 8.7, 8.9, Recommended

CS 325 Computer Graphics

Pipeline Operations. CS 4620 Lecture 10

Reading. Texture Mapping. Non-parametric texture mapping. Texture mapping. Required. Angel, 8.6, 8.7, 8.9, 8.10,

Graphics and Interaction Rendering pipeline & object modelling

CS451Real-time Rendering Pipeline

The Traditional Graphics Pipeline

Shading. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller/Fuhrmann

Computer Graphics 1. Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

Texture Mapping. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

CS 464 Review. Review of Computer Graphics for Final Exam

The Traditional Graphics Pipeline

CSE 167: Lecture 11: Textures 2. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Graphics for VEs. Ruth Aylett

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

Texturas. Objectives. ! Introduce Mapping Methods. ! Consider two basic strategies. Computação Gráfica

COMP30019 Graphics and Interaction Rendering pipeline & object modelling

Lecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling

4.6 Normal Mapping Simplifying Meshes for Normal Mapped Objects. CHAPTER 4 Surfacing

9. Illumination and Shading

Mach band effect. The Mach band effect increases the visual unpleasant representation of curved surface using flat shading.

Rasterizing triangles

Homework #2. Shading, Ray Tracing, and Texture Mapping


Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

The Traditional Graphics Pipeline

Texture Mapping. Brian Curless CSE 457 Spring 2015

How do we draw a picture?

Rasteriza2on and Clipping

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

Drawing Fast The Graphics Pipeline

Texture Mapping. Reading. Implementing texture mapping. Texture mapping. Daniel Leventhal Adapted from Brian Curless CSE 457 Autumn 2011.

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

Reading. 12. Texture Mapping. Texture mapping. Non-parametric texture mapping. Required. w Watt, intro to Chapter 8 and intros to 8.1, 8.4, 8.6, 8.8.

Computer Graphics. Illumination Models and Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

Texture Mapping. Michael Kazhdan ( /467) HB Ch. 14.8,14.9 FvDFH Ch. 16.3, , 16.6

Interpolation using scanline algorithm

Complex Shading Algorithms

CSE 167: Introduction to Computer Graphics Lecture #9: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Mattan Erez. The University of Texas at Austin

Graphics Hardware and Display Devices

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2014

Chapter 10. Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

Lecture 6: Texture. Kayvon Fatahalian CMU : Graphics and Imaging Architectures (Fall 2011)

Shadows and Texture Mapping

Computer Graphics. - Texturing Methods -

Reading. 18. Projections and Z-buffers. Required: Watt, Section , 6.3, 6.6 (esp. intro and subsections 1, 4, and 8 10), Further reading:

- Rasterization. Geometry. Scan Conversion. Rasterization

Computer Graphics I Lecture 11

CS 4620 Midterm, March 21, 2017

Computer Graphics Texture Mapping

Transcription:

Texturing Anthony Steed 1999, Celine Loscos 2000-2005, Jan Kautz 2006-2009 Texture Mapping Have seen: colour can be assigned to ver7ces But: don t want to represent all this detail with geometry Texture Mapping Considering small details We may not want to add polygons to represent every detail Instead, prefer to keep a large polygon and use an image to represent the details Images: Wikimedia 1

The Quest for Visual Realism Model Model + Shading Model + Shading + Textures Texture Mapping Increase the apparent complexity of simple geometry Efficient packing of flat detail Like wallpapering or gik wrapping with stretchy paper Texture Mapping Standard texture mapping modifies diffuse component Pas7ng a picture onto the polygon A texture is a 2D array of texels storing RGB (or RGBA) components 2

Difference between pixels and texels There can be a different match between the pixels of the display window and the texel of the texture Overview Texture mapping Inverse and Forward Mapping Bilinear interpola7on Perspec7ve correc7on Mipmapping Other forms of mapping Environment Bump mapping Inverse Mapping Each vertex is associated with a point on an image (u,v) 3

Forward Mapping For points in the image, map onto the polygon much harder to implement correctly, and harder to model Inverse mapping is much more commonly used Most 3D modelers output U,V co ordinates for texture applica7on Quick and Dirty Solu7on Yet more parameters in the ET! Bilinear interpola7on of u&v down polygon edges, and across scan lines Works, but is very ugly Does not consider fore shortening of image in depth The Problem Same problem exists with Phong and Gouraud shading, but MUCH less no7ceable 4

The Solu7on Need to compensate for fore shortening by interpola7ng over 1/z Interpolate (u,v,q) where q=1/z At ver7ces we know (u 1,v 1,z 1 ), (u 2,v 2,z 2 ) Interpolate between (u1/z1,v1/z1,1/z1) 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 Sanity Check p i =(x i,y i,z i,u i,v i ) p1=(15,15,20,0,1) p0=(10,5,10,0,0) scanlines Y=15 Y=10 Y=5 At p0 (u,v,q) = (0,0,0.1) At p1 (u,v,q) = (0,0.05,0.05) On scanline 10 (u,v,q) = (0,0.025,0.075) (u,v) = (0,0.333) z = 1/0.075 = 13.33 Minor Issues Now have two divisions per pixel! Some op7misa7ons only do the division at end of the spans and interpolate across spans or only do the division every n pixels Remaining problem we have not touched upon how to clip u,v values in 3D or 2D! 5

Picking your pixel! Major Issues image Sampling A pixel maps to a non rectangular region Usually only perform map on centre of pixel S7ll have a problem of over sampling (same texel maps to several pixels) or under sampling the image (pixels only sparsely sample the texels) Filtering Nearest neighbour Bilinear Pick pixel with closest centre Weighted average based on distance to pixel centre 6

Filtering Bilinear filtering (par7ally) solves the oversampling problem since it provides smooth shading between pixels scanline Mip Mapping When undersampling we use mip mapping Resample image at lower resolu7on Create a pyramid of textures. Interpolate texture between two adjacent layers Texture Pyramid 128x128 64x64 32x32... 1x1 7

Sampling Choose two layers based on texel span Choice is made selec7ng the two levels where the du and dv for dx and dy are closest to one Interpolate between four pixels in higher layer and four (or one) in lower layer Filtering Examples Nearest Neighbor Bilinear Filtering Bilinear Filtering (distinct mip map levels) Trilinear Filtering (Mip mapping) Images from: http://www.3dcenter.org/artikel/2003/10-26_a_english.php More Examples Nearest Neighbor Mip Mapping 8

Texture Mapping Difficul7es Tedious to specify texture coordinates Acquiring textures is surprisingly difficult Photographs have projec7ve distor7ons Varia7ons in reflectance and illumina7on Tiling problems Other Forms of Texture Mapping Bump Mapping Displacement Mapping Environment Mapping Bump Mapping Use textures to alter the surface normal Does not change the actual shape of the surface Just shaded as if it were a different shape Sphere w/diffuse Texture Swirly Bump Map Sphere w/diffuse Texture & Bump Map 9

Bump Mapping Treat the texture as a single valued height func7on Compute the normal from the par7al deriva7ves in the texture Another Bump Map Example Bump Map Cylinder w/diffuse Texture Map Cylinder w/texture Map & Bump Map What's Missing? There are no bumps on the silhouene of a bump mapped object Bump maps don t allow self occlusion or self shadowing 10

Displacement Mapping Use the texture map to actually move the surface point The geometry must be displaced before visibility is determined Displacement Mapping Image from: Geometry Caching for Ray Tracing Displacement Maps by Man Pharr and Pat Hanrahan. Note the detailed shadows cast by the stones Environment Maps We can simulate reflec7ons by using the direc7on of the reflected ray to index a spherical texture map at "infinity". Assumes that all reflected rays begin from the same point. 11

What's the Best Layout? Cube Map Environment Mapping Example Terminator II Rasteriza7on Z Buffer for visibility Recap Need to do perspec7ve correct rasteriza7on Texture Mapping Forward / backward Adds detail Need to take care of sampling issues 12