From ed8c3b800ebe227c77367373affe758c0034d1ea Mon Sep 17 00:00:00 2001 From: light7734 Date: Fri, 1 Aug 2025 18:26:59 +0330 Subject: [PATCH] wip --- .../geometry-processing/+page.svx | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/src/routes/articles/the-graphics-pipeline/geometry-processing/+page.svx b/src/routes/articles/the-graphics-pipeline/geometry-processing/+page.svx index e782be1..de99bc6 100644 --- a/src/routes/articles/the-graphics-pipeline/geometry-processing/+page.svx +++ b/src/routes/articles/the-graphics-pipeline/geometry-processing/+page.svx @@ -1,5 +1,5 @@ --- -title: The Graphics Pipeline ; Part 1 +title: The Graphics Pipeline - Part 1 date: "April 20 - 2025" --- @@ -20,7 +20,7 @@ And hey, if you still have questions, feel free to reach out :) Initially, I tried cramming everything in **one article**, which hurt the **brevity** and the **structure**. The **graphics pipeline** is a beast---incredibly **complex** and constantly **evolving**. -So I split it into a **4-part series**, which lets me go into sufficient depth. +So I split it into a **4-part series**, which lets me go into sufficient depth for each stage. But why exactly **4-parts**? ## Overview @@ -185,7 +185,7 @@ triangles. So, we got our set of vertices, but having a bunch of points floating around wouldn't make a scene very lively (or gory), we need to form **triangles** out of them to compose **models** (like our beautiful corpse). -The **input assembler** is first the mini-stage in the **geometry processing** stage. And it's responsible for **concatenating** our vertices (the input) to assemble **primitives**. +The **input assembler** is first the (sub)stage in the **geometry processing** stage. And it's responsible for **concatenating** our vertices (the input) to assemble **primitives**. It is a **fixed function** stage so we can only configure it (it's not programmable). We can tell the assembler how it should interpret the vertex data by configuring its **primitive** The way in which constituent parts are interrelated or arranged.--mid 19th century: via German from Greek topos ‘place’ + -logy.---Oxford Languages . @@ -202,7 +202,7 @@ and the number of primitives (n of p) is equals to the number of vertices (n of - + ```math \begin{aligned} @@ -222,7 +222,7 @@ When the topology is **line list**, each **consecutive pair of vertices** define - + ```math \begin{aligned} @@ -243,7 +243,7 @@ When the primitive topology is **line strip**, **one line** is defined by each * - + ```math \begin{aligned} @@ -263,7 +263,7 @@ When the primitive topology is **triangle list**, each **consecutive set of thre - + ```math \begin{aligned} @@ -283,7 +283,7 @@ When the primitive topology is **triangle strip**, **one triangle** is defined b - + ```math \begin{aligned} @@ -304,7 +304,7 @@ When the primitive topology is **triangle fan**, **triangles** are defined **aro - + ```math \begin{aligned} @@ -393,8 +393,8 @@ We got our surface representation---**vertices**. We set the **primitive topolog how to concatenate them. And we optionally (but most certainly) provided some **indices** to avoid duplication. -All this data (and configuration) is then fed to the very first mini-stage of the **graphics pipeline** called -the **input assembler**. Which as stated before, is responsible for **assembling** primitives from our **input** (vertices and indices). +All this data (and configuration) is then fed to the very first (sub)stage of the **graphics pipeline** called +the **input assembler**. Which as stated before, is responsible for **assembling** primitives from our **input** (vertices and indices) @@ -429,7 +429,7 @@ Anything outside of this range is, again, **clipped** and not visible. Yet, as you might imagine, doing everything in the **NDC** is inconvenient and very limiting. We'd like to **compose** a scene by Scale, Rotate, Translate. some objects around, **interact** with the scene by moving and looking around, and express coordinates in arbitrary -units---such as meters. +units such as meters---or yards and inches if you're American. This is done by transforming these vertices through **5 coordinate systems** before ending up in NDC (or outside of if they're meant to be clipped). Here's a high-level overview: @@ -494,7 +494,7 @@ or as a **list of numbers** that happen to have a cute **geometric interpretatio As long the [aximos of vector spaces](https://www.math.ucla.edu/~tao/resource/general/121.1.00s/vector_axioms.html) apply to them, they're vectors. However, we won't go into such axioms as we're not interested in **abstract** thinking here. -We're aiming to do something **concrete** called **linear transformations** of a set of vertices (models). +We're aiming to do something **concrete** like **linear transformations** of a set of vertices (models). So it would be ideal for us to think of them like this: - A vector describes a series of steps to perform a **transformation** in space. @@ -578,7 +578,7 @@ Representing rotations like this makes us prone to a phenomenon called **gimbal an axis of control. A way of avoiding this is to rotate around an arbitary axis (makes it a lot harder to happen but still possible). -The ideal way is to use A quaternion is a four-part hyper-complex number used in three-dimensional rotations and orientations. +The ideal way however, is to use A quaternion is a four-part hyper-complex number used in three-dimensional rotations and orientations. A quaternion number is represented in the form a+bi+cj+dk, where a, b, c, and d parts are real numbers, and i, j, and k are the basis elements, satisfying the equation: i2 = j2 = k2 = ijk = −1., which not only make gimbal lock impossible but are also more computationally friendly. @@ -587,8 +587,6 @@ I've left links at the end of this article for further study. -**Why Translation is not a linear transformation** - **Translation** @@ -618,7 +616,7 @@ And the cube looks plain like this: -I hope this one is easy to grasp since **technically** been using it in our initial triangle +I hope this one is easy to grasp since **technically** we've been using it in our initial triangle and square examples already, the local space just happened to be in NDC though that is not necessary. Say if we arbitrarily consider each 1 unit is 1cm, then a 10m x 10m cube would have the following @@ -649,14 +647,14 @@ This transformation is stored in a matrix called the **model matrix**. This is t So one down, two more to go! ## Coordinate system -- View Space -Alternatively names include: **eye space** or the **camera space**. +Alternatively called: the **eye space** or the **camera space**. This is where the crucial element of **interactivity** comes to life (well depends if you can move the view in your game or not). Currently, we're looking at the world through a fixed lens. Since everything that's rendered will be in the [-1.0, 1.0] range, that means -**moving** our selves or our **eyes** or the game's **camera** doesn't have a real meaning. +**moving** our selves, (or our **eyes** or, the game's **camera**, however you **look** at it) doesn't have a real meaning. Now it's you that's stuck! (haha). But don't worry your layz-ass, instead of moving yourself (which again would not make sense since everything visible ends up in the NDC), you can move the world! (how entitled). @@ -825,14 +823,14 @@ Some LLMs - + [Joey De Vriez --- LearnOpenGL](https://learnopengl.com/)
[Tomas Akenine Moller --- Real-Time Rendering (4th ed)](https://www.realtimerendering.com/intro.html)
[Gabriel Gambetta --- Computer Graphics from Scratch](https://gabrielgambetta.com/computer-graphics-from-scratch/)
- + [Polygonal Modeling](https://en.wikipedia.org/wiki/Polygonal_modeling)
[Non-uniform Rational B-spline Surfaces](https://en.wikipedia.org/wiki/Non-uniform_rational_B-spline)
@@ -843,7 +841,7 @@ Some LLMs
- + [Miolith --- Quick Understanding of Homogeneous Coordinates for Computer Graphics](https://www.youtube.com/watch?v=o-xwmTODTUI)
[Leios Labs --- What are affine transformations?](https://www.youtube.com/watch?v=E3Phj6J287o)
@@ -856,7 +854,7 @@ Some LLMs [javidx9 --- Essential Mathematics For Aspiring Game Developers](https://www.youtube.com/watch?v=DPfxjQ6sqrc)
- + [Stackoverflow --- Why do 3D engines primarily use triangles to draw surfaces?](https://stackoverflow.com/questions/6100528/why-do-3d-engines-primarily-use-triangles-to-draw-surfaces)
[The ryg blog --- The barycentric conspiracy](https://fgiesen.wordpress.com/2013/02/06/the-barycentric-conspirac/)
@@ -866,7 +864,7 @@ Some LLMs [Axioms of vector spaces](https://www.math.ucla.edu/~tao/resource/general/121.1.00s/vector_axioms.html)
- + [Vulkan Docs --- Drawing](https://docs.vulkan.org/spec/latest/chapters/drawing.html)
[Vulkan Docs --- Pipeline Diagram](https://docs.vulkan.org/spec/latest/_images/pipelinemesh.svg)