Rasterization

10 Karteikartenvon Nijelous
Diese Karteikarten lernenKostenlos · Spaced Repetition · iPhone, Android, Mac & Web

Alle Karten

1
Rasterization
The hardware process where primitives are rendered to the screen, and defining which pixels are a part of said primitive.
2
Rasterization: Point Primitives
Takes the closest fragment to the point.
3
Rasterization: Line Primitives
Bresenham's Line Algorithm

Advance a primary axis each loop of rasterization. Each loop add to an error value the gradient of the slope.

If the error value >= 0.5, advance the periodic (other) axis and subtract 1 from the error value.

Primary axis = greater abs value of x and y (in the direction vector)
4
Rasterization: Triangles
Place a bounding box around the triangle (clamping it's minimum and maximum x and y values)

Two ways to solve this:
Line Equations
Barycentric Coordinates
5
Rasterization: Triangles: Line Equations
Take the line equations of each line of the triangle, and check the point p (the one you're testing) and see if it's on the correct side of the line.

Only points inside the triangle will pass all 3 lines.
6
Rasterization: Triangles: Barycentric Coordinates
Calculate the area of the triangle t
Form 3 sub triangles around point p: t0, t1 and t2
A = area of t0 / area of t
B = area of t1 / area of t
C = area of t2 / area of t
If A+B+C <= 1.0, p is inside the triangle
7
Vertex Interpolation
Applying the vertex attributes to the primitives they are a part of, smoothly across them.
8
Vertex Interpolation: Lines
t = v1 - p / v1 - v0

Colour at point p = (v1 colour * t) + (v0 colour * (1.0 - t))
9
Vertex Interpolation: Triangles
Using A, B and C from Barycentric Coordinates, times each vertex colour by the relevant coordinate number.

p colour = (v0 colour * A)+(v1 colour * B)+(v2 colour * C)
10
Signed Area of a Triangle
Easy solution for calculating the area of a 2D triangle.

Take the 4 vertices that form the triangle's sides (first one twice), and multiply the numbers leading down, and then leading up. Take away the first result from the second result and divide by 2.

Much less computationally intensive.
Alle 10 Karten kostenlos lernen

Mehr Karteikarten

Latijnse woordjes t/m les 1462 KartenSprachen · Latein → NiederländischSabrinaAdlar 🇩🇪1000 KartenSprachen · Deutsch → TürkischAliHeart Failure40 KartenGeschichte und Geisteswissenschaften · EnglischcathsimsIntegumentary system32 KartenMedizin und Gesundheit · EnglischKayleigheng426 KartenSprachen · Russisch → Englischanya€Exam 1 Questions 21 KartenMedizin und Gesundheit · Englischkarebearculture17 KartenFranzösischHassaneRespiratory Terminology13 KartenMedizin und Gesundheit · EnglischebradstreetCh 7 in class notes part 210 KartenEnglischjocyt9Nutrition Support Risk Assessment199 KartenMedizin und Gesundheit · EnglischCoryThe House112 KartenSprachen · Französisch → EnglischFloC1 Spanish Cooking Verbs81 KartenSprachen · Spanisch → EnglischSeñora

Lerne diese Decks in der App

Kostenlos auf iPhone, Android, Mac und im Web. Füge jedes Deck mit einem Tipp zu deinem Konto hinzu.

Laden im App StoreJetzt bei Google Play
Alle 10 Karten kostenlos lernen