Sampling II, Anti-aliasing, Texture Filtering

Size: px
Start display at page:

Download "Sampling II, Anti-aliasing, Texture Filtering"

Transcription

1 ME-C3100 Computer Graphics, Fall 2017 Jaakko Lehtinen Many slides from Frédo Durand Sampling II, Anti-aliasing, Texture Filtering 1

2 Sampling The process of mapping a function defined on a continuous domain to a discrete one is called sampling The process of mapping a continuous variable to a discrete one is called quantization To represent or render an image using a computer, we must both sample and quantize Today we focus on the effects of sampling continuous value discrete value continuous position discrete position 2

3 Sampling & Reconstruction The visual array of light is a continuous function 1/ We sample it... with a digital camera, or with our ray tracer This gives us a finite set of numbers (the samples) We are now in a discrete world 2/ We need to get this back to the physical world: we reconstruct a continuous function from the samples For example, the point spread of a pixel on a CRT or LCD Reconstruction also happens inside the rendering process (e.g. texture mapping) Both steps can create problems Insufficient sampling or pre-aliasing (our focus today) Poor reconstruction or post-aliasing 3

4 Sampling Example Continuous function 4

5 Sampling Example Sampled discrete function 5

6 Reconstruction Example Nearest neighbor reconstruction 6

7 Reconstruction Example Piecewise linear reconstruction 7

8 Reconstruction Example As you can see, there are many ways of reconstructing a function from the samples. Some are more accurate than others Piecewise cubic reconstruction 8

9 Wiggliness vs. Sampling Density

10 Wiggliness vs. Sampling Density 1.4 2x sampling density

11 Sampling Density If we sample too coarsely, the samples can be mistaken for something simpler during reconstruction This is why it s called aliasing The new (erroneous) low-frequency sine wave is an alias/ghost of the high-frequency one Input Reconstructed 11

12 Pre- vs. Post-Aliasing If the sampling density is too low, no reconstruction method can recover the original function This is pre-aliasing, information was lost in sampling Poor reconstruction is post-aliasing

13 Recap: Texture Aliasing 13

14 Aliasing What Does it Look Like? Nasty mess Nearest neighbor Mess gets blurred out Tri-linear Mip-mapping 14

15 Questions? 15

16 Sampling Density Revisited If we sample too coarsely, the samples can be mistaken for something simpler during reconstruction When does this happen? The signal must not contain frequencies higher than half the sampling density (Nyquist, Shannon, and others) Input Reconstructed 16

17 Sampling Density Revisited So, in order to prevent aliasing, we should either.. Filter the high frequencies out from the signal before sampling (this is called low-pass filtering ) Sample at a higher rate Input Reconstructed 17

18 Solution? Removing high freq s = low-pass filtering = blur In practice, we blur before sampling in order to stop high frequencies from messing our image up In audio, use an analog low-pass filter before sampling For ray tracing/rasterization: compute image at higher resolution, blur, then resample at lower resolution Not exactly a proper low-pass prefilter, because aliasing still happens at the higher resolution, but it s all we can do For textures, we blur the texture before doing the lookup (not necessary to compute in higher resolution first) To understand what really happens, we need semi-serious math (Fourier transforms) 18

19 Digital Cameras Most digital cameras have an optical low-pass filter in front of the sensor Yes, it s essentially a piece of frosted glass (maitolasi) Some cameras don t See comparison between Nikon D800 and D800e 19

20 Blurring Removes High Frequencies Original image High frequencies removed by blur 20

21 Types of Blur Blur = local weighted average Different set of weights => different blur e.g.: box, Gaussian, bilinear, bicubic Box filter: Equally-weighted average of N samples 21

22 Types of Blur Blur = local weighted average Different set of weights => different blur e.g.: box, Gaussian, bilinear, bicubic Bicubic filter: A wider filter with small negative lobes 22

23 Filter Examples Notice that there are still sharp features in the result Original Box filter 23

24 Filter Examples Notice that there are still sharp features in the result Gaussian blur Box filter 24

25 Filter Examples No sharp edges like box, but overall sharper (good) Gaussian blur Bicubic filter 25

26 Blurring: (Discrete) Convolution Input Convolution sign Kernel Convolution of a function and a kernel gives another function. All values in the output function are locally weighted averages of the input function. 26

27 Blurring: (Discrete) Convolution Input Convolution sign Kernel Same shape, just reduced contrast!!! The sine wave is an eigenvector (output is the input multiplied by a constant) This means sines and cosines are particularly simple for convolution 27

28 Animated Convolution See Wikipedia 28

29 (Convolutional Neural Nets) Yes, the CNNs everyone is talking about now are based on precisely this operation. Many layers of convolutions where the kernels are learned Layers separated by point-wise nonlinearities (eg. ReLU) See wikipedia or Goodfellow s Deep Learning book 29

30 Types of Convolution That was discrete; the functions and the kernel were sampled representations defined on a grid There is also a continuous convolution input and output functions and the kernel are defined on a continuous domain weighted sum is replaced by an integral And actually, a semi-discrete one as well! Reconstructing a continuous signal from samples is a convolution as well: you convolve the spiky samples with a continuous reconstruction kernel 30

31 Example: Samples 31

32 Example: Reconstruction Kernel 32

33 1 Sample * Translated Reconstruction Kernel 33

34 All Samples * Translated Kernels 34

35 Final Reconstruction = sum of samples * translated kernels 35

36 Questions? 36

37 Signal Processing 101 Sampling and filtering are best understood in terms of Fourier analysis We already saw aliasing for sine waves: a high frequency sine wave turns into a low frequency one when undersampled 37

38 Remember Fourier Analysis? A signal in the spatial domain has a dual representation in the frequency domain spatial domain frequency domain This particular signal is band-limited, meaning it has no frequencies above some threshold 38

39 Remember Fourier Analysis? We can transform from one domain to the other using the Fourier Transform Just a change of basis: Represent the image in terms of sines and cosines of different frequencies and orientations An invertible transform frequency domain spatial domain Fourier Transform Inverse Fourier Transform 39

40 The Fourier basis functions are sines and cosines each with a certain orientation and frequency v u

41 The Fourier basis functions are sines and cosines each with a certain orientation and frequency v u

42 The Fourier basis functions are sines and cosines each with a certain orientation and frequency v u

43 Fourier Transforms and Series are bread-and-butter signal processing tools you learned in your introductory math classes You can refresh at Wikipedia, again If the complex exponentials feel weird to you, you can just think of it as doing sines and cosines at once through Euler s formula exp(ix) = cos(x) + i sin(x) 43

44 Great animated GIF that illustrates the decomposition 44

45 Questions? 45

46 Remember Convolution? Some operations that are difficult in the spatial domain are simpler in the frequency domain For example, convolution in the spatial domain (local weighted average) is the same as multiplication in the frequency domain. This is because sine waves are eigenfunctions! And, convolution in the frequency domain is the same as multiplication in the spatial domain 46

47 Low-Pass Filter black means 0, white means 1 => frequencies outside circle get set to zero

48 High-Pass Filter black means 0, white means 1 => frequencies inside circle get set to zero

49 Sampling in the Frequency Domain original signal Fourier Transform sampling grid ( impulse train ) (multiplication) Fourier Transform (convolution) sampled signal Fourier Transform Replicated spectra 49

50 Reconstruction Sampling gives us discrete samples at the cost of frequency replicas If we can get rid of the replicas, we can reconstruct the original signal in spatial domain How to get rid of replicas? Low-pass filter, i.e., blur the spiky sampled function! But there may be overlap between the copies This is aliasing Spectrum of sampled function 50

51 Guaranteeing Proper Reconstruction Separate by removing high frequencies from the original signal (low pass pre-filtering before sampling)......or separate replicas by increasing sampling density. If we can't separate the copies, we will have overlapping frequency spectrum during reconstruction aliasing. 51

