Anti-aliasing and sampling

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

Distributed Ray Tracing

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

Sampling, Aliasing, & Mipmaps

Theoretically Perfect Sensor

Theoretically Perfect Sensor

Sampling, Aliasing, & Mipmaps

Sampling, Aliasing, & Mipmaps

Ray Tracing. Johns Hopkins Department of Computer Science Course : Rendering Techniques, Professor: Jonathan Cohen

Sampling and Monte-Carlo Integration

Sampling and Reconstruction

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

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

Anti-aliasing and Monte Carlo Path Tracing

Image warping introduction

Sampling: Antialiasing - Intro

Ray Tracing and Irregularities of Distribution

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

Physically Realistic Ray Tracing

Scaled representations

Distribution Ray Tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Reading. 8. Distribution Ray Tracing. Required: Watt, sections 10.6,14.8. Further reading:

Drawing a Triangle (and an introduction to sampling)

Recursive Ray Tracing

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

Reading. Distribution Ray Tracing. BRDF, revisited. Pixel anti-aliasing. ω in. Required: Shirley, section Further reading:

Fall CSCI 420: Computer Graphics. 7.1 Rasterization. Hao Li.

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

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

28 SAMPLING. ALIASING AND ANTI-ALIASING

EECS 487: Interactive Computer Graphics

Today. Anti-aliasing Surface Parametrization Soft Shadows Global Illumination. Exercise 2. Path Tracing Radiosity

Drawing a Triangle (and an Intro to Sampling)

CSCI 420 Computer Graphics Lecture 14. Rasterization. Scan Conversion Antialiasing [Angel Ch. 6] Jernej Barbic University of Southern California

Lecture 7: Monte Carlo Rendering. MC Advantages

COMP371 COMPUTER GRAPHICS

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

Rasterization. Rasterization (scan conversion) Digital Differential Analyzer (DDA) Rasterizing a line. Digital Differential Analyzer (DDA)

MULTI-DIMENSIONAL MONTE CARLO INTEGRATION

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

Subdivision Of Triangular Terrain Mesh Breckon, Chenney, Hobbs, Hoppe, Watts

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Ground Truth. Welcome!

Isosurface Rendering. CSC 7443: Scientific Information Visualization

Sung-Eui Yoon ( 윤성의 )

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

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

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

Rasterization Computer Graphics I Lecture 14. Scan Conversion Antialiasing Compositing [Angel, Ch , ]

Halftoning and quasi-monte Carlo

CS354 Computer Graphics Sampling and Aliasing

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics

CPSC 425: Computer Vision

Distribution Ray Tracing

Global Illumination The Game of Light Transport. Jian Huang

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Photo-realistic Renderings for Machines Seong-heum Kim

13 Distribution Ray Tracing

Distributed Ray Tracing

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics

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

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

Geometric Representations. Stelian Coros

FOURIER TRANSFORM GABOR FILTERS. and some textons

Direct Rendering. Direct Rendering Goals

Advanced Ray Tracing

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

Aliasing and Antialiasing. ITCS 4120/ Aliasing and Antialiasing

High-Degree Temporal Antialiasing

Introduction: Tech Report Frameless Antialiasing Ellen J. Scher Zagier Page #1

Monte-Carlo Ray Tracing. Antialiasing & integration. Global illumination. Why integration? Domains of integration. What else can we integrate?

CS 563 Advanced Topics in Computer Graphics Lecture 2: Bare-Bones Raytracer. by Emmanuel Agu

COMP 4801 Final Year Project. Ray Tracing for Computer Graphics. Final Project Report FYP Runjing Liu. Advised by. Dr. L.Y.

A Log-Polar Interpolation Applied to Image Scaling

Spectrally Optimal Sampling for Distribution Ray Tracing

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

ELEC Dr Reji Mathew Electrical Engineering UNSW

Scalable many-light methods

Specular reflection. Lighting II. Snell s Law. Refraction at boundary of media

Computer Graphics. - Texturing Methods -

Review. Stephen J. Guy

MURA & DEFECT DETECTION WITH TrueTest

