Joshua Barczak* CMSC435 UMBC

Slides:



Advertisements
Similar presentations
CSE 781 Anti-aliasing for Texture Mapping. Quality considerations So far we just mapped one point – results in bad aliasing (resampling problems) We really.
Advertisements

Graphics Pipeline.
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.
Texture Mapping CMSC435 UMBC *With lots of borrowing from the usual victims…
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
Texture Mapping. Typical application: mapping images on geometry 3D geometry (quads mesh) + RGB texture 2D (color-map) =
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 Inf4/MSc Computer Graphics Lecture 13 Illumination I – Local Models.
Sampling, Aliasing, & Mipmaps
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.
(conventional Cartesian reference system)
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 18: Shading & Texture Mapping Many slides from Greg.
Texture Mapping Texture Mapping Ltjg Omer Arisut Turkish Navy Turkish Navy Texture Mapping Texture Mapping Ltjg Omer Arisut Turkish Navy Turkish Navy.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Texture Mapping CMSC435 UMBC *With lots of borrowing from the usual victims…
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.
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.
Week 8 - Monday.  What did we talk about last time?  Workday  Before that:  Image texturing ▪ Magnification ▪ Minification  Mipmapping  Summed area.
Computer Graphics Inf4/MSc Computer Graphics Lecture 7 Texture Mapping, Bump-mapping, Transparency.
CS 638, Fall 2001 Admin Grad student TAs may have had their accounts disabled –Please check and the lab if there is a problem If you plan on graduating.
ECSE 4750: Computer Graphics Rensselaer Polytechnic Institute Nov 5, 2012 Texture and Texture Mapping.
Computer Graphics Texture Mapping
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.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Mesh Color Cem Yuksel John Keyser Donald H. House Texas A&M University SIGGRAPH /12/06 Xiang.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
1 Texture Mapping. 2 Texture Aliasing MIPmaps Environment Mapping Bump Mapping Displacement Mapping Shadow Maps Solid Textures Antialiasing.
Computing & Information Sciences Kansas State University Lecture 10 of 42CIS 636/736: (Introduction to) Computer Graphics CIS 636/736 Computer Graphics.
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.
CS418 Computer Graphics John C. Hart
Lecture Fall 2001 From S. Zeki, Inner Vision.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
CS 450: COMPUTER GRAPHICS TEXTURE MAPPING SPRING 2015 DR. MICHAEL J. REALE.
MIT EECS 6.837, Durand and Cutler Texture Mapping & Other Fun Stuff.
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.
Texturing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Antialiasing. What is alias? Alias - A false signal in telecommunication links from beats between signal frequency and sampling frequency (from dictionary.com)
Week 7 - Wednesday CS361.
CSE 167 [Win 17], Lecture 18: Texture Mapping Ravi Ramamoorthi
CENG 477 Introduction to Computer Graphics
Texture Mapping cgvr.korea.ac.kr.
ATEC Procedural Animation
ATCM 3310 Procedural Animation
Texture Mapping COMP575/COMP770.
So Far We have assumed that we know: The point The surface normal
*With lots of borrowing from the usual victims…
Anti-aliasing for Texture Mapping
Chapters VIII Image Texturing
Interactive Graphics Algorithms Ying Zhu Georgia State University
Introduction to Texture Mapping
3D Game Programming Texture Mapping
Procedural Animation Lecture 6: Mapping
ATCM 6317 Procedural Animation
CS5500 Computer Graphics May 29, 2006
Advanced Computer Graphics: Texture
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Environment Mapping.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Introduction to Ray Tracing
Presentation transcript:

Joshua Barczak* CMSC435 UMBC Texture Mapping Joshua Barczak* CMSC435 UMBC *With lots of borrowing from the usual victims…

Motivation Flat and Boring “Textured”

Texture Mapping “Texture” Boring Geometry Texture  An image that’s mapped onto something Texel  Texture pixel (Also, an island in Denmark…)

Texture Mapping Interesting Geometry

Kinds of Functions Stuff we might want to map Color Opacity Normals Displacement Specularity Precomputed Lighting

Texture Mapping Mapping Function 2D Texture Coordinate 3D Coordinate Texture Image

Texture Coordinates as RGB Normalized 2D space 0-1 on each axis Letters vary: U,V are most common GL/RMan specs like s,t Typically periodic D3D v Texture Coordinates as RGB OGL t s

Scale UV Coordinates  Alter texture frequency Texture Tiling 1,0 0,1 0,0 2,0 0,2 0,0 Scale UV Coordinates  Alter texture frequency 4,0 0,4 0,0 8,0 0,8 0,0

Planar Mapping For xy aligned plane Reverse projection 9 9

Planar Mapping 10 10

Cylindrical Mapping For cylinder with point Texture coordinates (r cos Θ, r sin Θ, h z) Texture coordinates (u,v) =(Θ/2π, z) 11 11

Cylindrical Mapping 12 12