52 Recap: Sampling/Reconstruction 1/ Prefilter Blur signal with given low-pass filter to remove frequencies that would alias when sampled 2/ Sample From continuous to discrete domain Creates replicas in frequency domain 3/ Reconstruct Get rid of the replicas Another blur: Apply a low-pass filter to the spiky discrete sampled function 52

53 The Sampling Theorem When sampling a signal at discrete intervals, the sampling frequency must be greater than twice the highest frequency of the input signal in order to be able to reconstruct the original perfectly from the sampled version (Shannon, Nyquist, Whittaker, Kotelnikov) 53

54 Questions? 54

55 Supersampling in Graphics Pre-filtering (blurring before sampling) is hard Our primitives have infinite frequencies (e.g., a mathematical triangle has perfectly sharp edges) And we can usually only take point samples of the image Think of your ray tracer! And still difficult to integrate analytically with prefilter Possible for lines, or if visibility is ignored Not very interesting... Usually, fall back to supersampling Just bite the bullet and sample more 55

56 In Practice: Supersampling Your intuitive solution is to compute multiple color values per pixel (at slightly different locations) and average them jaggies w/ antialiasing 56

57 In Practice: Supersampling Your intuitive solution is to compute multiple color values per pixel and average them A better interpretation of the same idea is that You first render a high resolution image You blur it (low-pass, prefilter) You resample it at a lower resolution 57

58 Uniform Supersampling Compute image at resolution k*width, k*height Downsample using low-pass filter (e.g. Gaussian, bicubic, etc.) 58

59 Uniform Supersampling Advantage The first (super)sampling captures more high frequencies that are not aliased Downsampling can use a good filter Issue Frequencies above the (super)sampling limit are still aliased Works well for edges Not as well for repetitive textures We only pushed the problem farther But solutions exist 59

60 Related Idea: Multisampling Problem Shading is very expensive today (complicated shaders) Full supersampling has linear cost in #samples (k*k) Goal: High-quality edge antialiasing at lower cost Solution Compute shading only once per pixel for each primitive, but resolve visibility at sub-pixel level Store (k*width, k*height) frame and z buffers, but share shading results between sub-pixels within a real pixel When visibility samples within a pixel hit different primitives, we get an average of their colors Edges get antialiased without large shading cost 60

61 Multisampling, Visually = sub-pixel visibility sample One pixel 61

62 Multisampling, Visually = sub-pixel visibility sample One pixel 62

63 Multisampling, Visually = sub-pixel visibility sample The color is only computed once per pixel per triangle and reused for all the visibility samples that are covered by the triangle. One pixel 63

64 Supersampling, Visually = sub-pixel visibility sample When supersampling, we compute colors independently for all the visibility samples. One pixel 64

65 Multisampling Pseudocode For each triangle For each pixel if pixel overlaps triangle color=shade() // only once per pixel! for each sub-pixel sample compute edge equations & z if subsample passes edge equations && z < zbuffer[subsample] zbuffer[subsample]=z framebuffer[subsample]=color 65

66 Multisampling Pseudocode For each triangle For each pixel if pixel overlaps triangle color=shade() // only once per pixel! for each sub-pixel sample compute edge equations & z if subsample passes edge equations && z < zbuffer[subsample] zbuffer[subsample]=z framebuffer[subsample]=color At display time: //this is called resolving For each pixel color = average CS-C3100 of Fall 2017 subsamples Lehtinen 66

67 Multisampling vs. Supersampling Supersampling Compute an entire image at a higher resolution, then downsample (blur + resample at lower res) Multisampling Supersample visibility, compute expensive shading only once per pixel, reuse shading across visibility samples But Why? Visibility edges are where supersampling really works Shading can be prefiltered more easily than visibility This is how GPUs perform antialiasing these days 67

68 Questions? 68

69 BUT: Supersampling has its limits 69

70 1 Sample / Pixel 70

71 Supersampling, 16 Samples / Pixel 71

72 100 Samples / Pixel Even this sampling rate cannot get rid of all aliasing artifacts! We are really only pushing the problem farther. 72

73 Questions? 73

74 Texture Filtering Problem: Prefiltering is impossible when you can only take point samples This is why visibility (edges) need supersampling Texture mapping is simpler Imagine again we are looking at an infinite textured plane textured plane 74

75 Texture Filtering We should pre-filter image function before sampling That means blurring the image function with a low-pass filter (convolution of image function and filter) textured plane Low-pass filter 75

76 Texture Filtering We can combine low-pass and sampling The value of a sample is the integral of the product of the image f and the filter h centered at the sample location A local average of the image f weighted by the filter h ˆf i = f(x) h(x)dx image textured plane Low-pass filter 76

77 Texture Filtering Well, we can just as well change variables and compute this integral on the textured plane instead In effect, we are projecting the pre-filter onto the plane textured plane Low-pass filter 77

78 Texture Filtering Well, we can just as well change variables and compute this integral on the textured plane instead In effect, we are projecting the pre-filter onto the plane It s still a weighted average of the texture under filter ˆf i = plane f(x ) h(x ) J(x, x ) dx textured plane Just the usual change of variables formula, you learned in math class, see here Low-pass filter 78

79 Texture Pre-Filtering, Visually textured surface (texture map) image plane Image adapted from McCormack et al. image-space filter image-space filter projected onto plane Must still integrate product of projected filter and texture That doesn t sound any easier... 79

80 Solution: Precomputation We ll precompute and store a set of prefiltered results from each texture with different sizes of prefilters 80

81 Solution: Precomputation We ll precompute and store a set of prefiltered results from each texture with different sizes of prefilters 81

82 Solution: Precomputation We ll precompute and store a set of prefiltered results from each texture with different sizes of prefilters Because it s low-passed, we can also subsample 82

83 Solution: Precomputation We ll precompute and store a set of prefiltered results from each texture with different sizes of prefilters Because it s low-passed, we can also subsample 83

84 This is Called MIP-Mapping Construct a pyramid of images that are pre-filtered and re-sampled at 1/2, 1/4, 1/8, etc., of the original image's sampling During rasterization we compute the index of the decimated image that is sampled at a rate closest to the density of our desired sampling rate MIP stands for multum in parvo which means many in a small place 84

85 MIP-Mapping When a pixel wants an integral of the pre-filtered texture, we must find the closest results from the precomputed MIP-map pyramid Must compute the size of the projected pre-filter in the texture UV domain Projected pre-filter 85

86 MIP-Mapping When a pixel wants an integral of the pre-filtered texture, we must find the closest results from the precomputed MIP-map pyramid Must compute the size of the projected pre-filter in the texture UV domain Simplest method: Just pick the one scale that is closest (in some sense), then perform usual reconstruction on that level (e.g. bilinear) Projected pre-filter 86

87 Tri-Linear MIP-Mapping Next-simplest method: See which two scales are closest, compute reconstruction results from both, and linearly interpolate between them When using bilinear reconstruction on each scale, this is called tri-linear MIP-mapping Projected pre-filter Note that we are not getting the correct answer because precomputed filters are not the right shape 87

88 Anisotropic MIP-Mapping Anisotropic MIP-mapping approximates the true prefilter with a number of samples from different levels of the pyramid Mostly black magic Projected pre-filter 88

89 MIP Mapping Example Nearest Neighbor MIP Mapped (Tri-Linear) 89

90 MIP Mapping Example Small details may "pop" in and out of view Nearest Neighbor MIP Mapped (Tri-Linear) 90

91 MIP Mapping Example nearest neighbor/ point sampling mipmaps & linear interpolation (tri-linear) 91

92 Storing MIP Maps Can be stored compactly: Only 1/3 more space! 92

93 Finding the MIP Level Often we think of the pre-filter as a box What is the projection of the rectangular pixel window in texture space? MIP-map prefilters are symmetric (isotropic) so there is no one right way to pick the level Projected pre-filter 93

