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

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

Texture mapping. Computer Graphics CSE 167 Lecture 9

3D Rasterization II COS 426

TEXTURE MAPPING. DVA338 Computer Graphics Thomas Larsson, Afshin Ameri

CSE528 Computer Graphics: Theory, Algorithms, and Applications

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

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

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

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

CPSC / Texture Mapping

Computer Graphics. Lecture 8 Antialiasing, Texture Mapping

Computer Graphics 7 - Texture mapping, bump mapping and antialiasing

Computer Graphics. - Texturing Methods -

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

CS 354R: Computer Game Technology

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

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

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

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 and Sampling

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

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

Texture Mapping. Brian Curless CSE 457 Spring 2015

CS 431/636 Advanced Rendering Techniques

Pipeline Operations. CS 4620 Lecture 10

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

Texture Mapping. Brian Curless CSE 457 Spring 2016

Textures. Texture coordinates. Introduce one more component to geometry

CS 130 Final. Fall 2015

CS 488. More Shading and Illumination. Luc RENAMBOT

Texture and other Mappings

Einführung in Visual Computing

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

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

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

Textures and normals in ray tracing

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

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

Barycentric Coordinates and Parameterization

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

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

INF3320 Computer Graphics and Discrete Geometry

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.

Mattan Erez. The University of Texas at Austin

Shading. Flat shading Gouraud shading Phong shading

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

More Texture Mapping. Texture Mapping 1/46

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

lecture 18 - ray tracing - environment mapping - refraction

Overview. Hierarchy. Level of detail hierarchy Texture maps Procedural shading and texturing Texture synthesis and noise.

Graphics for VEs. Ruth Aylett

Lecture 11of 41. Surface Detail 2 of 5: Textures OpenGL Shading

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

Graphics for VEs. Ruth Aylett

CMSC427 Final Practice v2 Fall 2017

Computer Graphics. - Texturing - Philipp Slusallek

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

Texture Mapping and Special Effects

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

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

Pipeline Operations. CS 4620 Lecture 14

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

COMP environment mapping Mar. 12, r = 2n(n v) v

CS 464 Review. Review of Computer Graphics for Final Exam

Texture Mapping. The Quest for Visual Realism. Photo-textures

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

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

Computer Science 426 Midterm 3/11/04, 1:30PM-2:50PM

Texture. Detail Representation

CS 4620 Program 3: Pipeline

Motivation. towards more realism. + Texture Mapping Texture Mapping

Sign up for crits! Announcments

Illumination and Shading

Rendering and Radiosity. Introduction to Design Media Lecture 4 John Lee

0. Introduction: What is Computer Graphics? 1. Basics of scan conversion (line drawing) 2. Representing 2D curves

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

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

CS 5600 Spring

The Traditional Graphics Pipeline

Soft shadows. Steve Marschner Cornell University CS 569 Spring 2008, 21 February

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

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

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

v. T u. Textures. Perlin, SIGGRAPH85. Werner Purgathofer

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

Triangle meshes I. CS 4620 Lecture Kavita Bala (with previous instructor Marschner) Cornell CS4620 Fall 2015 Lecture 2

Topics and things to know about them:

The Traditional Graphics Pipeline

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

Hardware-Assisted Relief Texture Mapping

CT5510: Computer Graphics. Texture Mapping

Surface Rendering. Surface Rendering

CS5620 Intro to Computer Graphics

The University of Calgary

Graphics and Interaction Surface rendering and shading

Lecture outline Graphics and Interaction Surface rendering and shading. Shading techniques. Introduction. Surface rendering and shading

Procedural Modeling. Last Time? Reading for Today. Reading for Today

Texture Mapping 1/34

Complex Shading Algorithms

Computer Graphics Disciplines. Grading. Textbooks. Course Overview. Assignment Policies. Computer Graphics Goals I

Transcription:

Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 23: Texture Mapping http://inst.eecs.berkeley.edu/~cs184 Submit HW5 milestone To Do Prepare for final push on HW 5, HW 6 Many slides from Greg Humphreys, UVA and Rosalee Wolfe, DePaul tutorial teaching texture mapping visually Chapter 11 in text book covers some portions Texture Mapping Important topic: nearly all objects textured Wood grain, faces, bricks and so on Adds visual detail to scenes Meant as a fun and practically useful lecture Adding Visual Detail Basic idea: use images instead of more polygons to represent fine scale color variation Polygonal model With surface texture Parameterization Option: Varieties of projections + = geometry image texture map Q: How do we decide where on the geometry each color from the image should go? [Paul Bourke] 1

