Arrangements and Duality Supersampling in Ray Tracing
Introduction Ray Tracing & Ray Casting: Shooting rays from the image plane and determine which object they hit Issue: Each pixel has an area, where should we shoot the rays?
Introduction Center? Creating artifacts. We need super-sample! Shooting many rays through each pixel and average the result How should we distribute the rays? Regularly—causes regular artifacts Randomly
Introduction (a)reference (b)regular (c)random (d)random super sample
Discrepancy How do we choose sample points? How do we know if a sample set S is good? Discrepancy: difference between the percentage of hits for an object and the percentage of the pixel area where that object is visible Assumption: scene is made of polygons
Discrepancy
Compute Discrepancy Replace infinite candidates by a finite set The half-plane of maximum discrepancy must pass through at least one sample point
Compute Discrepancy Lemma 8.1 Let S be a set of n points in the unit square U. A half-plane h that achieves the maximum discrepancy with respect to S is of one of the following types: (i) h contains one point p ∈ S on its boundary, (ii) h contains two or more points of S on its boundary.
Compute Discrepancy
Duality
Back to the Discrepancy problem To determine our discrete measure we need to Determine how many sample points lie below a given line (in the primal plane) dualizes to Given a point in the dual plane we want to determine how many sample lines lie above it. Easier to compute?
Arrangements of Lines
Bounded Arrangement
Storage: DCEL Doubly Connected Edge List (DCEL) Vertex Coordinates of v IncidentEdge e(v) Face An edge Half-Edges Origin o(e) Twin The face to its left Next previous
Compute Arrangement
Incremental Algorithm
Running Time of Incremental Algorithm
Zone theory
The complexity of a zone is defined as the total complexity of all the faces it consists of, i.e. the sum of the number of edges and vertices of those faces The complexity of the zone of a line in an arrangement of m lines on the plane is O(m)
Prove of Zone Theory
Each edge in the zone of l is a left bounding edge and a right bounding edge. Claim: number of left bounding edges <= 5m Same for number of right bounding edges Total complexity of zone(l) is linear
Prove of Zone Theory: Induction
Levels and Discrepancy Back to discrepancy, we want to compute for every line between two sample points how many sample points line above that line dualize to For an arrangement how many lines are below each point
Levels and Discrepancy
Sampling Algorithms Sobel sequence Halton sequence Hammersley set etc.
Independent vs. Low Discrepancy
References Computational Geometry Algorithms and Applications, Third Edition, Mark de Berg MIT slides, old/handouts/lec7.pdfhttp://people.csail.mit.edu/indyk/ old/handouts/lec7.pdf Utrecht University Geometry Algorithms slides, Physically Based Rendering, Second Edition, Matt Pharr course and project website: