Rasterization CS 148: Summer 2016 Introduction of Graphics and - - PowerPoint PPT Presentation

rasterization
SMART_READER_LITE
LIVE PREVIEW

Rasterization CS 148: Summer 2016 Introduction of Graphics and - - PowerPoint PPT Presentation

Rasterization CS 148: Summer 2016 Introduction of Graphics and Imaging Zahid Hossain http://iloveshaders.blogspot.com/2011/05/how-rasterization-process-works.html Render [ren-der]: The process of generating an image from a description of a


slide-1
SLIDE 1

CS 148: Summer 2016 Introduction of Graphics and Imaging Zahid Hossain

Rasterization

http://iloveshaders.blogspot.com/2011/05/how-rasterization-process-works.html

slide-2
SLIDE 2

Render [ren-der]:

The process of generating an image from a description

  • f a scene by means of a computer program

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 2

https://en.wikipedia.org/wiki/Rendering_(computer_graphics)

slide-3
SLIDE 3

Two Ways to Render an Image

3 CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain

slide-4
SLIDE 4

Two Ways to Render an Image

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 4

Projection: 3D description to 2D description

slide-5
SLIDE 5

Two Ways to Render an Image

Rasterization

http://iloveshaders.blogspot.com/2011/05/how-rasterization-process-works.html

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 5

slide-6
SLIDE 6

Two Ways to Render an Image

http://upload.wikimedia.org/wikipedia/commons/8/83/Ray_trace_diagram.svg CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 6

Raytracing

slide-7
SLIDE 7

Rasterization

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 7

slide-8
SLIDE 8

Rasterize [rastərʌɪz]:

To convert vector data to raster format.

Rasterize [rastərʌɪz]:

To convert vector data to raster – pixel or dot – format.

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 8

slide-9
SLIDE 9

Rasterization Process

“A triangle is here, a circle is there, …” “This pixel is yellow…”

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 9

slide-10
SLIDE 10

Scan Conversion

Figuring out which pixels to shade.

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 10

slide-11
SLIDE 11

The Basics: Framebuffer

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 11

slide-12
SLIDE 12

The Basics: Framebuffer

Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel Pixel

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 12

slide-13
SLIDE 13

Framebuffer Coordinates

(0,0)

+ x

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 13

Pixel Center

+ y

(1,1) (2,1)

slide-14
SLIDE 14

Problem

+ x + y

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 14

slide-15
SLIDE 15

The Basics: Scan Conversion

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 15

+ x + y

slide-16
SLIDE 16

The Basics: Scan Conversion

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 16

+ x + y

slide-17
SLIDE 17

Convention

+ x + y

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 17

Must intersect diamond

slide-18
SLIDE 18

Convention

+ x + y

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 18

Must intersect diamond

slide-19
SLIDE 19

Desirable Properties

  • Fast
  • Simple
  • Integer arithmetic

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 19

slide-20
SLIDE 20

Bresenham’s Algorithm

  • Introduced in 1967
  • Best-fit approximation

under some conditions

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 20

slide-21
SLIDE 21

Bresenham’s Algorithm

  • Introduced in 1967
  • Best-fit approximation

under some conditions

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 21

Variation by Pitteway (1967) “Midpoint Algorithm”

slide-22
SLIDE 22

Bresenham’s Algorithm

  • Equation of a line

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 22

slide-23
SLIDE 23

Bresenham’s Algorithm

  • Equation of a line

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 23

Assumption:

slide-24
SLIDE 24

Bresenham’s Algorithm

  • Equation of a line

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 24

Assumption:

Easy fix via rotation/reflection

slide-25
SLIDE 25

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 25

1 𝜗 Stategy

  • Every step: increment x
  • Keep track of “error” ϵ
  • At every step accumulate
  • 𝜗 ← 𝜗 + 𝑛
  • If 𝜗 ≥

' (

  • Increment y
  • Reset 𝜗 ← 𝜗 + 𝑛 − 1
  • Start with 𝜗 = 𝑛
slide-26
SLIDE 26

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 26

Algorithm