Spherical Mapping For sphere with point Texture coordinates (r cos Θ sin Φ, r sin Θ sin Φ, r cos Φ) Texture coordinates 13 13

Spherical Mapping 14 14

Mapping onto Parametric Patches Use scaled surface u,v parameters for texture u,v 15 15

Mapping onto Parametric Patches 16 16

Mapping onto Polygons Explicit per-vertex coordinates… Wikipedia

Perspective Correction One does not simply interpolate values over a projected triangle… I’ve been snowing you so far… Wikipedia

Perspective Correction Worldspace midpoint Screenspace midpoint The lines sweep out the same points, but at different ‘t’ values

Perspective Correction Project interpolated points != Interpolate projected points B P A Not with ten thousand interpolators could you do this! It is madness!

Perspective Correction 1/w will interpolate u/w will interpolate

Perspective Correction Given vertices (x,y,z,w) and UV coords (u,v) Compute 1/w at each vertex Compute u/w, v/w at each vertex Use multiplication! Interpolate 1/w, u/w, v/w in screenspace Divide u/w,v/w by 1/w at each pixel “Perspective Divide”

Texture Atlas Properties of good UV layout: Minimizes stretch Maximize packing efficiency Easy for artist to paint into Unlike that one… Automatic is possible, but manual often preferred Zhou et al.

Texture Atlas Not always a 1:1 mapping

Peter Kojesta (Gamasutra) Texture Seams Discontinuity at UV chart boundaries Solutions: Fix them: Copy/Blend texels across boundary Hide them Armpits, ankles, backs of heads, under clothing Peter Kojesta (Gamasutra)

Environment Mapping Surround scene with maps simulating surrounding detail 26 26

Distant Reflection Look up reflection direction in reflection or environment map 27 27

Cubic Environment Maps Pick a face based on largest normal component Project onto the face Divide through Use resulting coordinates for 2D lookup DirectX Documentation

Spherical Environment Maps Photograph of shiny sphere Lookup based on x/y coordinates of normal DirectX Documentation

Texture Sampling Point Sampling Map UV coordinate onto texel grid, grab corresponding texel i = floor(u*width) j = floor(v*height) Just like in 1995

Point Sampling Point sampling under magnification

Filtered Sampling Bilinear Filtering Interpolate texels in 2x2 neighborhood Top-left texel: floor(u*(width-1)), floor(v*(height-1)) Weight by fractional coordinates

Point Sampling Point sampling under magnification

Linear Sampling Linear sampling under magnification

3D Textures Array of 2D slices 3D Coordinates (u,v,w) Bilinear tap in each slice using u,v Blend using w

Minification Aliasing! Pixels:Texels < 1: Minification Pixels:Texels > 1: Magnification

Minification Filtering Anti-aliasing problem Projected pixel footprint Texel grid Large jumps between pixels. Texture is undersampled…

Minification Filtering One solution: Just super-sample it Problems: - Expensive - Guessing the right sampling rate - Performance death spiral for heavy minification

Mip-Mapping Prefiltering: Precalculate chain of filtered images Each level is ½ previous resolution From Latin: "multum in parvo" (much in little)

Mip-Mapping Memory overhead is 33% Level i+1 is ½ resolution of i: So… W/2*H/2=WH/4 So… Geometric series

Mip-Mapping Derive footprint using UV derivatives in screenspace du/dy, dv/dy du/dx, dv/dx

Mip-Mapping Approximate footprint with a square W = Width of square in texels Find mip level matching footprint size w

Mip-Mapping Width of square in texels Finest level that won’t alias Base texels per ith level texel “Just Right” Magnification Aliasing Level of detail …

Mip-Mapping Level i Blend bilinear taps at two nearest levels (8 texels accessed) Sometimes incorrectly called “Trilinear” Increasing footprint size Level i+1

Without

With

Getting Derivatives Rasterizer: 2x2 Quads + Differencing Missing pixels are extrapolated… Each 2x2 quad is self-contained This is a collosal pain in the collective necks of hardware architects

Getting Derivatives Raytracer Intersect “differential” rays with tangent plane Track derivatives during secondary bounces

Mip-Mapping Advantages: Cheap approximation to super-sampling Ensures 1:1 pixel/texel ratio May actually be FASTER than bilinear Avoids cache thrashing

Mip-Mapping Disadvantages: Needs derivatives 33% Memory overhead Complicates renderer 33% Memory overhead Needs some preprocessing

Anisotropic Filtering Mipmapping is isotropic Same in all directions At oblique angles, footprint is NOT isotropic Result: Too much blur

Anisotropic Filtering Ideal solution: Elliptical Weighted Average (EWA) Anisotropic gaussian kernel “Gold Standard”

Anisotropic Filtering Actual Solution: Approximate ellipse with rectangle Box kernel Minor axis picks level Multiple filter taps along major axis 4x Anisotropic

No mipmapping

Trilinear

4x Anisotropic