Texture Mapping. Jian Huang. This set of slides references the ones used at Ohio State for instruction.

Similar documents
CS Polygon Scan Conversion. Slide 1

Normals. In OpenGL the normal vector is part of the state Set by glnormal*()

Parabolic Path to a Best Best-Fit Line:

Computer Graphics Hardware An Overview

Parametric curves. Reading. Parametric polynomial curves. Mathematical curve representation. Brian Curless CSE 457 Spring 2015

Bezier curves. Figure 2 shows cubic Bezier curves for various control points. In a Bezier curve, only

Numerical Methods Lecture 6 - Curve Fitting Techniques

9 x and g(x) = 4. x. Find (x) 3.6. I. Combining Functions. A. From Equations. Example: Let f(x) = and its domain. Example: Let f(x) = and g(x) = x x 4

Orientation. Orientation 10/28/15

Computer Graphics. Surface Rendering Methods. Content. Polygonal rendering. Global rendering. November 14, 2005

Assigning colour to pixels or fragments. Modelling Illumination. We shall see how it is done in a rasterization model. CS475/CS675 - Lecture 14

Pattern Recognition Systems Lab 1 Least Mean Squares

The Closest Line to a Data Set in the Plane. David Gurney Southeastern Louisiana University Hammond, Louisiana

Cubic Polynomial Curves with a Shape Parameter

Counting Regions in the Plane and More 1

Intro to Scientific Computing: Solutions

Accuracy Improvement in Camera Calibration

EVALUATION OF TRIGONOMETRIC FUNCTIONS

Math 10C Long Range Plans

Creating Exact Bezier Representations of CST Shapes. David D. Marshall. California Polytechnic State University, San Luis Obispo, CA , USA

Computational Geometry

Reading. Parametric curves. Mathematical curve representation. Curves before computers. Required: Angel , , , 11.9.

Morgan Kaufmann Publishers 26 February, COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Chapter 5.

Arithmetic Sequences

South Slave Divisional Education Council. Math 10C

Eigenimages. Digital Image Processing: Bernd Girod, Stanford University -- Eigenimages 1

Convex hull ( 凸殻 ) property

EM375 STATISTICS AND MEASUREMENT UNCERTAINTY LEAST SQUARES LINEAR REGRESSION ANALYSIS

Improving Template Based Spike Detection

Lighting and Shading. Outline. Raytracing Example. Global Illumination. Local Illumination. Radiosity Example

Two View Geometry Part 2 Fundamental Matrix Computation

Image Segmentation EEE 508

Force Network Analysis using Complementary Energy

MATHEMATICAL METHODS OF ANALYSIS AND EXPERIMENTAL DATA PROCESSING (Or Methods of Curve Fitting)

OCR Statistics 1. Working with data. Section 3: Measures of spread

CMSC Computer Architecture Lecture 12: Virtual Memory. Prof. Yanjing Li University of Chicago

Alpha Individual Solutions MAΘ National Convention 2013

Graphics (Output) Primitives. Chapters 3 & 4

1. Sketch a concave polygon and explain why it is both concave and a polygon. A polygon is a simple closed curve that is the union of line segments.

Wavelet Transform. CSE 490 G Introduction to Data Compression Winter Wavelet Transformed Barbara (Enhanced) Wavelet Transformed Barbara (Actual)

COMP 558 lecture 6 Sept. 27, 2010

Overview Chapter 12 A display model

Projection Transformations. and

EE 584 MACHINE VISION

Derivation of perspective stereo projection matrices with depth, shape and magnification consideration

Diego Nehab. n A Transformation For Extracting New Descriptors of Shape. n Locus of points equidistant from contour

Extended Space Mapping with Bézier Patches and Volumes

Eigenimages. Digital Image Processing: Bernd Girod, 2013 Stanford University -- Eigenimages 1

EECS 442 Computer vision. Multiple view geometry Affine structure from Motion

Designing a learning system

Fundamentals of Media Processing. Shin'ichi Satoh Kazuya Kodama Hiroshi Mo Duy-Dinh Le

