travis grant grant_travis@emc

38
CS 563 Advanced Topics in Computer Graphics Texture Sampling & antialiasing - Basic Texturing (Ch. 8) Physically Based Rendering Travis Grant [email protected]

Upload: teresa

Post on 08-Jan-2016

39 views

Category:

Documents


1 download

DESCRIPTION

CS 563 Advanced Topics in Computer Graphics Texture Sampling & antialiasing - Basic Texturing (Ch. 8) Physically Based Rendering. Travis Grant [email protected]. Outline. Texture Space Sampling Rate Aliasing associated with Texture Refracted and Reflected Rays - PowerPoint PPT Presentation

TRANSCRIPT

CS 563 Advanced Topics in Computer Graphics

Texture Sampling & antialiasing - Basic Texturing (Ch. 8)Physically Based Rendering

Travis [email protected]

Outline

[email protected] :: Slide 2

Texture Space Sampling Rate

Aliasing associated with Texture

Refracted and Reflected Rays

Texture Coordinate Generation

Texture Interface and basic textures

[email protected] :: Slide 3

Grid texture on sphere w/ 1 sample per pixel

p. 496 Fig. 11.5 (a) ./images/11F05A.png

Two Core Challenges for removing Texture Aliasing

[email protected] :: Slide 4

Sampling Rate Must be computed in Texture space as

opposed to screen space

Must determine rate which the texture function is being sampled

Sampling Theory Given the sampling rate we need to remove

excess frequencies beyond the Nyquist limit from the texture function

Texture Sampling Rate

p. 488 Fig. 11.2 :: Slide 5

(x0,y0)

(u0,v0)

(u1,v1)

(x1,y1)

(s,t)

PBRT Texture coordinates are (S,T): - Commonly used industry Apps often use (u,v) - PBRT uses (u,v) as a shapes “parametric description” coordinates

p=f(u,v) = p(x,y)- Where p(x,y) is the Worldspace intersection point

image space

object space

texture space

(x,y)

(u,v)

(s,t)

Simple Example:Finding Texture Sampling Rate

rx

xs

s=Px t=Py

[email protected] :: Slide 6

Image Space, Object Space &Texture Space perfectly aligned

ry

yt

thus given a sample spacing of 1 pixel in the image plane the sample spacing in (s,t) texture space is (1/xr, 1/yr)

Simple Example:Finding Texture Sampling

Rate

0

1

y

s

xx

s

r

[email protected] :: Slide 7

Image Space, Object Space &Texture Space perfectly aligned y

fyy

x

