2d computer graphics
play

2D Computer Graphics Diego Nehab Summer 2020 IMPA 1 - PowerPoint PPT Presentation

2D Computer Graphics Diego Nehab Summer 2020 IMPA 1 Anti-aliasing and texture mapping Value of pixel p i is given by p i f i f t i t dt How to compute the integral when f is a vector graphics illustration? Anti-aliasing Let f be a


  1. 2D Computer Graphics Diego Nehab Summer 2020 IMPA 1

  2. Anti-aliasing and texture mapping

  3. Value of pixel p i is given by p i f i f t i t dt How to compute the integral when f is a vector graphics illustration? Anti-aliasing Let f be a function and ψ an anti-aliasing fjlter 2

  4. How to compute the integral when f is a vector graphics illustration? Anti-aliasing Let f be a function and ψ an anti-aliasing fjlter Value of pixel p i is given by � ∞ p i = ( f ∗ ψ )( i ) = f ( t ) ψ ( i − t ) dt −∞ 2

  5. Anti-aliasing Let f be a function and ψ an anti-aliasing fjlter Value of pixel p i is given by � ∞ p i = ( f ∗ ψ )( i ) = f ( t ) ψ ( i − t ) dt −∞ How to compute the integral when f is a vector graphics illustration? 2

  6. Possible to clip edges, not the shapes • + general piecewise polynomial fjlters [Duff, 1989] • + curved edges [Manson and Schaefer, 2013] What about polygons with self-intersections? What about spatially varying colors? What about multiple opaque layers? What about transparency? Analytic antialiasing Assume box fjlter, single layer, solid color, simple polygon • Clip polygon against the box centered at each pixel • Compute weighted area using on Green’s theorem from Calculus 3

  7. What about polygons with self-intersections? What about spatially varying colors? What about multiple opaque layers? What about transparency? Analytic antialiasing Assume box fjlter, single layer, solid color, simple polygon • Clip polygon against the box centered at each pixel • Compute weighted area using on Green’s theorem from Calculus Possible to clip edges, not the shapes • + general piecewise polynomial fjlters [Duff, 1989] • + curved edges [Manson and Schaefer, 2013] 3

  8. What about spatially varying colors? What about multiple opaque layers? What about transparency? Analytic antialiasing Assume box fjlter, single layer, solid color, simple polygon • Clip polygon against the box centered at each pixel • Compute weighted area using on Green’s theorem from Calculus Possible to clip edges, not the shapes • + general piecewise polynomial fjlters [Duff, 1989] • + curved edges [Manson and Schaefer, 2013] What about polygons with self-intersections? 3

  9. What about multiple opaque layers? What about transparency? Analytic antialiasing Assume box fjlter, single layer, solid color, simple polygon • Clip polygon against the box centered at each pixel • Compute weighted area using on Green’s theorem from Calculus Possible to clip edges, not the shapes • + general piecewise polynomial fjlters [Duff, 1989] • + curved edges [Manson and Schaefer, 2013] What about polygons with self-intersections? What about spatially varying colors? 3

  10. What about transparency? Analytic antialiasing Assume box fjlter, single layer, solid color, simple polygon • Clip polygon against the box centered at each pixel • Compute weighted area using on Green’s theorem from Calculus Possible to clip edges, not the shapes • + general piecewise polynomial fjlters [Duff, 1989] • + curved edges [Manson and Schaefer, 2013] What about polygons with self-intersections? What about spatially varying colors? What about multiple opaque layers? 3

  11. Analytic antialiasing Assume box fjlter, single layer, solid color, simple polygon • Clip polygon against the box centered at each pixel • Compute weighted area using on Green’s theorem from Calculus Possible to clip edges, not the shapes • + general piecewise polynomial fjlters [Duff, 1989] • + curved edges [Manson and Schaefer, 2013] What about polygons with self-intersections? What about spatially varying colors? What about multiple opaque layers? What about transparency? 3

  12. Assume blending over the background b i b i Assume anti-aliasing fjlter with support Defjne the coverage o of P i at pixel p o u p P i u du The new background b i 1 is 1 i b i f i i o b i 1 i 1 i Popular hack Assume path P i with constant color f i , α f i 4

  13. Assume anti-aliasing fjlter with support Defjne the coverage o of P i at pixel p o u p P i u du The new background b i 1 is 1 i b i f i i o b i 1 i 1 i Popular hack Assume path P i with constant color f i , α f i Assume blending over the background b i , α b i 4

  14. Defjne the coverage o of P i at pixel p o u p P i u du The new background b i 1 is 1 i b i f i i o b i 1 i 1 i Popular hack Assume path P i with constant color f i , α f i Assume blending over the background b i , α b i Assume anti-aliasing fjlter ψ with support Ω 4

  15. The new background b i 1 is 1 i b i f i i o b i 1 i 1 i Popular hack Assume path P i with constant color f i , α f i Assume blending over the background b i , α b i Assume anti-aliasing fjlter ψ with support Ω Defjne the coverage o of P i at pixel p � o = [ u − p ∈ P i ] ψ ( u ) du Ω 4

  16. Popular hack Assume path P i with constant color f i , α f i Assume blending over the background b i , α b i Assume anti-aliasing fjlter ψ with support Ω Defjne the coverage o of P i at pixel p � o = [ u − p ∈ P i ] ψ ( u ) du Ω The new background b i + 1 , α i + 1 is b i + 1 , α i + 1 = f i , ( α i · o ) ⊕ b i , α i 4

  17. It also either blends in linear, or antialiases in gamma Must blend in gamma and antialias in linear [Nehab and Hoppe, 2008] 1 f i 1 b i b i i 1 b i o 1 o 1 i i i Problems with hack Visible seams at perfectly abutting layers, weird halos This is called the correlated mattes problem 5

  18. Must blend in gamma and antialias in linear [Nehab and Hoppe, 2008] 1 f i 1 b i b i i 1 b i o 1 o 1 i i i Problems with hack Visible seams at perfectly abutting layers, weird halos This is called the correlated mattes problem It also either blends in linear, or antialiases in gamma 5

  19. Problems with hack Visible seams at perfectly abutting layers, weird halos This is called the correlated mattes problem It also either blends in linear, or antialiases in gamma Must blend in gamma and antialias in linear [Nehab and Hoppe, 2008] γ − 1 ( f i , α i ⊕ b i , β i ) · o + γ − 1 ( b i , β i ) · ( 1 − o ) b i + 1 , β i + 1 = γ � � 5

  20. The associated cumulative distribution function F X is such that F X a P X a i.e., it measures the probability that the numerical value is at most a . The associated probability density function f X is such that a F X a f X t dt i.e., its integral is the cumulative distribution function. The associated expectation E X (or mean X ) is E X t f X t dt (1) X i.e., the mean value weighted by the probability density function. Probability in 2 slides A random variable X is a function that maps outcomes to numbers 6

  21. i.e., it measures the probability that the numerical value is at most a . The associated probability density function f X is such that a F X a f X t dt i.e., its integral is the cumulative distribution function. The associated expectation E X (or mean X ) is E X t f X t dt (1) X i.e., the mean value weighted by the probability density function. Probability in 2 slides A random variable X is a function that maps outcomes to numbers The associated cumulative distribution function F X is such that F X ( a ) = P [ X ≤ a ] 6

  22. The associated probability density function f X is such that a F X a f X t dt i.e., its integral is the cumulative distribution function. The associated expectation E X (or mean X ) is E X t f X t dt (1) X i.e., the mean value weighted by the probability density function. Probability in 2 slides A random variable X is a function that maps outcomes to numbers The associated cumulative distribution function F X is such that F X ( a ) = P [ X ≤ a ] i.e., it measures the probability that the numerical value is at most a . 6

  23. i.e., its integral is the cumulative distribution function. The associated expectation E X (or mean X ) is E X t f X t dt (1) X i.e., the mean value weighted by the probability density function. Probability in 2 slides A random variable X is a function that maps outcomes to numbers The associated cumulative distribution function F X is such that F X ( a ) = P [ X ≤ a ] i.e., it measures the probability that the numerical value is at most a . The associated probability density function f X is such that � a F X ( a ) = f X ( t ) dt −∞ 6

  24. The associated expectation E X (or mean X ) is E X t f X t dt (1) X i.e., the mean value weighted by the probability density function. Probability in 2 slides A random variable X is a function that maps outcomes to numbers The associated cumulative distribution function F X is such that F X ( a ) = P [ X ≤ a ] i.e., it measures the probability that the numerical value is at most a . The associated probability density function f X is such that � a F X ( a ) = f X ( t ) dt −∞ i.e., its integral is the cumulative distribution function. 6

  25. i.e., the mean value weighted by the probability density function. Probability in 2 slides A random variable X is a function that maps outcomes to numbers The associated cumulative distribution function F X is such that F X ( a ) = P [ X ≤ a ] i.e., it measures the probability that the numerical value is at most a . The associated probability density function f X is such that � a F X ( a ) = f X ( t ) dt −∞ i.e., its integral is the cumulative distribution function. The associated expectation E [ X ] (or mean µ X ) is � ∞ E [ X ] = t f X ( t ) dt = µ X (1) −∞ 6

Recommend


More recommend