Computer graphics for game development
Part: Graphics pipeline
Martin Pernica
(based on presentation from Martin Kahoun)
Table of Content
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Graphics Pipeline Overview
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Graphics Pipeline Overview
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Graphics Pipeline Overview
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Control
ALU
ALU
ALU
ALU
Cache
DRAM
Graphics Pipeline Overview
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Graphics Pipeline Overview
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Memory
Memory
Core
Core
Core
Core
Core
Core
Core
Core
Memory
Memory
Core
Core
Core
Core
Core
Core
Core
Core
Memory
Memory
Core
Core
Core
Core
Core
Core
Core
Core
DRAM
Graphics Pipeline Overview
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Graphics Pipeline Overview
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Graphics Pipeline Overview
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
NVIDIA Ada AD102 GPU
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Graphics Pipeline Overview
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Graphics Pipeline Overview
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Graphics Pipeline Overview
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Graphics Pipeline Overview
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Graphics Pipeline Overview
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Graphics Pipeline Overview
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Translation, rotation, scaling and projection can be treated as matrix!
Rendering Basics
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics – Coordinate Spaces
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics - Vertex
Vertex attributes loaded into arrays – Vertex Buffer Objects
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics - Textures
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics - Textures
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics – Texture Filtering
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Nearest neighbor (left), bilinear (right)
Rendering Basics – Texture MipMaps
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics – Texture MipMaps
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics – Shader Stages
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics – Vertex Post-Processing
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics – Backface Culling
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Front face — counter clockwise order Back face — clockwise order
Rendering Basics – Rasterisation
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics – Attribute Interpolation
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics – Perspective correction texture mapping
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics – Per Sample Operations
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics – Per Sample Operations
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Rendering Basics – Per Sample Operations
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Shaders – Shading Language
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Shaders – Shading Language
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Shaders – Scalar Types
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
GLSL | HLSL | Definition |
bool | bool | Boolean true or false |
float | float | FP-32 |
double | double | FP-64 |
int | int | Signed integer, 32-bits |
unsigned int | uint | Unsinged integer, 32-bits |
Shaders – HLSL Vector & Matrix Types
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Type | Description | Examples |
floatN | Represents a vector with N floating-point components | float4 (colors with alpha) |
intN | Vectors with integer components | int3 |
uintN | Vectors with unsigned integer components | uint2 |
boolN | Vectors with boolean components | bool2 |
halfN | Half precision (FP-16) floating point number | half3 |
doubleN | Double precision (FP-64) floating point number | double2 |
floatMxN | Represents a matrix with M rows and N columns of floating-point values | float4x4 |
Shaders – HLSL Vector & Matrix Types
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Shaders – HLSL Vector & Matrix Types
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Shaders – Features
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Shaders – Debug
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Vertex Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Vertex Shaders – GLSL Example
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Vertex Shaders – HLSL Example
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders - Parameters
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders – Evaluation Shader
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders – Evaluation Shader
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders – Terrain Rendering
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders – Terrain Rendering
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders – Terrain Rendering
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders – Terrain Rendering
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders – Terrain Rendering
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders – Terrain Rendering
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders – Terrain Rendering
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders – Terrain Rendering
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders – Call of Duty: Ghosts
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Tessellation Shaders – Call of Duty: Ghosts
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Geometry Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Geometry Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Geometry Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Geometry Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Fragment/Pixel Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Fragment/Pixel Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Fragment/Pixel Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Fragment/Pixel Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Compute Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Compute Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Compute Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Compute Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Compute Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Compute Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Compute Shaders - Example
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Compute Shaders – Example (CPU)
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
RT & Mesh Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
RT & Mesh – Example (CPU)
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
RT & Mesh Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
RT & Mesh Shaders
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Wrap-up
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Useful books
Martin Pernica | @martindeveloper
Computer graphics for game development: Graphics pipeline
Thank you!