390 likes | 541 Vues
CS 563 Advanced Topics in Computer Graphics Texture Sampling & antialiasing - Basic Texturing (Ch. 8) Physically Based Rendering. Travis Grant grant_travis@emc.com. Outline. Texture Space Sampling Rate Aliasing associated with Texture Refracted and Reflected Rays
E N D
CS 563 Advanced Topics in Computer GraphicsTexture Sampling & antialiasing - Basic Texturing(Ch. 8)Physically Based Rendering Travis Grant grant_travis@emc.com
Outline • Texture Space Sampling Rate • Aliasing associated with Texture • Refracted and Reflected Rays • Texture Coordinate Generation • Texture Interface and basic textures grant_travis@emc.com :: Slide2
p. 496 Fig. 11.5 (a) ./images/11F05A.png Grid texture on sphere w/ 1 sample per pixel grant_travis@emc.com :: Slide3
Two Core Challenges for removing Texture Aliasing • 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 grant_travis@emc.com :: Slide4
(s,t) (s,t) (u0,v0) (x0,y0) (u,v) (x,y) (u1,v1) (x1,y1) Texture Sampling Rate texture space object space image space 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 p. 488 Fig. 11.2 :: Slide5
Simple Example:Finding Texture Sampling Rate s=Pxt=Py Image Space, Object Space & Texture Space perfectly aligned 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) grant_travis@emc.com :: Slide6
Simple Example:Finding Texture Sampling Rate Image Space, Object Space & Texture Space perfectly aligned grant_travis@emc.com :: Slide7
Texture Aliasing Daylon Leveller Tutorial - The previous example was purposely kept overly simple: - The following realities all lend to more complex but common scenarios: Object Visibility Object Shape Perspective Shadowing Texture Frequency Variance Daylon Leveller Tutorial :: Slide8
(s,t) (u,v) from image space to world space -> p(x,y) (x,y) to parametric coordinates -> u(x,y),v(x,y) Texture Sampling Rate p. 488 Fig. 11.2 :: Slide9
rx ry p px py Estimating Partial Derivatives n p. 491 Fig. 11.3 :: Slide10
Estimating Partial Derivatives rx equation 1 ry n equation 2 p px dpdx = py dpdy = p. 491 Fig. 11.3 :: Slide11
∂p ∂p ∂u ∂v p (u,v) parameterization dv p’ du p. 492 Fig. 11.4 :: Slide12
(u,v) parameterization or grant_travis@emc.com :: Slide13
Filtering Texture Functions first evaluate band-limit: by convolving with the sinc filter convolved with the pixel filter g(x,y) centered at the point (x,y) grant_travis@emc.com :: Slide14
Texture Aliasing p. 486 Fig. 11.1 (b) ./images/11F01B.png p. 486 Fig. 11.1 (a) ./images/11F01A.png Zoom-In of sphere from left Notice High-Frequency detail is present Severe aliasing artifacts grant_travis@emc.com :: Slide16
Texture Aliasing p. 486 Fig. 11.1 (c) ./images/11F01C.png p. 486 Fig. 11.1 (a) ./images/11F01A.png Texture function applied Severe aliasing artifacts grant_travis@emc.com :: Slide17
p. 496 Fig. 11.5 (c) ./images/11F05C.png antialiased image, even with a single sample per pixel grant_travis@emc.com :: Slide18
Reflected & Refracted Rays p. 496 Fig. 11.5 (a) ./images/11F05A.png Tracking ray differentials Left is glass (reflection & refraction) Right is Mirror (reflection) grant_travis@emc.com :: Slide19
Tracking Ray Differentials p. 496 Fig. 11.5 (b) ./images/11F05B.png p. 496 Fig. 11.5 (c) ./images/11F05C.png aliasing artifacts antialiasing w/ ray differentials grant_travis@emc.com :: Slide20
Specular Reflection r r’ θ θ θ’ θ’ p. 497 Fig. 11.6 :: Slide21
Specular Reflection where: is the reflected direction with respect to a shift of a pixel in the x and y directions p. 497 Fig. 11.6 :: Slide22
(s,t) Texture Coordinate Generation p. 499 Fig. 11.7 ./images/11F05A.png (u,v) Spherical Planer Cylindrical Different texture coordinate generation techniques Checkerboard texture applied to a hyperboloid grant_travis@emc.com :: Slide23
TextureInterfaces and Basic Texture • Constant • Scale • Mix • Bilinear
References “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 grant_travis@emc.com :: Slide25
Backup Slides grant_travis@emc.com :: Slide27
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) :: Slide28
Blinn “What we need around here is more Aliasing” :: Slide29
Blinn “What we need around here is more Aliasing” :: Slide30
Blinn “What we need around here is more Aliasing” :: Slide31
Blinn “What we need around here is more Aliasing” :: Slide32
resampled Aliasing Review jaggies = staircasing = aliasing Ideal Line on Low Resolution Grid Aliased reproduced from cambridgeincolour.com :: Slide33
resampled Aliasing Review IF (Line_Is_Inside_Pixel) = black Ideal Line on Low Resolution Grid Aliased reproduced from cambridgeincolour.com :: Slide34
resampled Aliasing Review High Frequency Variation Ideal Line on Low Resolution Grid Aliased reproduced from cambridgeincolour.com :: Slide35
resampled Aliasing Review Ideal Line on Low Resolution Grid Anti-Aliased reproduced from cambridgeincolour.com :: Slide36
resampled Unweighted Area Sampling 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 increases 2) Non-intersected pixels are not influenced 3) Only the total amount of overlapped area matters (not weighted based on orientation towards the center of the pixel) Ideal Line on Low Resolution Grid Anti-Aliased reproduced from cambridgeincolour.com :: Slide37
resampled Unweighted Area Sampling Accounting for contributions of original -> result is % of BLACK (light Gray) Ideal Line on Low Resolution Grid Anti-Aliased reproduced from cambridgeincolour.com :: Slide38