Tidy up
This commit is contained in:
103 files changed
+3663
-3779
No files matched your search
@@ -2,17 +2,17 @@
|
||||
|
||||
**Rendering** is the process of drawing images on the computer display. In this course we will focus on images which are made up of triangles.
|
||||
|
||||
Rendering in 2-Dimensions involves the following
|
||||
Rendering in 2-Dimensions involves the following
|
||||
|
||||
1. The graphics programmer specifies vertices which make up some triangles to be drawn.
|
||||
2. The API assembles triangles from the vertices.
|
||||
1. The graphics programmer specifies vertices which make up some triangles to be drawn.
|
||||
2. The API assembles triangles from the vertices.
|
||||
3. The API rasterises the triangles to calculate which pixels are inside each triangle.
|
||||
4. The pixels inside triangles, called fragments, are shaded to calculate the colour.
|
||||
4. The pixels inside triangles, called fragments, are shaded to calculate the colour.
|
||||
5. The colours are displayed at the appropriate pixels.
|
||||
|
||||
A **vertex** is a point in space and is used to model geometry. A vertex can be presented using a vector, which is like an arrow. Can be written as $v=(3,2,0)$
|
||||
A **vertex** is a point in space and is used to model geometry. A vertex can be presented using a vector, which is like an arrow. Can be written as $v=(3,2,0)$
|
||||
|
||||
A *fragement* is a piece of a triangle which will be drawn to a pixel.
|
||||
A *fragment* is a piece of a triangle which will be drawn to a pixel.
|
||||
|
||||
A section of memory called a **frame buffer** (or colour buffer) stores the colour values that will be used at each pixel.
|
||||
|
||||
@@ -21,15 +21,15 @@ A shader is a program. Shaders are run on the GPU.
|
||||
#### Rendering Stages
|
||||
|
||||
1. Vertex Specification
|
||||
- In the application the vertices making up the triangles are specified, that is, given positions. The application is a software program which might be a Computer Aided Design (CAD), some kind of simulation, a visualisation, or a videogame. The graphics programmer specifies the location of vertices which make up the triangles to be rendered. These vertices are passed to the vertex shaders.
|
||||
- In the application the vertices making up the triangles are specified, that is, given positions. The application is a software program which might be a computer-aided design (CAD) program, some kind of simulation, a visualisation, or a video game. The graphics programmer specifies the location of vertices which make up the triangles to be rendered. These vertices are passed to the vertex shaders.
|
||||
2. Vertex Shader
|
||||
- Vertex processing by the vertex shader moves the vertices around. . The Vertices are used to construct triangles.
|
||||
- Vertex processing by the vertex shader moves the vertices around. The vertices are used to construct triangles.
|
||||
3. Rasterisation
|
||||
- There may be empty space around the triangles. Rasterisation is the process of taking all of the triangles and figuring out which pixels are inside each of the triangles.
|
||||
- Each of these pixels inside the triangles is called a fragment.
|
||||
- Rasterisation will generate a fragment for each pixel which is inside a triangle. The fragments are passed to the fragment shaders.
|
||||
4. Fragment Shader
|
||||
- The colour of Fragments is calculated by the fragment shader.
|
||||
- There may be empty space around the triangles. Rasterisation is the process of taking all of the triangles and figuring out which pixels are inside each of the triangles.
|
||||
- Each of these pixels inside the triangles is called a fragment.
|
||||
- Rasterisation will generate a fragment for each pixel which is inside a triangle. The fragments are passed to the fragment shaders.
|
||||
4. Fragment Shader
|
||||
- The colour of fragments is calculated by the fragment shader.
|
||||
|
||||
## Rasterisation
|
||||
|
||||
@@ -46,11 +46,11 @@ for each pixel y in Y dimension {
|
||||
}
|
||||
```
|
||||
|
||||
#### Barcentric Coordinates
|
||||
#### Barycentric Coordinates
|
||||
|
||||
We can use this to calculate if a point is inside a triangle or not.
|
||||
|
||||
The barrcentric coordintates are $\alpha, \beta, \gamma$.
|
||||
The barycentric coordinates are $\alpha, \beta, \gamma$.
|
||||
|
||||
$\alpha$ corresponds to the normalised linear distance of P between the line $\alpha$=0 and $\alpha$=1
|
||||
|
||||
|
||||
Reference in new issue
Block a user