fxxyxfyxf

)'()'(),()','(

ryy

tx

t

1

0

Texture Aliasing

Daylon Leveller Tutorial :: Slide 8

- The previous example was purposely kept overly simple:- The following realities all lend to more complex but

common scenarios:Object VisibilityObject ShapePerspectiveShadowingTexture Frequency Variance

Daylon Leveller Tutorial

Texture Sampling Rate

p. 488 Fig. 11.2 :: Slide 9

(x,y)

(u,v)

(s,t)

from image space to world space -> p(x,y)x

p

y

p

x

u

y

u

x

v

y

v

to parametric coordinates -> u(x,y),v(x,y)

Estimating Partial Derivatives

p. 491 Fig. 11.3 :: Slide 10

ppy

px

nry

rx

Estimating Partial Derivatives

p. 491 Fig. 11.3 :: Slide 11

ppy

px

nry

rx

ppx

px

dpdx = ppy

py

dpdy =

0 dczbyaxxna yna

zna )( pnd equation 1

dcba

dcbat

),,(

)0),,((

equation 2

(u,v) parameterization

p. 492 Fig. 11.4 :: Slide 12

p

dv

du

∂u∂p

∂v∂p

p’

(u,v) parameterization

v

p

u

ppp vu

'

[email protected] :: Slide 13

or

v

u

v

pv

pv

p

u

pu

pu

p

pp

pp

pp

z

y

x

z

y

x

z

y

x

'

'

'

Filtering Texture Functions

)),(( yxfTfirst evaluate

band-limit: by convolving with the sinc filter

''))','((')'(sinc)'(sinc),(' dydxyyxxfTyxyxTb

convolved with the pixel filter g(x,y) centered at the point (x,y)

2/

2/

2/

2/

b '')','(')Ty',g(x'),('xWidth

xWidth

yWidth

yWidth

f dydxyyxxyxT

[email protected] :: Slide 14

What did we get for our efforts?

Texture Aliasing

[email protected] :: Slide 16

Severe aliasing artifacts Zoom-In of sphere from leftNotice High-Frequency detail is present

p. 486 Fig. 11.1 (a) ./images/11F01A.png p. 486 Fig. 11.1 (b) ./images/11F01B.png

Texture Aliasing

[email protected] :: Slide 17

Severe aliasing artifacts Texture function applied

p. 486 Fig. 11.1 (a) ./images/11F01A.png p. 486 Fig. 11.1 (c) ./images/11F01C.png

[email protected] :: Slide 18antialiased image, even with a single sample per pixel

p. 496 Fig. 11.5 (c) ./images/11F05C.png

Reflected & Refracted Rays

[email protected] :: Slide 19

Tracking ray differentialsLeft is glass (reflection & refraction)Right is Mirror (reflection)

p. 496 Fig. 11.5 (a) ./images/11F05A.png

Tracking Ray Differentials

[email protected] :: Slide 20

aliasing artifacts antialiasing w/ ray differentials

p. 496 Fig. 11.5 (b) ./images/11F05B.png p. 496 Fig. 11.5 (c) ./images/11F05C.png

Specular Reflection

p. 497 Fig. 11.6 :: Slide 21

r’r

θ θ

θ’ θ’

Specular Reflection

x

ii

www

p. 497 Fig. 11.6 :: Slide 22

iwwhere: is the reflected direction with respect to a shift of a pixel in the x and y directions

nnwww ooi )(2

nx

nw

x

nnw

x

wnnww

xx

w oo

ooo

i 2)(2

x

nwn

x

w

x

nwo

oo

Texture Coordinate Generation

[email protected] :: Slide 23

Different texture coordinate generation techniquesCheckerboard texture applied to a hyperboloid

p. 499 Fig. 11.7 ./images/11F05A.png

(u,v) Spherical Cylindrical Planer

(s,t)

TextureInterfaces and Basic

Texture

Constant Scale Mix Bilinear

References

[email protected] :: Slide 25

“Physically Based Rendering” by Gregg Humphreys & Matt Pharr All Images Obtained from “Physically Based Rendering” CD-ROM Figures recreated by tgrant from figures cited in “Physically Based

Rendering” textbook

Daylon Graphics – Leveller Documentation Raytracer Texturing

www.cambridgeincolour.com (Sean T. Mchugh) Digital Image Interpolation

“Computer Graphics: Principles & Practice” by Foley, van Dam, Feiner, Hughes

“What We Need Around Here is More Aliasing” by Blinn, J.F.

“Return of the Jaggy” by Blinn, J.F.

“The Aliasing Problem in Computer-Generated Shaded Images” by Crow, F.

“A Comparison of Antialiasing Techniques” by Crow, F.

Harvey Mudd College

HMC Tutorial on Partial Differentiation

Questions?

Backup Slides

[email protected] :: Slide 27

Geometric Meaning of Partial Derivatives

Suppose the graph of z = f(x,y) is the surface shown. Consider the partial derivative of f with respect to x at a point (x0,y0).

Holding y constant and varying x, we trace out a curve that is the intersection of the surface with the vertical plane y = y0.

The partial derivative fx(x0,y0) measures the change in z per unit increase in x along this curve. That is, fx(x0,y0) is just the slope of the curve at (x0,y0). The geometrical interpretation of fy(x0,y0) is analogous.

Harvey Mudd College (see References) :: Slide 28

Blinn “What we need around here is more Aliasing” :: Slide 29

Blinn “What we need around here is more Aliasing” :: Slide 30

Blinn “What we need around here is more Aliasing” :: Slide 31

Blinn “What we need around here is more Aliasing” :: Slide 32

Aliasing Review

reproduced from cambridgeincolour.com :: Slide 33

Ideal Line on Low Resolution Grid Aliased

resampled

jaggies = staircasing = aliasing

Aliasing Review

reproduced from cambridgeincolour.com :: Slide 34

Ideal Line on Low Resolution Grid Aliased

resampled

IF (Line_Is_Inside_Pixel) = black

Aliasing Review

reproduced from cambridgeincolour.com :: Slide 35

Ideal Line on Low Resolution Grid Aliased

resampled

High Frequency Variation

Aliasing Review

reproduced from cambridgeincolour.com :: Slide 36

Ideal Line on Low Resolution Grid Anti-Aliased

resampled

Unweighted Area Sampling

reproduced from cambridgeincolour.com :: Slide 37

Ideal Line on Low Resolution Grid Anti-Aliased

resampled

Three Properties of Unweighted area sampling:1) Intensity of the pixel intersected by a line edge decreases as the distance between the pixel center and the edge increases2) Non-intersected pixels are not influenced3) Only the total amount of overlapped area matters (not weighted based on orientation towards the center of the pixel)

Unweighted Area Sampling

reproduced from cambridgeincolour.com :: Slide 38

Ideal Line on Low Resolution Grid Anti-Aliased

resampled

Accounting for contributions of original

-> result is % of BLACK (light Gray)