94 Finding the MIP Level Often we think of the pre-filter as a box What is the projection of the rectangular pixel window in texture space? MIP-map prefilters are symmetric (isotropic) so there is no one right way to pick the level Answer is in the partial derivatives px and py of (u,v) w.r.t. screen (x,y) Projection of pixel center px = (du/dx, dv/dx) py = (du/dy, dv/dy) Projected pre-filter 94

95 Finding the MIP Level Two most common approaches are Pick level according to the length (in texels) of the longer partial log 2 max {w p x,h p y } Projection of pixel center Projected pre-filter px = (du/dx, dv/dx) py = (du/dy, dv/dy) Pick level according to the length of their sum log 2 (w p x ) 2 +(h p y ) 2 w x h 95

96 Questions? 96

97 How Are Partials Computed? You can derive closed form formulas based on the uv and xyw coordinates of the vertices... This is what used to be done..but shaders may compute texture coordinates programmatically, not necessarily interpolated No way of getting analytic derivatives! In practice, use finite differences GPUs process pixels in blocks of (at least) 4 anyway These 2x2 blocks are called quads 97

98 Texture Filtering: Magnification Pre-aliasing problems happen when function varies too fast for samples to capture But when we are looking at a texture closer than the sampling rate, poor reconstruction (post-aliasing) is apparent Must also use proper filtering... If not enough texture resolution, result is blurry Oh well, not much you can do there! Nearest neighbor Bilinear 98

99 Elliptical Weighted Average (EWA) Isotropic filter w.r.t. screen space Becomes anisotropic in texture space Use e.g. anisotropic Gaussian Very, very high quality, but slow No hardware support 99

100 EWA Filtering in Action 100

101 Image Quality Comparison EWA vs. tri-linear MIP-mapping EWA trilinear mipmapping 101

102 Further Reading Paul Heckbert published seminal work on texture mapping and filtering in his master s thesis (!) Including EWA Highly recommended reading! See More reading Feline: Fast Elliptical Lines for Anisotropic Texture Mapping, McCormack, Perry, Farkas, Jouppi SIGGRAPH 1999 Texram: A Smart Memory for Texturing Schilling, Knittel, Strasser,. IEEE CG&A, 16(3): Arf! 102

103 That s All for Today! Let s see a cool real-time video to get back from mathland! 103

104 Sampling Texture Maps textured surface (texture map) image plane circular pixel window How to map the texture area seen through the pixel window to a single pixel value? 104

105 Sampling Texture Maps When texture mapping it is rare that the screen-space sampling density matches the sampling density of the texture. 64x64 pixels Original Texture Magnification for Display Minification for Display 105

106 Bilinear Texture Filtering Tell OpenGL to use a tent filter instead of a box filter Magnification looks better, but blurry (texture is under-sampled for this resolution) Oh well

107 Questions? 107

108 Minification: Examples of Aliasing point sampling 108

109 Potential Solutions 1/ We can supersample the final image But only offsets the Nyquist limit 2/ We can blur the texture (prefilter) We ll treat the projected texture as a 2D function of screen coordinates, and project the image-space prefilter back onto the texture map The right way to go textured surface (texture map) image circular pixel window 109

110 Spatial Filtering Remove the high frequencies which cause artifacts in texture minification Compute a spatial integration over the extent of the pixel This is equivalent to convolving the texture with a filter kernel centered at the sample (i.e., pixel center)! Expensive to do during rasterization, but an approximation it can be precomputed projected texture in image plane pixels projected in texture plane 110

111 MIP Mapping Construct a pyramid of images that are pre-filtered and re-sampled at 1/2, 1/4, 1/8, etc., of the original image's sampling During rasterization we compute the index of the decimated image that is sampled at a rate closest to the density of our desired sampling rate MIP stands for multum in parvo which means many in a small place 111

112 MIP Mapping Example Nearest Neighbor MIP Mapped (Bi-Linear) 112

113 MIP Mapping Example Small details may "pop" in and out of view Nearest Neighbor MIP Mapped (Bi-Linear) 113

114 Examples of Aliasing Texture Errors nearest neighbor/ point sampling mipmaps & linear interpolation 114

115 Storing MIP Maps Can be stored compactly Illustrates the 1/3 overhead of maintaining the MIP map 115

116 Finding the MIP Level textured surface (texture map) area pre- filtered in MIPmap circular pixel window image plane Square MIP-map area is a bad approximation 116

117 Finding the MIP level How does a screen-space change dt relates to a texture-space change du,dv. => derivatives, ( du/dt, dv/dt ). e.g. computed by hardware during rasterization often: finite difference (pixels are handled by quads) du, dv dt 117

118 Finding the MIP level How does a screen-space change dt relates to a texture-space change du,dv. This sounds like the derivatives, ( du/dt, dv/dt ). They can be computed simply using the chain rule: du, dv dt 118

119 Finding the MIP level What we'd like to find is the step size that a uniform step in screen-space causes in three-space, or, in other words how a screen-space change relates to a 3-space change. This sounds like the derivatives, ( du/dt, dv/dt ). They can be computed simply using the chain rule: Notice that the term being squared under the numerator is just the w plane equation that we are already computing. The remaining terms are constant for a given rasterization. Thus all we need to do to compute the derivative is a square the w accumulator and multiply it by a couple of constants. Now, we know how a step in screen-space relates to a step in 3-space. So how do we translate this to an index into our MIP table? 119

120 MIP Indices Actually, you have a choice of ways to translate this derivative value into a MIP level. Because we have two derivatives, for u and for v (anisotropy) This also brings up one of the shortcomings of MIP mapping. MIP mapping assumes that both the u and v components of the texture index are undergoing a uniform scaling, while in fact the terms du/dt and dv/dt are relatively independent. Thus, we must make some sort of compromise. Two of the most common approaches are given below: 120

121 MIP Indices Actually, you have a choice of ways to translate this derivative value into a MIP level. Because we have two derivatives, for u and for v (anisotropy) This also brings up one of the shortcomings of MIP mapping. MIP mapping assumes that both the u and v components of the texture index are undergoing a uniform scaling, while in fact the terms du/dt and dv/dt are relatively independent. Thus, we must make some sort of compromise. Two of the most common approaches are given below: The differences between these level selection methods is illustrated by the accompanying figure. 121

122 Anisotropy & MIP-Mapping What happens when the surface is tilted? Nearest Neighbor MIP Mapped (Bi-Linear) 122

123 Questions? 123

124 Elliptical weighted average Isotropic filter wrt screen space Becomes anisotropic in texture space e.g. use anisotropic Gaussian Called Elliptical Weighted Average (EWA) 124

125 EWA resampling 125

126 Image Quality Comparison Trilinear mipmapping EWA trilinear mipmapping 126

127 Approximation of anisotropic Feline: Fast Elliptical Lines for Anisotropic Texture Mapping Joel McCormack, Ronald Perry, Keith I. Farkas, and Norman P. Jouppi SIGGRAPH 1999 Andreas Schilling, Gunter Knittel & Wolfgang Strasser. Texram: A Smart Memory for Texturing. IEEE Computer Graphics and Applications, 16(3): 32-41, May Aproximate Anisotropic Gaussian by a set of isotropic probes 127

128 FELINE results 128

129 Questions? 129

130 Jittering Uniform sample + random perturbation Sampling is now non-uniform Signal processing gets more complex In practice, adds noise to image But noise is better than aliasing Moiré patterns 130

131 Jittered supersampling Regular, Jittered Supersampling 131

132 Jittering Displaced by a vector a fraction of the size of the subpixel distance Low-frequency Moire (aliasing) pattern replaced by noise Extremely effective Patented by Pixar, but expired a few years ago When jittering amount is 1, equivalent to stratified sampling (cf. later) 132