Option: unfold the surface Option: make an atlas [Piponi2000] charts atlas surface [Sander2001] Option: it s the artist s problem Outline Types of projections Interpolating texture coordinates Broader use of textures How to map object to texture? To each vertex (x,y,z in object coordinates), must associate 2D texture coordinates (s,t) So texture fits nicely over object Idea: Use Map Shape Map shapes correspond to various projections Planar, Cylindrical, Spherical First, map (square) texture to basic map shape Then, map basic map shape to object Or vice versa: Object to map shape, map shape to square Usually, this is straightforward Maps from square to cylinder, plane, sphere well defined Maps from object to these are simply spherical, cylindrical, cartesian coordinate systems 2

Planar mapping Like projections, drop z coord (s,t) = (x,y) Problems: what happens near z = 0? Cylindrical Mapping Cylinder: r, θ, z with (s,t) = (θ/(2π),z) Note seams when wrapping around (θ = 0 or 2π) Spherical Mapping Cube Mapping Convert to spherical coordinates: use latitude/long. Singularities at north and south poles Cube Mapping Outline Types of projections Interpolating texture coordinates Broader use of textures 3

1 st idea: Gouraud interp. of texcoords I I a = I ( y y ) + I ( y y ) 1 s 3 3 1 s 1 y y 1 y 3 1 I a = I (x x ) + I (x x ) a b p b p a x I a y I b x a I p b Scan line s y 2 y 3 I 2 I a = I 1 ( y s y 2 ) + I 2 ( y 1 y s ) y 1 y 2 Actual implementation efficient: difference equations while scan converting I 3 Artifacts McMillan s demo of this is at http://graphics.lcs.mit.edu/classes/6.837/f98/lecture21/slide05.html Another example http://graphics.lcs.mit.edu/classes/6.837/f98/lecture21/slide06.html What artifacts do you see? Why? Why not in standard Gouraud shading? Hint: problem is in interpolating parameters Wikipedia page Interpolating Parameters Texture Mapping The problem turns out to be fundamental to interpolating parameters in screen-space Uniform steps in screen space uniform steps in world space Linear interpolation of texture coordinates Correct interpolation with perspective divide Hill Figure 8.42 Interpolating Parameters Perspective foreshortening is not getting applied to our interpolated parameters Parameters should be compressed with distance Linearly interpolating them in screen-space doesn t do this Perspective-Correct Interpolation Skipping a bit of math to make a long story short Rather than interpolating u and v directly, interpolate u/z and v/z These do interpolate correctly in screen space Also need to interpolate z and multiply per-pixel Problem: we don t know z anymore Solution: we do know w ~ 1/z So interpolate uw and vw and w, and compute u = uw/w and v = vw/w for each pixel This unfortunately involves a divide per pixel http://graphics.lcs.mit.edu/classes/6.837/f98/lecture21/slide14.html 4

Texture Map Filtering Naive texture mapping aliases badly Look familiar? int uval = (int) (u * denom + 0.5f); int vval = (int) (v * denom + 0.5f); int pix = texture.getpixel(uval, vval); Actually, each pixel maps to a region in texture PIX < TEX Easy: interpolate (bilinear) between texel values PIX > TEX Hard: average the contribution from multiple texels PIX ~ TEX Still need interpolation! Mip Maps Keep textures prefiltered at multiple resolutions For each pixel, linearly interpolate between two closest levels (e.g., trilinear filtering) Fast, easy for hardware Why Mip maps? MIP-map Example Outline No filtering: MIP-map texturing: AAAAAAAGH MY EYES ARE BURNING Where are my glasses? Types of projections Interpolating texture coordinates Broader use of textures Texture Mapping Applications Modulation, light maps Bump mapping Displacement mapping Illumination or Environment Mapping Procedural texturing And many more Modulation textures Map texture values to scale factor Texture value Wood texture n I = T( s, t)( I E + K AI A + ( KD( N L) + KS ( V R) ) SLI L + KT IT + KSIS ) L 5

Bump Mapping Displacement Mapping Texture = change in surface normal! Sphere w/ diffuse texture Swirly bump map Sphere w/ diffuse texture and swirly bump map Illumination Maps Environment Maps Quake introduced illumination maps or light maps to capture lighting effects in video games Texture map: Light map Texture map + light map: Images from Illumination and Reflection Maps: Simulated Objects in Simulated and Real Environments Gene Miller and C. Robert Hoffman SIGGRAPH 1984 Advanced Computer Graphics Animation Course Notes Texture values indexed by 3D location (x,y,z) Expensive storage, or Compute on the fly, e.g. Perlin noise à Solid textures Procedural Texture Gallery 6

7