Game graphics is about squeezing a great deal of linear algebra into the tiny slice of computational time the game loop gives us.
2D

Isometric 2D

Fake 3D

2.5D

3D
Euler angles
Quaternions

Rotation about a fixed point
OpenGL example:
| 1 | glPushMatrix(); |
| 2 | glTranslatef(250,250,0.0); // 3. Translate to the object's position. |
| 3 | glRotatef(angle,0.0,0.0,1.0); // 2. Rotate the object. |
| 4 | glTranslatef(-250,-250,0.0); // 1. Translate to the origin. |
| 5 | glPopMatrix(); |
Model Space
World Space
View/Camera Space
Clip Space
View/Screen Space
Perspective projection
Orthographic projection

Rotoscoping animations
Keyframed animation
Skeletal animation
Warped animations

Rotoscoping

Keyframed

Skeletal 2D

Skeletal 3D

Warped
Applications
Main methods
Linear Interpolation
Bilinear interpolation
Trilinear interpolation


No interpolation

Constant (nearest neighbor)

Bilinear

Cubic







DirectX

OpenGL

Vulkan

Constructing a triangle mesh
Vertex
Fragment
Texture
Occlusion

Z-Fighting
Culling
Vertex shader phase
Tessellation shader phase (optional)
Geometry shader phase (optional)
Rasterization phase
Fragment shader phase
Final phase
Vertex shader
Geometry shader (optional)
Tessellation shader (optional)
Pixel (fragment) shader

ASCIIdent
Compute shader
Vertex shader
Tessellation shader

Surface Tessellation
Geometry shader

Geometry shader grass
Pixel (fragment) shader

Screen Effect
| 1 | #version 150 core |
| 2 | layout(points) in; |
| 3 | layout(line_strip, max_vertices = 11) out; |
| 4 | in vec3 vColor[]; |
| 5 | out vec3 fColor; |
| 6 | const float PI = 3.1415926; |
| 7 | |
| 8 | void main() { |
| 9 | fColor = vColor[0]; |
| 10 | |
| 11 | for (int i = 0; i <= 10; i++) { |
| 12 | // Angle between each side in radians |
| 13 | float ang = PI * 2.0 / 10.0 * i; |
| 14 | |
| 15 | // Offset from center of point (0.3 to accomodate for aspect ratio) |
| 16 | vec4 offset = vec4(cos(ang) * 0.3, -sin(ang) * 0.4, 0.0, 0.0); |
| 17 | gl_Position = gl_in[0].gl_Position + offset; |
| 18 | |
| 19 | EmitVertex(); |
| 20 | } |
| 21 | |
| 22 | EndPrimitive(); |
| 23 | } |

Sprite placement

Raycasting

Rasterization

Raytracing

1992: Outrunners

1992: Wolfenstein 3D






Principle
Precise sampling
Fixed sampling

Vertex lighting

Fragment lighting
Shadow mapping














LOD
Texture mapping
Baking




Textured scene

Baked lights

Result

Motion blur

Chromatic Aberration

Decals

Depth of field

Caustics

Lens flare

Subsurface Scattering

Ambient Occlusion
Mipmapping

Nearest neighbor
Bilinear filtering
Trilinear filtering
Anisotropic filtering

Hope is what makes us strong. It is why we are here. It is what we fight with when all else is lost.Pandora, God of War 3