133 Questions? 133

134 Adaptive supersampling Use more sub-pixel samples around edges 134

135 Adaptive supersampling Use more sub-pixel samples around edges Compute color at small number of sample If their variance is high Compute larger number of samples 135

136 Adaptive supersampling Use more sub-pixel samples around edges Compute color at small number of sample If variance with neighbor pixels is high Compute larger number of samples 136

137 Problem with non-uniform distribution Reconstruction can be complicated 80% of the samples are black Yet the pixel should be light grey 137

138 Problem with non-uniform distribution Reconstruction can be complicated Solution: do a multi-level reconstruction Reconstruct uniform sub-pixels Filter those uniform sub-pixels 138

139 Filters (a.k.a convolution kernel) Weighting function or a convolution kernel Area of influence often bigger than "pixel" Sum of weights = 1 Each sample contributes the same total to image Constant brightness as object moves across the screen. No negative weights/colors (optional) 139

140 Filters Filters are used to reconstruct a continuous signal from a sampled signal (reconstruction filters) band-limit continuous signals to avoid aliasing during sampling (low-pass filters) Desired frequency domain properties are the same for both types of filters Often, the same filters are used as reconstruction and low-pass filters 140

141 Pre-Filtering Filter continuous primitives Treat a pixel as an area Compute weighted amount of object overlap What weighting function should we use? 141

142 Post-Filtering Filter samples Compute the weighted average of many samples Regular or jittered sampling (better) 142

143 The Ideal Filter Unfortunately it has infinite spatial extent Every sample contributes to every interpolated point Expensive/impossible to compute spatial frequenc y 143

144 Problems with Practical Filters Many visible artifacts in re-sampled images are caused by poor reconstruction filters Excessive pass-band attenuation results in blurry images Excessive high-frequency leakage causes "ringing" and can accentuate the sampling grid (anisotropy) frequency 144

145 Gaussian Filter This is more or less what a physical display does for free! spatial frequenc y 145

146 Box Filter / Nearest Neighbor Pretending pixels are little squares. spatial frequenc y 146

147 Tent Filter / Bi-Linear Interpolation Simple to implement Reasonably smooth spatial frequenc y 147

148 Bi-Cubic Interpolation Begins to approximate the ideal spatial filter, the sinc function spatial frequenc 148 y

149 Why is the Box filter bad? (Why is it bad to think of pixels as squares) Original high- resolution image Down-sampled with a 5x5 box filter (uniform weights) Down-sampled with a 5x5 Gaussian filter (non-uniform weights) notice the ugly horizontal banding 149

150 Questions? 150

151 Difficulties with perfect sampling Hard to prefilter Perfect filter has infinite support Fourier analysis assumes infinite signal and complete knowledge Not enough focus on local effects And negative lobes Emphasizes the two problems above Negative light is bad Ringing artifacts if prefiltering or supports are not perfect 151

152 At the end of the day Fourier analysis is great to understand aliasing But practical problems kick in As a result there is no perfect solution Compromises between Finite support Avoid negative lobes Avoid high-frequency leakage Avoid low-frequency attenuation Everyone has their favorite cookbook recipe Gaussian, tent, Mitchell bicubic 152

153 Recap: Ideal sampling/reconstruction Pre-filter with a perfect low-pass filter Box in frequency Sinc in time Sample at Nyquist limit Twice the frequency cutoff Reconstruct with perfect filter Box in frequency, sinc in time And everything is great! 153

Sampling, Aliasing, & Mipmaps

Sampling, Aliasing, & Mipmaps Sampling, Aliasing, & Mipmaps Last Time? Monte-Carlo Integration Importance Sampling Ray Tracing vs. Path Tracing source hemisphere What is a Pixel? Sampling & Reconstruction Filters in Computer Graphics

More information

Sampling, Aliasing, & Mipmaps

Sampling, Aliasing, & Mipmaps Sampling, Aliasing, & Mipmaps Last Time? Monte-Carlo Integration Importance Sampling Ray Tracing vs. Path Tracing source hemisphere Sampling sensitive to choice of samples less sensitive to choice of samples

More information

Sampling, Aliasing, & Mipmaps

Sampling, Aliasing, & Mipmaps Last Time? Sampling, Aliasing, & Mipmaps 2D Texture Mapping Perspective Correct Interpolation Common Texture Coordinate Projections Bump Mapping Displacement Mapping Environment Mapping Texture Maps for

More information

Sampling and Monte-Carlo Integration

Sampling and Monte-Carlo Integration Sampling and Monte-Carlo Integration Sampling and Monte-Carlo Integration Last Time Pixels are samples Sampling theorem Convolution & multiplication Aliasing: spectrum replication Ideal filter And its

More information

Computer Graphics. Texture Filtering & Sampling Theory. Hendrik Lensch. Computer Graphics WS07/08 Texturing

Computer Graphics. Texture Filtering & Sampling Theory. Hendrik Lensch. Computer Graphics WS07/08 Texturing Computer Graphics Texture Filtering & Sampling Theory Hendrik Lensch Overview Last time Texture Parameterization Procedural Shading Today Texturing Filtering 2D Texture Mapping Forward mapping Object surface

More information

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

Texture-Mapping Tricks. How Bad Does it Look? We've Seen this Sort of Thing Before. Sampling Texture Maps Texture-Mapping Tricks Filtering Textures Textures and Shading Bump Mapping Solid Textures How Bad Does it Look? Let's take a look at what oversampling looks like: Click and drag the texture to rotate

More information

Theoretically Perfect Sensor

Theoretically Perfect Sensor Sampling 1/60 Sampling The ray tracer samples the geometry, only gathering information from the parts of the world that interact with a finite number of rays In contrast, a scanline renderer can push all

More information

Theoretically Perfect Sensor

Theoretically Perfect Sensor Sampling 1/67 Sampling The ray tracer samples the geometry, only gathering information from the parts of the world that interact with a finite number of rays In contrast, a scanline renderer can push all

More information

Aliasing and Antialiasing. ITCS 4120/ Aliasing and Antialiasing

Aliasing and Antialiasing. ITCS 4120/ Aliasing and Antialiasing Aliasing and Antialiasing ITCS 4120/5120 1 Aliasing and Antialiasing What is Aliasing? Errors and Artifacts arising during rendering, due to the conversion from a continuously defined illumination field

More information

Basics. Sampling and Reconstruction. Sampling and Reconstruction. Outline. (Spatial) Aliasing. Advanced Computer Graphics (Fall 2010)

Basics. Sampling and Reconstruction. Sampling and Reconstruction. Outline. (Spatial) Aliasing. Advanced Computer Graphics (Fall 2010) Advanced Computer Graphics (Fall 2010) CS 283, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi http://inst.eecs.berkeley.edu/~cs283/fa10 Some slides courtesy Thomas Funkhouser and Pat Hanrahan

More information

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016 Computergrafik Matthias Zwicker Universität Bern Herbst 2016 2 Today Basic shader for texture mapping Texture coordinate assignment Antialiasing Fancy textures 3 Texture mapping Glue textures (images)

More information

Drawing a Triangle (and an introduction to sampling)

Drawing a Triangle (and an introduction to sampling) Lecture 4: Drawing a Triangle (and an introduction to sampling) Computer Graphics CMU 15-462/15-662, Spring 2017 Assignment 1 is out! https://15462-s17.github.io/asst1_drawsvg/ Let s draw some triangles

More information

Outline. Sampling and Reconstruction. Sampling and Reconstruction. Foundations of Computer Graphics (Fall 2012)

Outline. Sampling and Reconstruction. Sampling and Reconstruction. Foundations of Computer Graphics (Fall 2012) Foundations of Computer Graphics (Fall 2012) CS 184, Lectures 19: Sampling and Reconstruction http://inst.eecs.berkeley.edu/~cs184 Outline Basic ideas of sampling, reconstruction, aliasing Signal processing