Using the Keyboard. Using the Wireless Keyboard. > Using the Keyboard

EECS 442 Computer vision. Multiple view geometry Affine structure from Motion

Assignment 5; Due Friday, February 10

Texture Mapping. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Consider the following population data for the state of California. Year Population

CSC 220: Computer Organization Unit 11 Basic Computer Organization and Design

9.1. Sequences and Series. Sequences. What you should learn. Why you should learn it. Definition of Sequence

Chapter 18: Ray Optics Questions & Problems

Learning to Shoot a Goal Lecture 8: Learning Models and Skills

Lenses and imaging. MIT 2.71/ /10/01 wk2-a-1

condition w i B i S maximum u i

Computer Graphics. Shading. Page. Copyright Gotsman, Elber, Barequet, Karni, Sheffer Computer Science, Technion. The Physics

Lecture 24: Bezier Curves and Surfaces. thou shalt be near unto me Genesis 45:10

Chapter 9. Pointers and Dynamic Arrays. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

A Very Simple Approach for 3-D to 2-D Mapping

Chapter 3 MATHEMATICAL MODELING OF TOLERANCE ALLOCATION AND OVERVIEW OF EVOLUTIONARY ALGORITHMS

Visualization of Gauss-Bonnet Theorem

Why Do We Care About Lighting? Computer Graphics Lighting. The Surface Normal. Flat Shading (Per-face) Setting a Surface Normal in OpenGL

Math Section 2.2 Polynomial Functions

Lenses and Imaging (Part I) Parabloid mirror: perfect focusing

Section 4. Imaging and Paraxial Optics

Single-view Metrology and Camera Calibration

The isoperimetric problem on the hypercube

AP B mirrors and lenses websheet 23.2

Aberrations in Lens & Mirrors (Hecht 6.3)

Basic allocator mechanisms The course that gives CMU its Zip! Memory Management II: Dynamic Storage Allocation Mar 6, 2000.

PLEASURE TEST SERIES (XI) - 04 By O.P. Gupta (For stuffs on Math, click at theopgupta.com)