Towards Interactive Global Illumination Effects via Sequential Monte Carlo Adaptation. Carson Brownlee Peter S. Shirley Steven G.

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

SDK White Paper. Soft Shadows

Variance Reduction. Computer Graphics CMU /15-662, Fall 2016

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

PERFORMANCE CAPTURE FROM SPARSE MULTI-VIEW VIDEO

Monte Carlo Integration

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

Wednesday, 26 January 2005, 14:OO - 17:OO h.

Fourier analysis and sampling theory

The V-Ray installer will automatically remove any previous installations. This will allow you to seamlessly upgrade from previous versions.

Lecture 10: Image Descriptors and Representation

Computer Vision: 4. Filtering. By I-Chen Lin Dept. of CS, National Chiao Tung University

Graphics (Output) Primitives. Chapters 3 & 4

Building a Fast Ray Tracer

Visual cues to 3D geometry. Light Reflection and Advanced Shading. Shading. Recognizing materials. size (perspective) occlusion shading

Basic GPU techniques Josef Pelikán CGG MFF UK Praha.

Mesh Simplification. Mesh Simplification. Mesh Simplification Goals. Mesh Simplification Motivation. Vertex Clustering. Mesh Simplification Overview

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

Transcription:

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 alias Artefacts caused by a regular-grid or regular sampling Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 2 / 34

Spatial alias jagged oblique lines regular dense system of lines or stripes on a texture can lead to Moiré effect interference of fast periodic image changes with a pixel raster example: picket fence in perspective projection too fine or too distant regular texture (checkerboard viewed from distance) Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 3 / 34

Spatial alias checkerboard 1 sample per pixel 256 spp (jittering) Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 4 / 34

Temporal alias shows in slow motion animation blinking pixels on contours of moving objects the whole small objects can blink interference of a periodic movement with a frame frequency spinning wheel seems to be still or even rotating the other direction Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 5 / 34

Real world Human visual system has no alias. Alias manifests only mildly in photography. objects smaller than resolution of a sensor are without details / blurry fence from large distance is percieved as an average-color area (mix of background + foreground colors) too fast movement generates fuzzy (blurred) perception Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 6 / 34

Reconstruction in raster context original (image function) sampling (computation) reconstruction filter: reconstruction (rendering) Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 7 / 34

Sampling and reconstruction image sampling or computing of image function higher frequencies should be reduced/removed from an image before sampling low pass filter (convolution window averaging) image synthesis can reduce higher frequencies directly (anti-aliasing by pixel supersampling) reconstruction filter is defined by an output device e.g. neighbour CRT monitor pixels overlap LCD pixels behave differently Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 8 / 34

Anti-aliasing by supersampling Image function with continuous domain and unlimited spectrum: f x, y Anti-aliasing filter (function with limited support): h x, y Pixel color [i,j]:,,, I i j f x y h x i y j dx dy Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 9 / 34

Simple variant Assuming box smoothing filter and unit square pixel:,, I i j j 1i 1 j i f x y dx dy (integral average value of the image function on the pixel area) Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 10 / 34

Quadrature analytic (close form solution) in rare cases (simple image function) numeric solution using sampling finite set of samples [x i,y i ] integral estimate by the sum stochastic sampling Monte-Carlo method I i, j k,, f x y h x y k k k k k h x k, y k Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 11 / 34

Sampling methods mapping: k [ x k, y k ] sample is selected from the given 2D region (domain): usually rectangular, square or circular sampling in higher dimensions (dim=10) required properties of sampling algorithms uniform probability over a domain high regularity is not desirable (interference) efficient computation Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 12 / 34

Uniform sampling Does not reduce Moire / interference (interference still appears in higher frequencies) Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 13 / 34

Random sampling N independent random samples with uniform probability density (PDF) Samples tend to form clusters Too much noise in a result image Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 14 / 34

Jittering K K independent random samples in K K equally sized sub-regions covering the original domain completely Big clusters are not possible More regular coverage of a domain Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 15 / 34

Partial jittering, semi-jittering K K independent random samples in K K equally sized sub-regions not covering the original domain Clusters are impossible Too regular (interference) Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 16 / 34