More information

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

Today. Texture mapping in OpenGL. Texture mapping. Basic shaders for texturing. Today. Computergrafik Computergrafik Today Basic shader for texture mapping Texture coordinate assignment Antialiasing Fancy textures Matthias Zwicker Universität Bern Herbst 2009 Texture mapping Glue textures (images) onto

More information

Sampling and Reconstruction

Sampling and Reconstruction Page 1 Sampling and Reconstruction The sampling and reconstruction process Real world: continuous Digital world: discrete Basic signal processing Fourier transforms The convolution theorem The sampling

More information

Outline. Foundations of Computer Graphics (Spring 2012)

Outline. Foundations of Computer Graphics (Spring 2012) Foundations of Computer Graphics (Spring 2012) CS 184, Lectures 19: Sampling and Reconstruction http://inst.eecs.berkeley.edu/~cs184 Basic ideas of sampling, reconstruction, aliasing Signal processing

More information

Drawing a Triangle (and an Intro to Sampling)

Drawing a Triangle (and an Intro to Sampling) Lecture 4: Drawing a Triangle (and an Intro to Sampling) Computer Graphics CMU 15-462/15-662, Spring 2018 HW 0.5 Due, HW 1 Out Today! GOAL: Implement a basic rasterizer - (Topic of today s lecture) - We

More information

Perspective Projection and Texture Mapping

Perspective Projection and Texture Mapping Lecture 7: Perspective Projection and Texture Mapping Computer Graphics CMU 15-462/15-662, Spring 2018 Perspective & Texture PREVIOUSLY: - transformation (how to manipulate primitives in space) - rasterization

More information

The simplest and most obvious method to go from a continuous to a discrete image is by point sampling,

The simplest and most obvious method to go from a continuous to a discrete image is by point sampling, Sampling our scenes are described with triangles giving a continuous 2d color field our images are digital/discrete made up of a grid of dots need to make a bridge between these two worlds else we will

More information

Advanced Computer Graphics. Aliasing. Matthias Teschner. Computer Science Department University of Freiburg

Advanced Computer Graphics. Aliasing. Matthias Teschner. Computer Science Department University of Freiburg Advanced Computer Graphics Aliasing Matthias Teschner Computer Science Department University of Freiburg Outline motivation Fourier analysis filtering sampling reconstruction / aliasing antialiasing University

More information

Point-Based Rendering

Point-Based Rendering Point-Based Rendering Kobbelt & Botsch, Computers & Graphics 2004 Surface Splatting (EWA: Elliptic Weighted Averaging) Main Idea Signal Processing Basics Resampling Gaussian Filters Reconstruction Kernels

More information

Computer Graphics. Lecture 8 Antialiasing, Texture Mapping

Computer Graphics. Lecture 8 Antialiasing, Texture Mapping Computer Graphics Lecture 8 Antialiasing, Texture Mapping Today Texture mapping Antialiasing Antialiasing-textures Texture Mapping : Why needed? Adding details using high resolution polygon meshes is costly

More information

Reading. 2. Fourier analysis and sampling theory. Required: Watt, Section 14.1 Recommended:

Reading. 2. Fourier analysis and sampling theory. Required: Watt, Section 14.1 Recommended: Reading Required: Watt, Section 14.1 Recommended: 2. Fourier analysis and sampling theory Ron Bracewell, The Fourier Transform and Its Applications, McGraw-Hill. Don P. Mitchell and Arun N. Netravali,

More information

Lecture 6 Basic Signal Processing

Lecture 6 Basic Signal Processing Lecture 6 Basic Signal Processing Copyright c1996, 1997 by Pat Hanrahan Motivation Many aspects of computer graphics and computer imagery differ from aspects of conventional graphics and imagery because

More information

Computer Graphics. Sampling Theory & Anti-Aliasing. Philipp Slusallek

Computer Graphics. Sampling Theory & Anti-Aliasing. Philipp Slusallek Computer Graphics Sampling Theory & Anti-Aliasing Philipp Slusallek Dirac Comb (1) Constant & δ-function flash Comb/Shah function 2 Dirac Comb (2) Constant & δ-function Duality f(x) = K F(ω) = K (ω) And

More information

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

CS GPU and GPGPU Programming Lecture 16+17: GPU Texturing 1+2. Markus Hadwiger, KAUST CS 380 - GPU and GPGPU Programming Lecture 16+17: GPU Texturing 1+2 Markus Hadwiger, KAUST Reading Assignment #10 (until April 23) Read (required): Brook for GPUs: Stream Computing on Graphics Hardware

More information

Fourier analysis and sampling theory

Fourier analysis and sampling theory Reading Required: Shirley, Ch. 9 Recommended: Fourier analysis and sampling theory Ron Bracewell, The Fourier Transform and Its Applications, McGraw-Hill. Don P. Mitchell and Arun N. Netravali, Reconstruction

More information

Aliasing. Can t draw smooth lines on discrete raster device get staircased lines ( jaggies ):

Aliasing. Can t draw smooth lines on discrete raster device get staircased lines ( jaggies ): (Anti)Aliasing and Image Manipulation for (y = 0; y < Size; y++) { for (x = 0; x < Size; x++) { Image[x][y] = 7 + 8 * sin((sqr(x Size) + SQR(y Size)) / 3.0); } } // Size = Size / ; Aliasing Can t draw

More information

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

CS GPU and GPGPU Programming Lecture 12: GPU Texturing 1. Markus Hadwiger, KAUST CS 380 - GPU and GPGPU Programming Lecture 12: GPU Texturing 1 Markus Hadwiger, KAUST Reading Assignment #6 (until Mar. 17) Read (required): Programming Massively Parallel Processors book, Chapter 4 (CUDA

More information

Texture mapping. Computer Graphics CSE 167 Lecture 9

Texture mapping. Computer Graphics CSE 167 Lecture 9 Texture mapping Computer Graphics CSE 167 Lecture 9 CSE 167: Computer Graphics Texture Mapping Overview Interpolation Wrapping Texture coordinates Anti aliasing Mipmaps Other mappings Including bump mapping

More information

Reading. 18. Projections and Z-buffers. Required: Watt, Section , 6.3, 6.6 (esp. intro and subsections 1, 4, and 8 10), Further reading:

Reading. 18. Projections and Z-buffers. Required: Watt, Section , 6.3, 6.6 (esp. intro and subsections 1, 4, and 8 10), Further reading: Reading Required: Watt, Section 5.2.2 5.2.4, 6.3, 6.6 (esp. intro and subsections 1, 4, and 8 10), Further reading: 18. Projections and Z-buffers Foley, et al, Chapter 5.6 and Chapter 6 David F. Rogers

More information

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

Soft shadows. Steve Marschner Cornell University CS 569 Spring 2008, 21 February Soft shadows Steve Marschner Cornell University CS 569 Spring 2008, 21 February Soft shadows are what we normally see in the real world. If you are near a bare halogen bulb, a stage spotlight, or other

More information

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into 2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into the viewport of the current application window. A pixel

More information

CS354 Computer Graphics Sampling and Aliasing

CS354 Computer Graphics Sampling and Aliasing Slide Credit: http://www.siggraph.org/education/materials/hypergraph/aliasing/alias0.htm CS354 Computer Graphics Sampling and Aliasing Qixing Huang February 12th 2018 Sampling and Aliasing Display is discrete

More information

To Do. Advanced Computer Graphics. Sampling and Reconstruction. Outline. Sign up for Piazza

To Do. Advanced Computer Graphics. Sampling and Reconstruction. Outline. Sign up for Piazza Advanced Computer Graphics CSE 63 [Spring 207], Lecture 3 Ravi Ramamoorthi http://www.cs.ucsd.edu/~ravir Sign up for Piazza To Do Assignment, Due Apr 28. Anyone need help finding partners? Any issues with