( n+1 2 ) , position=(7+1)/2 =4,(median is observation #4) Median=10lb

The Graphs of Polynomial Functions

The Platonic solids The five regular polyhedra

GRADIENT DESCENT. Admin 10/24/13. Assignment 5. David Kauchak CS 451 Fall 2013

FINITE DIFFERENCE TIME DOMAIN METHOD (FDTD)

Performance Plus Software Parameter Definitions

Chapter 3 Classification of FFT Processor Algorithms

Recursive Procedures. How can you model the relationship between consecutive terms of a sequence?

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 13 Control and Sequencing: Hardwired and Microprogrammed Control

How do we evaluate algorithms?

Reading. Subdivision curves and surfaces. Subdivision curves. Chaikin s algorithm. Recommended:

SD vs. SD + One of the most important uses of sample statistics is to estimate the corresponding population parameters.

The Nature of Light. Chapter 22. Geometric Optics Using a Ray Approximation. Ray Approximation

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

IMP: Superposer Integrated Morphometrics Package Superposition Tool

Lenses and Imaging (Part I)

Single-view Metrology and Camera Calibration

. Perform a geometric (ray-optics) construction (i.e., draw in the rays on the diagram) to show where the final image is formed.

CS 111: Program Design I Lecture 21: Network Analysis. Robert H. Sloan & Richard Warner University of Illinois at Chicago April 10, 2018

Structure from motion

Area As A Limit & Sigma Notation

Rendering. Ray Tracing

Transcription:

Texture Mappig Jia Huag This set of slides refereces the oes used at Ohio State for istructio.

Ca you do this

What Dreams May Come

Texture Mappig Of course, oe ca model the exact micro-geometry + material property to cotrol the look ad feel of a surface But, it may get extremely costly So, graphics use a more practical approach texture mappig

Texture Mappig Particles ad fractals gave us lots of detail iformatio ot easy to model mathematically ad computatioally challegig

Texture Mappig (Sophisticated) Illumiatio models gave us photo -realistic lookig surfaces ot easy to model mathematically ad computatioally challegig Phog illumiatio/shadig easy to model relatively quick to compute oly gives us dull surfaces

Texture Mappig Surfaces i the wild are very complex Caot model all the fie variatios We eed to fid ways to add surface detail How?

Texture Mappig Solutio - (its really a cheat!!) MAP surface detail from a predefied multi-dimesioal table ( texture ) to a simple polygo How?

Textures Make A Differece Good textures, whe applied correctly, make a world of differece!

A Texture ca be? F(u,v) ==> a cotiuous or discrete fuctio of: { R(u,v), G(u,v), B(u,v) } { I(u,v) } { idex(u,v) } { alpha(u,v) } (trasparecy) { ormals(u,v) } (bump map) { surface_height(u,v) } (displacemet map) Specular color (eviromet map)

The Geeralized Pipelie The geeralized pipelie of texture mappig Compute obj space locatio Use proj fuc to fid (u,v) Use corre fuc to fid texel Apply value trasform fuc Modify equatio or fragmet color Fragmet: after rasterizatio, the data are ot pixels yet, but are fragmets. Each fragmet has coordiate, color, depth, ad udergo a series of tests ad ops before showig up i the framebuffer

Texture Mappig Problem #1 Fittig a square peg i a roud hole We deal with o-liear trasformatios Which parts map where?

Iverse Mappig Need to trasform back to obj/world space to do the iterpolatio Orietatio i 3D image space (.5,1) (.8,1) (.5,.7) (.1,.6) (.6,.2) Foreshorteig

Texture Mappig Problem #2 Mappig from a pixel to a texel Aliasig is a huge problem!

Mappig to A Texel? Basically map to a image Need to iterpolate Same as. How ca I fid a appropriate value for a arbitrary (ot ecessarily iteger) idex? How would I rotate a image 45 degrees? How would I traslate it 0.5 pixels?

Iterpolatio Nearest eighbor Liear Iterpolatio

How do we get F(u,v)? We are give a discrete set of values: F[i,j] for i=0,,n, j=0,,m Nearest eighbor: F(u,v) = F[ roud(n*u), roud(m*v) ] Liear Iterpolatio: i = floor(n*u), j = floor(m*v) iterpolate from F[i,j], F[i+1,j], F[i,j+1], F[i+1,j+1] Filterig i geeral!

How do we get F(u,v)? Higher-order iterpolatio F(u,v) = å i å j F[i,j] h(u,v) h(u,v) is called the recostructio kerel Gaussia Sic fuctio splies Like liear iterpolatio, eed to fid eighbors. Usually four to sixtee

Texture ad Texel Each pixel i a texture map is called a Texel Each Texel is associated with a (u,v) 2D texture coordiate The rage of u, v is [0.0,1.0]

(u,v) tuple For ay (u,v) i the rage of (0-1, 0-1), we ca fid the correspodig value i the texture usig some iterpolatio

The Projector Fuctio 1. Model the mappig: (x,y,z) -> (u,v) 2. Do the mappig

Image space sca For each y /* sca-lie */ For each x /* pixel o sca-lie */ compute u(x,y) ad v(x,y) copy texture(u,v) to image(x,y) Samples the warped texture at the appropriate image pixels. iverse mappig

Image space sca Problems: Fidig the iverse mappig Use oe of the aalytical mappigs Bi-liear or triagle iverse mappig May miss parts of the texture map Image Texture

Texture Parameterizatio Defiitio: The process of assigig texture coordiates or a texture mappig to a object. The mappig ca be applied: Per-pixel Per-vertex

Iterpolatio Cocepts T is texture Fid textures at vertices first! t 1 y s T a T p T b P 1 1-t 1 s 1-s t 2 1-t 2 P 3 P 2

Quads? P 3 P 4 P 2 y s t a t p t b P 1 Biliear Iterpolatio of Depth Values

Texture space sca For each v For each u compute x(u,v) ad y(u,v) copy texture(u,v) to image(x,y) Places each texture sample to the mapped image pixel. Forward mappig

Texture space sca Problems: May ot fill image Forward mappig eeded Texture Image

Simple Projector Fuctios Spherical Cylidrical Plaar For some model, a sigle projector fuctio suffices. But very ofte, a artist may choose to subdivide each object ito parts that use differet projector

Plaar Mappig to a 3D Plae Simple Affie trasformatio rotate scale y v traslate z x u

Cylidrical Mappig to a Cylider Rotate, traslate ad scale i the uv-plae u -> q v -> z x = r cos(q), y = r si(q) v u

Spherical Mappig to Sphere Impossible!!!! Severe distortio at the poles u -> q v -> f x = r si(q) cos(f) y = r si(q) si(f) z = r cos(q)

Two-pass Mappig Idea by Bier ad Sloa S: map from texture space to itermediate space O: map from itermediate space to object space

Two-pass Mappig Map texture to itermediate: Plae Cylider Sphere Box Map object to same. v u u-axis

Texture Mappig O mappig: reflected ray (eviromet map) object ormal object cetroid itermediate surface ormal (ISN) that makes 16 combiatios oly 5 were foud useful

Texture Mappig Cylider/ISN (shrikwrap) Works well for solids of revolutio Plae/ISN (projector) Works well for plaar objects Box/ISN Sphere/Cetroid Box/Cetroid Works well for roughly spherical shapes

Texture Parameterizatio What is this ISN? Itermediate surface ormal. Needed to hadle cocave objects properly. Sudde flip i texture coordiates whe the object crosses the axis.

Texture Parameterizatio Flip directio of vector such that it poits i the same half-space as the outward surface ormal.

Texture Parameterizatio Plae/ISN

Texture Parameterizatio Plae/ISN Draw vector from poit (vertex or object space pixel poit) i the directio of the texture plae. The vector will itersect the plae at some poit depedig o the coordiate system

Texture Parameterizatio Plae/ISN Resembles a slide projector Distortios o surfaces perpedicular to the plae.

Texture Parameterizatio Cylider/ISN Distortios o horizotal plaes Draw vector from poit to cylider Vector coects poit to cylider axis

Texture Parameterizatio Sphere/ISN Small distortio everywhere. Draw vector from sphere ceter through poit o the surface ad itersect it with the sphere.

Iterpolatig Without Explicit Iverse Trasform Sca-coversio ad color/z/ormal iterpolatio take place i scree space, but really, what space should it be i? What about texture coordiates? Do it i clip space, or homogeous coordiates

I Clip space Two ed poits of a lie segmet (sca lie) Iterpolate for a poit Q i-betwee

I Scree Space From the two ed poits of a lie segmet (sca lie), iterpolate for a poit Q i-betwee: Where: Easy to show: i most occasios, t ad t s are differet

From t s to t Chage of variable: choose a ad b such that 1 t s = a/(a + b), t s = b/(a + b) A ad B such that (1 t)= A/(A + B), t = B/(A + B). Easy to get Easy to verify: A = aw 2 ad B = bw 1 is a solutio

Texture Coordiates All such iterpolatio happes i homogeeous space. Use A ad B to liearly iterpolate texture coordiates The homogeeous texture coordiate is: (u,v,1)

Homogeeous Texture Coordiates u l = A/(A+B) u 1l + B/(A+B)u l 2 w l = A/(A+B) w 1l + B/(A+B)w l 2 = 1 u = u l /w l = u l = (Au 1l + Bu 2l )/(A + B) u = (au 1l + Bu 2l )/(A + B) u = (au 1l /w 1l + bu 2l /w 2l )/(a 1 /w 1l + b 1 /w 2l )

Homogeeous Texture Coordiates The homogeeous texture coordiates suitable for liear iterpolatio i scree space is computed simply by Dividig the texture coordiates by scree w Liearly iterpolatig (u/w,v/w,1/w) Dividig the quatities u/w ad v/w by 1/w at each pixel to recover the texture coordiates