Rasterization

10 flashcardspar Nijelous
Réviser ces flashcardsGratuit · répétition espacée · iPhone, Android, Mac et web

Toutes les cartes

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.
Réviser les 10 cartes gratuitement

Plus de flashcards

Latijnse woordjes t/m les 1462 cartesLangues · Latin → NéerlandaisSabrinaAdlar 🇩🇪1000 cartesLangues · Allemand → TurcAliHeart Failure40 cartesHistoire et lettres · AnglaiscathsimsIntegumentary system32 cartesMédecine et santé · AnglaisKayleigheng426 cartesLangues · Russe → Anglaisanya€Exam 1 Questions 21 cartesMédecine et santé · Anglaiskarebearculture17 cartesFrançaisHassaneRespiratory Terminology13 cartesMédecine et santé · AnglaisebradstreetCh 7 in class notes part 210 cartesAnglaisjocyt9Nutrition Support Risk Assessment199 cartesMédecine et santé · AnglaisCoryThe House112 cartesLangues · Français → AnglaisFloC1 Spanish Cooking Verbs81 cartesLangues · Espagnol → AnglaisSeñora

Révise ces decks dans l’app

Gratuit sur iPhone, Android, Mac et le web. Ajoute n’importe quel deck à ton compte en un tap.

Télécharger dans l’App StoreDisponible sur Google Play
Réviser les 10 cartes gratuitement