More information

Anisotropic Texture Filtering using Line Integral Textures

Anisotropic Texture Filtering using Line Integral Textures Anisotropic Texture Filtering using Line Integral Textures Blended Mipmap The Proposed Method 16x Anisotropic Filtering 1 2 3 5 6 7 8 9 10 11 12 13 1 15 16 17 18 19 20 21 22 23 2 25 26 27 Figure 1: Our

More information

Sampling and Reconstruction

Sampling and Reconstruction Sampling and Reconstruction Sampling and Reconstruction Sampling and Spatial Resolution Spatial Aliasing Problem: Spatial aliasing is insufficient sampling of data along the space axis, which occurs because

More information

Texture Mapping 1/34

Texture Mapping 1/34 Texture Mapping 1/34 Texture Mapping Offsets the modeling assumption that the BRDF doesn t change in u and v coordinates along the object s surface Store a reflectance as an image called a texture Map

More information

Filtering theory: Battling Aliasing with Antialiasing. Department of Computer Engineering Chalmers University of Technology

Filtering theory: Battling Aliasing with Antialiasing. Department of Computer Engineering Chalmers University of Technology Filtering theory: Battling Aliasing with Antialiasing Department of Computer Engineering Chalmers University of Technology 1 What is aliasing? 2 Why care at all? l Quality!! l Example: Final fantasy The

More information

Sampling and Reconstruction. Most slides from Steve Marschner

Sampling and Reconstruction. Most slides from Steve Marschner Sampling and Reconstruction Most slides from Steve Marschner 15-463: Computational Photography Alexei Efros, CMU, Fall 2008 Sampling and Reconstruction Sampled representations How to store and compute

More information

Image Filtering, Warping and Sampling

Image Filtering, Warping and Sampling Image Filtering, Warping and Sampling Connelly Barnes CS 4810 University of Virginia Acknowledgement: slides by Jason Lawrence, Misha Kazhdan, Allison Klein, Tom Funkhouser, Adam Finkelstein and David

More information

3D Rasterization II COS 426

3D Rasterization II COS 426 3D Rasterization II COS 426 3D Rendering Pipeline (for direct illumination) 3D Primitives Modeling Transformation Lighting Viewing Transformation Projection Transformation Clipping Viewport Transformation

More information

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

CS 428: Fall Introduction to. Texture mapping and filtering. Andrew Nealen, Rutgers, /18/2010 1 CS 428: Fall 2010 Introduction to Computer Graphics Texture mapping and filtering 10/18/2010 1 Topic overview Image formation and OpenGL Transformations and viewing Polygons and polygon meshes 3D model/mesh

More information

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

CSE 167: Lecture 11: Textures 2. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011 CSE 167: Introduction to Computer Graphics Lecture 11: Textures 2 Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011 Announcements Homework assignment #5 due Friday, Nov 4,

More information

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

CS GPU and GPGPU Programming Lecture 11: GPU Texturing 1. Markus Hadwiger, KAUST CS 380 - GPU and GPGPU Programming Lecture 11: GPU Texturing 1 Markus Hadwiger, KAUST Reading Assignment #6 (until Mar. 9) Read (required): Programming Massively Parallel Processors book, Chapter 4 (CUDA

More information

CS1114 Section 8: The Fourier Transform March 13th, 2013

CS1114 Section 8: The Fourier Transform March 13th, 2013 CS1114 Section 8: The Fourier Transform March 13th, 2013 http://xkcd.com/26 Today you will learn about an extremely useful tool in image processing called the Fourier transform, and along the way get more

More information

CS 431/636 Advanced Rendering Techniques

CS 431/636 Advanced Rendering Techniques CS 431/636 Advanced Rendering Techniques Dr. David Breen Matheson 308 Thursday 6PM 8:50PM Presentation 7 5/23/06 Questions from Last Time? Hall Shading Model Shadows Reflections Refractions Slide Credits

More information

Announcements. Image Matching! Source & Destination Images. Image Transformation 2/ 3/ 16. Compare a big image to a small image

Announcements. Image Matching! Source & Destination Images. Image Transformation 2/ 3/ 16. Compare a big image to a small image 2/3/ Announcements PA is due in week Image atching! Leave time to learn OpenCV Think of & implement something creative CS 50 Lecture #5 February 3 rd, 20 2/ 3/ 2 Compare a big image to a small image So

More information

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

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic. Shading Models There are two main types of rendering that we cover, polygon rendering ray tracing Polygon rendering is used to apply illumination models to polygons, whereas ray tracing applies to arbitrary

More information

EECS 556 Image Processing W 09. Interpolation. Interpolation techniques B splines

EECS 556 Image Processing W 09. Interpolation. Interpolation techniques B splines EECS 556 Image Processing W 09 Interpolation Interpolation techniques B splines What is image processing? Image processing is the application of 2D signal processing methods to images Image representation

More information

The main goal of Computer Graphics is to generate 2D images 2D images are continuous 2D functions (or signals)

The main goal of Computer Graphics is to generate 2D images 2D images are continuous 2D functions (or signals) Motivation The main goal of Computer Graphics is to generate 2D images 2D images are continuous 2D functions (or signals) monochrome f(x,y) or color r(x,y), g(x,y), b(x,y) These functions are represented

More information

Motivation. The main goal of Computer Graphics is to generate 2D images. 2D images are continuous 2D functions (or signals)

Motivation. The main goal of Computer Graphics is to generate 2D images. 2D images are continuous 2D functions (or signals) Motivation The main goal of Computer Graphics is to generate 2D images 2D images are continuous 2D functions (or signals) monochrome f(x,y) or color r(x,y), g(x,y), b(x,y) These functions are represented

More information

Filtering theory: Battling Aliasing with Antialiasing. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Filtering theory: Battling Aliasing with Antialiasing. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology Filtering theory: Battling Aliasing with Antialiasing Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology 1 What is aliasing? 2 Why care at all? l Quality!! l Example:

More information

28 SAMPLING. ALIASING AND ANTI-ALIASING

28 SAMPLING. ALIASING AND ANTI-ALIASING 28 SAMPLING. ALIASING AND ANTI-ALIASING Textbook: 16 UGRAD.CS.UBC.CA/~CS314 Alla Sheffer, 2016 ALIASING & ANTI-ALIASING Adobe, inc., https://helpx.adobe.com/photoshop/key concepts/aliasing anti aliasing.html

More information

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

CS 450: COMPUTER GRAPHICS TEXTURE MAPPING SPRING 2015 DR. MICHAEL J. REALE CS 450: COMPUTER GRAPHICS TEXTURE MAPPING SPRING 2015 DR. MICHAEL J. REALE INTRODUCTION Texturing = process that takes a surface and modifies its appearance at each location using some image, function,

More information

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 557 Autumn 2017

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 557 Autumn 2017 Anti-aliasing and Monte Carlo Path Tracing Brian Curless CSE 557 Autumn 2017 1 Reading Required: Marschner and Shirley, Section 13.4 (online handout) Pharr, Jakob, and Humphreys, Physically Based Ray Tracing:

More information

Lecture 6: Texture. Kayvon Fatahalian CMU : Graphics and Imaging Architectures (Fall 2011)

Lecture 6: Texture. Kayvon Fatahalian CMU : Graphics and Imaging Architectures (Fall 2011) Lecture 6: Texture Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011) Today: texturing! Texture filtering - Texture access is not just a 2D array lookup ;-) Memory-system implications

More information

Anti-aliasing and Monte Carlo Path Tracing

Anti-aliasing and Monte Carlo Path Tracing Reading Required: Anti-aliasing and Monte Carlo Path Tracing Brian Curless CSE 557 Autumn 2017 Marschner and Shirley, Section 13.4 (online handout) Pharr, Jakob, and Humphreys, Physically Based Ray Tracing:

More information

Footprint Area Sampled Texturing

Footprint Area Sampled Texturing Footprint Area Sampled Texturing Baoquan Chen University of Minnesota baoquan@cs.umn.edu Frank Dachille SUNY at Stony Brook dachille@cs.sunysb.edu Arie Kaufman SUNY at Stony Brook ari@cs.sunysb.edu Abstract

More information

High-quality multi-pass image resampling

High-quality multi-pass image resampling High-quality multi-pass image resampling Richard Szeliski, Simon Winder, and Matt Uyttendaele February 2010 Technical Report MSR-TR-2010-10 This paper develops a family of multi-pass image resampling algorithms

More information

International ejournals

International ejournals ISSN 2249 5460 Available online at www.internationalejournals.com International ejournals International Journal of Mathematical Sciences, Technology and Humanities 96 (2013) 1063 1069 Image Interpolation

More information

Texture Mapping 1/34

Texture Mapping 1/34 Texture Mapping 1/34 Texture Mapping Offsets the modeling assumption that the BRDF doesn t change in u and v coordinates along the object s surface Store a reflectance as an image called a texture Map

More information

To Do. Advanced Computer Graphics. Discrete Convolution. Outline. Outline. Implementing Discrete Convolution

To Do. Advanced Computer Graphics. Discrete Convolution. Outline. Outline. Implementing Discrete Convolution Advanced Computer Graphics CSE 163 [Spring 2018], Lecture 4 Ravi Ramamoorthi http://www.cs.ucsd.edu/~ravir To Do Assignment 1, Due Apr 27. Please START EARLY This lecture completes all the material you

More information

Anti-aliasing and sampling

Anti-aliasing and sampling Anti-aliasing and sampling 1996-2017 Josef Pelikán CGG MFF UK Praha pepca@cgg.mff.cuni.cz http://cgg.mff.cuni.cz/~pepca/ Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 1 / 34 Spatial and temporal

More information

CS448f: Image Processing For Photography and Vision. Fast Filtering