line(𝒚𝟏, 𝒛𝟏,𝒚𝟐, 𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝝑 = 𝒏 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝝑 > 𝟐

𝟑

𝒛 ← 𝒛 + 𝟐 𝝑 ← 𝝑 + 𝒏 − 𝟐 else 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

𝜗 1

slide-27
SLIDE 27

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 27

Algorithm

line(𝒚𝟏, 𝒛𝟏,𝒚𝟐, 𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝝑 = 𝒏 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝝑 > 𝟐

𝟑

𝒛 ← 𝒛 + 𝟐 𝝑 ← 𝝑 + 𝒏 − 𝟐 else 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

𝜗 1

slide-28
SLIDE 28

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 28

Algorithm

line(𝒚𝟏, 𝒛𝟏,𝒚𝟐, 𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝝑 = 𝒏 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝝑 > 𝟐

𝟑

𝒛 ← 𝒛 + 𝟐 𝝑 ← 𝝑 − 𝟐 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

𝜗 1

slide-29
SLIDE 29

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 29

Algorithm

line(𝒚𝟏, 𝒛𝟏,𝒚𝟐, 𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝝑 = 𝒏 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝝑 > 𝟐

𝟑

𝒛 ← 𝒛 + 𝟐 𝝑 ← 𝝑 − 𝟐 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

𝜗 (𝑦0,𝑧0) 𝑦,𝑧

slide-30
SLIDE 30

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 30

Algorithm

line(𝒚𝟏, 𝒛𝟏,𝒚𝟐, 𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝝑 = 𝒏 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝝑 > 𝟐

𝟑

𝒛 ← 𝒛 + 𝟐 𝝑 ← 𝝑 − 𝟐 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

𝜗 (𝑦0,𝑧0) 𝑦,𝑧

slide-31
SLIDE 31

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 31

Algorithm

line(𝒚𝟏, 𝒛𝟏,𝒚𝟐, 𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝝑 = 𝒏 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝝑 > 𝟐

𝟑

𝒛 ← 𝒛 + 𝟐 𝝑 ← 𝝑 − 𝟐 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

𝜗 (𝑦0,𝑧0) 𝑦,𝑧

slide-32
SLIDE 32

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 32

Algorithm

line(𝒚𝟏, 𝒛𝟏,𝒚𝟐, 𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝝑 = 𝒏 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝝑 > 𝟐

𝟑

𝒛 ← 𝒛 + 𝟐 𝝑 ← 𝝑 − 𝟐 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

𝜗 (𝑦0,𝑧0) 𝑦,𝑧

slide-33
SLIDE 33

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 33

line(𝒚𝟏, 𝒛𝟏, 𝒚𝟐,𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝝑 = 𝒏 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝝑 >

𝟐 𝟑

𝒛 ← 𝒛 + 𝟐 𝝑 ← 𝝑 − 𝟐 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

slide-34
SLIDE 34

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 34

line(𝒚𝟏, 𝒛𝟏, 𝒚𝟐,𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝝑 = 𝒏 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝝑 >

𝟐 𝟑

𝒛 ← 𝒛 + 𝟐 𝝑 ← 𝝑 − 𝟐 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

𝜗 = 𝑛 =

=> =?

⇒ Δ𝑦 𝜗 = Δ𝑧 ⇒ 2Δ𝑦 𝜗 = 2Δ𝑧 Use 𝑒 = 2Δ𝑦 𝜗

slide-35
SLIDE 35

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 35

line(𝒚𝟏, 𝒛𝟏, 𝒚𝟐,𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝒆 = 𝟑𝚬𝐳 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝝑 >

𝟐 𝟑

𝒛 ← 𝒛 + 𝟐 𝝑 ← 𝝑 − 𝟐 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

𝜗 = 𝑛 =

=> =?

⇒ Δ𝑦 𝜗 = Δ𝑧 ⇒ 2Δ𝑦 𝜗 = 2Δ𝑧 Use 𝑒 = 2Δ𝑦 𝜗

slide-36
SLIDE 36

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 36

line(𝒚𝟏, 𝒛𝟏, 𝒚𝟐,𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝒆 = 𝟑𝚬𝐳 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝝑 >

𝟐 𝟑

𝒛 ← 𝒛 + 𝟐 𝝑 ← 𝝑 − 𝟐 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

𝜗 >

' (

⇒ 2Δ𝑦 𝜗 > Δx ⇒ 𝑒 > Δ𝑦

slide-37
SLIDE 37

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 37

line(𝒚𝟏, 𝒛𝟏, 𝒚𝟐,𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝒆 = 𝟑𝚬𝐳 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝒆 > 𝚬𝐲 𝒛 ← 𝒛 + 𝟐 𝝑 ← 𝝑 − 𝟐 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

𝜗 >

' (

⇒ 2Δ𝑦 𝜗 > Δx ⇒ 𝑒 > Δ𝑦

slide-38
SLIDE 38

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 38

line(𝒚𝟏, 𝒛𝟏, 𝒚𝟐,𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝒆 = 𝟑𝚬𝐳 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝒆 > 𝚬𝐲 𝒛 ← 𝒛 + 𝟐 𝝑 ← 𝝑 − 𝟐 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

𝜗 >

' (

⇒ 2Δ𝑦 𝜗 > Δx ⇒ 𝑒 > Δ𝑦

slide-39
SLIDE 39

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 39

line(𝒚𝟏, 𝒛𝟏, 𝒚𝟐,𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝒆 = 𝟑𝚬𝐳 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝒆 > 𝚬𝐲 𝒛 ← 𝒛 + 𝟐 𝒆 ← 𝒆 − 𝟑𝚬𝐲 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

𝜗 >

' (

⇒ 2Δ𝑦 𝜗 > Δx ⇒ 𝑒 > Δ𝑦

slide-40
SLIDE 40

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 40

line(𝒚𝟏, 𝒛𝟏, 𝒚𝟐,𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝒆 = 𝟑𝚬𝐳 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝒆 > 𝚬𝐲 𝒛 ← 𝒛 + 𝟐 𝒆 ← 𝒆 − 𝟑𝚬𝐲 𝝑 ← 𝝑 + 𝒏 𝒚 ← 𝒚 + 𝟐

𝜗 >

' (

⇒ 2Δ𝑦 𝜗 > Δx ⇒ 𝑒 > Δ𝑦

slide-41
SLIDE 41

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 41

line(𝒚𝟏, 𝒛𝟏, 𝒚𝟐,𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝒆 = 𝟑𝚬𝐳 while 𝒚 < 𝒚𝟐 pixel(𝒚, 𝒛) if 𝒆 > 𝚬𝐲 𝒛 ← 𝒛 + 𝟐 𝒆 ← 𝒆 − 𝟑𝚬𝐲 𝒆 ← 𝒆 + 𝟑𝚬𝐳 𝒚 ← 𝒚 + 𝟐

𝜗 >

' (

⇒ 2Δ𝑦 𝜗 > Δx ⇒ 𝑒 > Δ𝑦

slide-42
SLIDE 42

Bresenham’s Algorithm

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 42

line(𝒚𝟏,𝒛𝟏,𝒚𝟐,𝒛𝟐) 𝒚 ← 𝒚𝟏 𝐳 ← 𝒛𝟏 𝚬y ← 𝒛𝟐 − 𝒛𝟏 𝚬𝒚 ← 𝒚𝟐 − 𝒚𝟏 twoDY ← 𝚬𝐳 ≪ 𝟐 twoDX ← 𝚬𝐲 ≪ 𝟐 𝒆 = twoDY while 𝒚 < 𝒚𝟐 pixel(𝒚,𝒛) if 𝒆 > 𝚬𝐲 𝒛 ← 𝒛 + 𝟐 𝒆 ← 𝒆 −twoDX 𝒆 ← 𝒆 +twoDY 𝒚 ← 𝒚 + 𝟐

slide-43
SLIDE 43

Different Method: Same Output

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 43

Pitteway (1967) “Midpoint Algorithm” READING ASSIGNMENT !

slide-44
SLIDE 44

Rasterizing Circle

+ x + y

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 44

slide-45
SLIDE 45

Midpoint Algorithm: Idea

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 45

slide-46
SLIDE 46

Midpoint Algorithm: Idea

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 46

Equation of a line:

slide-47
SLIDE 47

Midpoint Algorithm: Idea

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 47

Equation of a line: Implicit Form

slide-48
SLIDE 48

Midpoint Algorithm: Idea

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 48

Equation of a line: Implicit Form

slide-49
SLIDE 49

Midpoint Algorithm: Idea

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 49

F(x, y) > 0

slide-50
SLIDE 50

Midpoint Algorithm: Idea

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 50

slide-51
SLIDE 51

Midpoint Algorithm: Idea

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 51

Assume

slide-52
SLIDE 52

Midpoint Algorithm: Idea

Assume

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 52

NE E

Choose between E and NE

slide-53
SLIDE 53

Midpoint Algorithm: Idea

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 53

Decision variable: for next move NE E

slide-54
SLIDE 54

Midpoint Algorithm: Idea

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 54

Decision variable: for next move In this case NE E

Choose NE

slide-55
SLIDE 55

Midpoint Algorithm: Idea

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 55

Decision variable update When NE was chosen

slide-56
SLIDE 56

Midpoint Algorithm: Idea

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 56

Decision variable update When NE was chosen If E were chosen instead

slide-57
SLIDE 57

Midpoint Algorithm: Idea

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 57

Recall

Fraction!

slide-58
SLIDE 58

Midpoint Algorithm: Idea

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 58

Recall

Fraction! Define Implicit Function as:

slide-59
SLIDE 59

Midpoint Algorithm: Summary

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 59

slide-60
SLIDE 60

Circle with Midpoint Algorithm

+ x + y

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 60

slide-61
SLIDE 61

Important Issues We’ve Ignored

http://www.cheap-computermonitors.com/images/1-cheap-flat-screen-computer-monitors.jpg

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 61

Clipping

slide-62
SLIDE 62

Important Issues We’ve Ignored

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 62

Clipping

slide-63
SLIDE 63

Important Issues We’ve Ignored

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 63

Clipping

slide-64
SLIDE 64

Important Issues We’ve Ignored

Line intensity

l ¼ 7:07 p = 5 l = 5 p = 5

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 64

slide-65
SLIDE 65

Important Issues We’ve Ignored

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 65

Line Thickness

slide-66
SLIDE 66

Important Issues We’ve Ignored

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 66

Antialiasing

slide-67
SLIDE 67

Important Issues We’ve Ignored

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 67

Antialiasing

slide-68
SLIDE 68

Important Issues We’ve Ignored

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 68

Antialiasing

slide-69
SLIDE 69

Important Issues We’ve Ignored

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 69

Stippling Patterns

slide-70
SLIDE 70

Filling Triangles

  • Optimize a single primitive
  • Nice properties:
  • Planar
  • “Inside” well-defined
  • Straightforward shading

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 70

slide-71
SLIDE 71

Have We Lost Anything?

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 71

slide-72
SLIDE 72

Have We Lost Anything?

Non-convex!

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 72

slide-73
SLIDE 73

Have We Lost Anything?

<CS 268/>

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 73

slide-74
SLIDE 74

Two Methods for Filling

Check if each pixel in bounding box is inside the triangle. Rasterize border; sweep from left to right.

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 74

Parallelizable Less Computation

slide-75
SLIDE 75

Barycentric Coordinates

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 75

slide-76
SLIDE 76

Barycentric Coordinates

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 76

slide-77
SLIDE 77

Barycentric Coordinates

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 77

slide-78
SLIDE 78

Barycentric Coordinates

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 78

slide-79
SLIDE 79

Barycentric Coordinates

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 79

Point inside

slide-80
SLIDE 80

Barycentric Coordinates

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 80

Point outside

slide-81
SLIDE 81

Barycentric Interpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 81

slide-82
SLIDE 82

Barycentric Interpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 82

slide-83
SLIDE 83

Barycentric Interpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 83

Linear

slide-84
SLIDE 84

Barycentric Interpolation

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 84

Continuous across boundaries

Only depends on these two

slide-85
SLIDE 85

Issues

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 85

Adjacency and Singularity

slide-86
SLIDE 86

More Issues

CS 148: Introduction to Computer Graphics and Imaging (Summer 2016) – Zahid Hossain 86

Small triangle and slivers

slide-87
SLIDE 87

CS 148: Summer 2016 Introduction of Graphics and Imaging Zahid Hossain

Rasterization

http://iloveshaders.blogspot.com/2011/05/how-rasterization-process-works.html