N rooks ( uncorrelated jitter ) Low-cost jittering : there is exactly one sample in each row and in each column. Random permutation of a diagonal Good properties of jittering are preserved Higher efficiency (especially in high dimensions) Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 17 / 34

Hammersley + excellent discrepancy + deterministic + very fast - difficult adaptive refinement - bad spatial spectrum Famous Halton sequence is based on similar principles.. Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 18 / 34

Deterministic sequences based on similar principles: Halton, Hammersley, Larcher-Pillichshammer for a prime number b let n be positive integer expressed using b-representation: L 1 n = k=0 d k (n)b k then there is a number from [0,1) range: L 1 g (n) = b k=0 d k (n)b k 1 Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 19 / 34

Halton, Hammersley famous Halton sequence (e.g. b 1 =2, b 2 =3): x(n) = [ g b1 (n), g b2 (n)] Hammersley sequence (e.g. b=2): x(n) =[ n N, g b (n) ] Larcher-Pillichshammer sequence uses XOR operation instead of addition (inside the g b (n) ).. Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 20 / 34

Poisson disk sampling d N random samples meeting condition: [x k,y k ] - [x l,y l ] > d for given value d Prevents creating clusters, imitates distribution of light-perception cells in retina of a mammal. Difficult efficient implementation! Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 21 / 34

Implementation rejection sampling candidate sample is rejected if too close to any previous accepted sample less efficient for higher number of samples choice of value d is problematic maximum number of placeable samples depends on d difficult (adaptive) refinement additional samples to a existing set of samples Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 22 / 34

Mitchell's algorithm ( best candidate algorithm) generates gradually refined sample set (from Poisson sampling) no problems with d intrinsic refinement compute-intensive algorithm sample set can be precomputed and reused to reduce dependency between neighbour pixels random rotation and translation can be used Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 23 / 34

Mitchell's algorithm the 1 st sample is chosen randomly choice of the (k+1) th sample: generate k q independent candidates (q determines sample-set quality) the most distant candidate (from all previous k accepted samples) is selected and accepted for higher q we get better quality set choose q > 10 in demanding situations Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 24 / 34

Incremental example Sample numbers: 10, 40, 160, 640, 2560 K = 10 Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 25 / 34

Adaptive refinement sampling based on local importance (importance sampling) or interest some regions have higher weight (higher probability) regions with higher variance should be sampled more densely importance or interest need not be known in advance (explicitly) algorithm has to adopt to intermediate results (adaptability) Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 26 / 34

Modification of static methods initial phase: compute small set of test samples (1-5) define refinement criterion based on previous samples refinement phase: sampling is refined in regions of higher need (criterion) efficiency: if we can reuse all generated samples almost every sampling algorithm can be reformulated in that way Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 27 / 34

Refinement criteria function values (difference, variance, gradient) difference between neighbour samples,.. Id's of hit solids (Ray-tracing specific) higher priority textures with repeated patterns use of signatures trace tree (recursive ray-tracing) topologic comparison of complete or limited trace trees tree identifier recursive hash function using solid Id's, texture signatures, shadow/light,.. Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 28 / 34

Adaptive resampling example 1 spp 1/2 spp adaptive refinement map Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 29 / 34

Recursive refinement (Whitted)?? sampling region (square pixel)?? primary samples compared tuples of primary samples Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 30 / 34

Refinement phase refined regions additional samples The same procedure is executed in refined regions recursively (up to the declared maximum level) Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 31 / 34

Result sample set phase I phase II phase III Evaluated: 5+5+9 = 19 samples (from total number of 41) Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 32 / 34

Pixel value reconstruction A B E C D If the refinement stops in a specific square, its area is split to two triangles (diagonal samples) 1 2 1 8 E A B C D Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 33 / 34

References A. Glassner: An Introduction to Ray Tracing, Academic Press, London 1989, 161-171 A. Glassner: Principles of Digital Image Synthesis, Morgan Kaufmann, 1995, 299-540 J. Pelikán: Náhodné rozmisťování bodů v rovině (Random point placement), CSGG 2014, slides & paper available online Sampling 2017 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 34 / 34