CS448f: Image Processing For Photography and Vision. Fast Filtering CS448f: Image Processing For Photography and Vision Fast Filtering Problems in Computer Vision Computer Vision in One Slide 1) Extract some features from some images 2) Use these to formulate some (hopefully

More information

Texture Mapping. Texture (images) lecture 16. Texture mapping Aliasing (and anti-aliasing) Adding texture improves realism.

Texture Mapping. Texture (images) lecture 16. Texture mapping Aliasing (and anti-aliasing) Adding texture improves realism. lecture 16 Texture mapping Aliasing (and anti-aliasing) Texture (images) Texture Mapping Q: Why do we need texture mapping? A: Because objects look fake and boring without it. Adding texture improves realism.

More information

Dominic Filion, Senior Engineer Blizzard Entertainment. Rob McNaughton, Lead Technical Artist Blizzard Entertainment

Dominic Filion, Senior Engineer Blizzard Entertainment. Rob McNaughton, Lead Technical Artist Blizzard Entertainment Dominic Filion, Senior Engineer Blizzard Entertainment Rob McNaughton, Lead Technical Artist Blizzard Entertainment Screen-space techniques Deferred rendering Screen-space ambient occlusion Depth of Field

More information

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane Rendering Pipeline Rendering Converting a 3D scene to a 2D image Rendering Light Camera 3D Model View Plane Rendering Converting a 3D scene to a 2D image Basic rendering tasks: Modeling: creating the world

More information

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

CSE 167: Introduction to Computer Graphics Lecture #8: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016 CSE 167: Introduction to Computer Graphics Lecture #8: Textures Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016 Announcements Project 2 due this Friday Midterm next Tuesday

More information

Lecture 6: Texturing Part II: Texture Compression and GPU Latency Hiding Mechanisms. Visual Computing Systems CMU , Fall 2014

Lecture 6: Texturing Part II: Texture Compression and GPU Latency Hiding Mechanisms. Visual Computing Systems CMU , Fall 2014 Lecture 6: Texturing Part II: Texture Compression and GPU Latency Hiding Mechanisms Visual Computing Systems Review: mechanisms to reduce aliasing in the graphics pipeline When sampling visibility?! -

More information

Edges, interpolation, templates. Nuno Vasconcelos ECE Department, UCSD (with thanks to David Forsyth)

Edges, interpolation, templates. Nuno Vasconcelos ECE Department, UCSD (with thanks to David Forsyth) Edges, interpolation, templates Nuno Vasconcelos ECE Department, UCSD (with thanks to David Forsyth) Edge detection edge detection has many applications in image processing an edge detector implements

More information

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

CSE 167: Introduction to Computer Graphics Lecture #9: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013 CSE 167: Introduction to Computer Graphics Lecture #9: Textures Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013 Announcements Added Tuesday office hours for Krishna: 11am-12

More information

Lossy Coding 2 JPEG. Perceptual Image Coding. Discrete Cosine Transform JPEG. CS559 Lecture 9 JPEG, Raster Algorithms

Lossy Coding 2 JPEG. Perceptual Image Coding. Discrete Cosine Transform JPEG. CS559 Lecture 9 JPEG, Raster Algorithms CS559 Lecture 9 JPEG, Raster Algorithms These are course notes (not used as slides) Written by Mike Gleicher, Sept. 2005 With some slides adapted from the notes of Stephen Chenney Lossy Coding 2 Suppose

More information

lecture 16 Texture mapping Aliasing (and anti-aliasing)

lecture 16 Texture mapping Aliasing (and anti-aliasing) lecture 16 Texture mapping Aliasing (and anti-aliasing) Texture (images) Texture Mapping Q: Why do we need texture mapping? A: Because objects look fake and boring without it. Adding texture improves realism.

More information

Image Processing, Warping, and Sampling

Image Processing, Warping, and Sampling Image Processing, Warping, and Sampling Michael Kazhdan (601.457/657) HB Ch. 4.8 FvDFH Ch. 14.10 Outline Image Processing Image Warping Image Sampling Image Processing What about the case when the modification

More information

Computer Vision 2. SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung. Computer Vision 2 Dr. Benjamin Guthier

Computer Vision 2. SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung. Computer Vision 2 Dr. Benjamin Guthier Computer Vision 2 SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung Computer Vision 2 Dr. Benjamin Guthier 1. IMAGE PROCESSING Computer Vision 2 Dr. Benjamin Guthier Content of this Chapter Non-linear

More information

Texture. Outline. Image representations: spatial and frequency Fourier transform Frequency filtering Oriented pyramids Texture representation

Texture. Outline. Image representations: spatial and frequency Fourier transform Frequency filtering Oriented pyramids Texture representation Texture Outline Image representations: spatial and frequency Fourier transform Frequency filtering Oriented pyramids Texture representation 1 Image Representation The standard basis for images is the set

More information

Morphological: Sub-pixel Morhpological Anti-Aliasing [Jimenez 11] Fast AproXimatte Anti Aliasing [Lottes 09]

Morphological: Sub-pixel Morhpological Anti-Aliasing [Jimenez 11] Fast AproXimatte Anti Aliasing [Lottes 09] 1 2 3 Morphological: Sub-pixel Morhpological Anti-Aliasing [Jimenez 11] Fast AproXimatte Anti Aliasing [Lottes 09] Analytical: Geometric Buffer Anti Aliasing [Persson 11] Distance to Edge Anti Aliasing

More information

CPSC 4040/6040 Computer Graphics Images. Joshua Levine

CPSC 4040/6040 Computer Graphics Images. Joshua Levine CPSC 4040/6040 Computer Graphics Images Joshua Levine levinej@clemson.edu Lecture 19 Projective Warping and Bilinear Warping Nov. 3, 2015 Agenda EC Quiz Review PA06 out Refresher from Lec18 https://en.wikipedia.org/wiki/affine_transformation

More information

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

Texturing Theory. Overview. All it takes is for the rendered image to look right. -Jim Blinn 11/10/2018 References: Real-Time Rendering 3 rd Edition Chapter 6 Texturing Theory All it takes is for the rendered image to look right. -Jim Blinn Overview Introduction The Texturing Pipeline Example The Projector

More information

First Order Approximation for Texture Filtering

First Order Approximation for Texture Filtering First Order Approximation for Texture Filtering Zhouchen Lin Microsoft Research, Asia zhoulin@microsoft.com Lifeng Wang Microsoft Research, Asia lfwang@microsoft.com Liang Wan The Chinese University of

More information

Lecture 2: 2D Fourier transforms and applications

Lecture 2: 2D Fourier transforms and applications Lecture 2: 2D Fourier transforms and applications B14 Image Analysis Michaelmas 2017 Dr. M. Fallon Fourier transforms and spatial frequencies in 2D Definition and meaning The Convolution Theorem Applications

More information

Parallel Triangle Rendering on a Modern GPU

Parallel Triangle Rendering on a Modern GPU Lecture 27: Parallel Triangle Rendering on a Modern GPU Parallel Computer Architecture and Programming CMU 15-418/15-618, Spring 2015 Let s draw a triangle on the screen Question 1: what pixels does the

More information

Filtering Applications & Edge Detection. GV12/3072 Image Processing.

Filtering Applications & Edge Detection. GV12/3072 Image Processing. Filtering Applications & Edge Detection GV12/3072 1 Outline Sampling & Reconstruction Revisited Anti-Aliasing Edges Edge detection Simple edge detector Canny edge detector Performance analysis Hough Transform

More information

Simpler Soft Shadow Mapping Lee Salzman September 20, 2007

Simpler Soft Shadow Mapping Lee Salzman September 20, 2007 Simpler Soft Shadow Mapping Lee Salzman September 20, 2007 Lightmaps, as do other precomputed lighting methods, provide an efficient and pleasing solution for lighting and shadowing of relatively static

More information

Line Drawing. Introduction to Computer Graphics Torsten Möller / Mike Phillips. Machiraju/Zhang/Möller

Line Drawing. Introduction to Computer Graphics Torsten Möller / Mike Phillips. Machiraju/Zhang/Möller Line Drawing Introduction to Computer Graphics Torsten Möller / Mike Phillips Rendering Pipeline Hardware Modelling Transform Visibility Illumination + Shading Perception, Color Interaction Texture/ Realism

More information

An Intuitive Explanation of Fourier Theory

An Intuitive Explanation of Fourier Theory An Intuitive Explanation of Fourier Theory Steven Lehar slehar@cns.bu.edu Fourier theory is pretty complicated mathematically. But there are some beautifully simple holistic concepts behind Fourier theory

More information

Distribution Ray-Tracing. Programação 3D Simulação e Jogos

Distribution Ray-Tracing. Programação 3D Simulação e Jogos Distribution Ray-Tracing Programação 3D Simulação e Jogos Bibliography K. Suffern; Ray Tracing from the Ground Up, http://www.raytracegroundup.com Chapter 4, 5 for Anti-Aliasing Chapter 6 for Disc Sampling

More information

Simulation and Analysis of Interpolation Techniques for Image and Video Transcoding

Simulation and Analysis of Interpolation Techniques for Image and Video Transcoding Multimedia Communication CMPE-584 Simulation and Analysis of Interpolation Techniques for Image and Video Transcoding Mid Report Asmar Azar Khan 2005-06-0003 Objective: The objective of the project is

More information

TEXTURE MAPPING. DVA338 Computer Graphics Thomas Larsson, Afshin Ameri

TEXTURE MAPPING. DVA338 Computer Graphics Thomas Larsson, Afshin Ameri TEXTURE MAPPING DVA338 Computer Graphics Thomas Larsson, Afshin Ameri OVERVIEW Motivation Texture Mapping Coordinate Mapping (2D, 3D) Perspective Correct Interpolation Texture Filtering Mip-mapping Anisotropic

More information

Scaled representations

Scaled representations Scaled representations Big bars (resp. spots, hands, etc.) and little bars are both interesting Stripes and hairs, say Inefficient to detect big bars with big filters And there is superfluous detail in

More information

Render-To-Texture Caching. D. Sim Dietrich Jr.

Render-To-Texture Caching. D. Sim Dietrich Jr. Render-To-Texture Caching D. Sim Dietrich Jr. What is Render-To-Texture Caching? Pixel shaders are becoming more complex and expensive Per-pixel shadows Dynamic Normal Maps Bullet holes Water simulation

More information

Computer Graphics 7 - Texture mapping, bump mapping and antialiasing

Computer Graphics 7 - Texture mapping, bump mapping and antialiasing Computer Graphics 7 - Texture mapping, bump mapping and antialiasing Tom Thorne Slides courtesy of Taku Komura www.inf.ed.ac.uk/teaching/courses/cg Overview Texture mapping and bump mapping Anti-aliasing

More information

Overview. Goals. MipMapping. P5 MipMap Texturing. What are MipMaps. MipMapping in OpenGL. Generating MipMaps Filtering.

Overview. Goals. MipMapping. P5 MipMap Texturing. What are MipMaps. MipMapping in OpenGL. Generating MipMaps Filtering. Overview What are MipMaps MipMapping in OpenGL P5 MipMap Texturing Generating MipMaps Filtering Alexandra Junghans junghana@student.ethz.ch Advanced Filters You can explain why it is a good idea to use

More information

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.

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. Reading Required Watt, intro to Chapter 8 and intros to 8.1, 8.4, 8.6, 8.8. Optional 12. Texture Mapping Watt, the rest of Chapter 8 Woo, Neider, & Davis, Chapter 9 James F. Blinn and Martin E. Neell.

More information

Signals and Sampling. CMPT 461/761 Image Synthesis Torsten Möller. Machiraju/Möller

Signals and Sampling. CMPT 461/761 Image Synthesis Torsten Möller. Machiraju/Möller Signals and Sampling CMPT 461/761 Image Synthesis Torsten Möller Reading Chapter 7 of Physically Based Rendering by Pharr&Humphreys Chapter 14.10 of CG: Principles & Practice by Foley, van Dam et al. Chapter

More information

Real-Time Graphics Architecture

Real-Time Graphics Architecture Real-Time Graphics Architecture Lecture 8: Antialiasing Kurt Akeley Pat Hanrahan http://graphics.stanford.edu/cs448-07-spring/ Antialiasing Outline Aliasing and antialiasing Taxonomy of antialiasing approaches

More information

This work is about a new method for generating diffusion curve style images. Although this topic is dealing with non-photorealistic rendering, as you

This work is about a new method for generating diffusion curve style images. Although this topic is dealing with non-photorealistic rendering, as you This work is about a new method for generating diffusion curve style images. Although this topic is dealing with non-photorealistic rendering, as you will see our underlying solution is based on two-dimensional

More information

CS559: Computer Graphics. Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008

CS559: Computer Graphics. Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008 CS559: Computer Graphics Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008 Antialising Today Hidden Surface Removal Reading: Shirley ch 3.7 8 OpenGL ch 1 Last time A 2 (x 0 y 0 ) (x 1 y 1 ) P

More information

Rasterization and Graphics Hardware. Not just about fancy 3D! Rendering/Rasterization. The simplest case: Points. When do we care?

Rasterization and Graphics Hardware. Not just about fancy 3D! Rendering/Rasterization. The simplest case: Points. When do we care? Where does a picture come from? Rasterization and Graphics Hardware CS559 Course Notes Not for Projection November 2007, Mike Gleicher Result: image (raster) Input 2D/3D model of the world Rendering term

More information