My study notes
I hope you will find my notes useful in case you intend to study more about engine and graphics programming.
C++
-
ISOCPP FAQ
-
ISOCPP C++ Core Guidelines
-
Marshall Cline’s FAQ
-
Mirror of 2012 version: http://www.cs.technion.ac.il/users/yechiel/c++-faq/index.html
-
Mirror of 2006 version: http://www.dietmar-kuehl.de/mirror/c++-faq/
-
Mirror of 2003 version: https://www.cs.rit.edu/~mjh/docs/c++-faq/
-
Marshall Cline’s C++ FAQ (29/07/2011)
Questions in round brackets are the ones I find more important or difficult to grasp at first.
-
Chapter 7: 7.7
-
Chapter 8: 8.3, 8.4, 8.6
-
Chapter 9: 9.1, 9.5, 9.6, 9.7, 9.8, 9.9
-
Chapter 10: 10.3, 10.4, (10.5), 10.6, 10.8, (10.9), 10.10, (10.14), 10.20, (10.22)
-
Chapter 11: 11.7, 11.10, 11.14
-
Chapter 12: 12.3, 12.4
-
Chapter 13: 13.9, 13.10, 13.14, 13.15
-
Chapter 14: 14.3, 14.5
-
Chapter 16: 16.4, 16.8, 16.10, 16.21
-
Chapter 17: 17.2, 17.3, 17.4, 17.8, 17.9, 17.10
-
Chapter 18: 18.5, 18.7, 18.10, 18.12, (18.13), 18.15
-
Chapter 20: 20.3, 20.4, 20.5, 20.6, (20.7), 20.8
-
Chapter 21: (21.4), 21.6, 21.8, 21.12
-
Chapter 22: 22.4, 22.5
-
Chapter 23: 23.1, 23.3, 23.4, 23.5, (23.9)
-
Chapter 24: 24.2, 24.3, 24.5, 24.6
-
Chapter 25: 25.4, 25.5, (25.9), 25.10
-
Chapter 26: 26.12, 26.13
-
Chapter 27: 27.10
-
Chapter 29: 29.5, 29.7, 29.17, 29.18, (29.19), 29.20
-
Chapter 35: 35.2, 35.3, 35.4, (35.7), 35.9, 35.11, 35.16, 35.18, 35.19, 35.22
Topics
A list of concepts, ideas, idioms, patterns and keywords to understand and remember. The numbers in round brackets are a reference inside Marshall Cline’s C++ FAQ.
-
Method chaining (8.4) / Named Parameter Idiom (10.20)
-
Conversion constructor and conversion operator
-
Operator overloading (ch. 13)
-
Explicit constructor (10.22)
-
const
(29.7) /mutable
(18.13) /volatile
/restrict
-
v-table mechanism (20.4)
-
Pure virtual member functions (22.4), abstract base classes (ch. 22)
-
Covariant Return Types and "virtual constructor" (20.8, 22.5)
-
Object slicing (21.4, 31.8, 20.8)
-
Template Method pattern and private virtuals (23.4) (Virtuality by Herb Sutter)
-
Private inheritance (24.2, 24.3) (Uses and Abuses of Inheritance, Part 1 by Herb Sutter)
-
Static initialization order fiasco (10.14)
-
Meyer’s singleton (10.16)
-
Different kind of casts: C style,
static_cast
,dynamic_cast
,const_cast
andreinterpret_cast
-
Run-time type information (RTTI)
More topics
A second list of concepts to keep in mind, only a bit harder this time. As before, the numbers in round brackets are a reference inside Marshall Cline’s C++ FAQ.
-
Placement new (11.10)
-
Pointer to member function
-
Diamond problem (25.8, 25.9) and multiple inheritance (ch. 25)
-
Hiding rule (23.9, 23.3)
-
Templates (ch. 35)
-
Rule of three / five / zero, special member functions
-
Return value optimization (NRVO, RVO) (10.9) / Copy elision (C++ Cargo Cults, RVO and Copy Elision)
-
Copy-and-swap idiom (Why do we need the copy-and-swap idiom?)
-
Argument-dependant lookup (Koenig lookup)
-
Substitution Failure Is Not An Error (SFINAE) (35.11)
-
non-dependent types and members (35.18, 35.19, 35.20)
-
Proxy template (35.22), in C++11 you would employ the Type alias declaration with
using
-
Type traits, concepts, tag dispatching (Generic Programming Techniques)
C++11
The book "Effective Modern C++" by Scott Meyers is a must-have.
-
Rvalues (C++ Rvalue References Explained by Thomas Becker)
-
Auto keyword and type deduction
-
Move semantics, rule of five
-
Reference collapsing
-
Reference qualifiers
-
Forwarding (AKA universal) references (Universal References in C++11 by Scott Meyers)
-
Perfect forwarding
-
Enum classes
-
Range-based for loops (and issues with
auto
and copying objects around) -
List initialization
-
Lambdas
-
Lambdas: From C11 to C20, Part 1 by Bartłomiej Filipek
-
Lambdas: From C11 to C20, Part 2 by Bartłomiej Filipek
-
IIFE for Complex Initialization by Bartłomiej Filipek
-
Design patterns and OOP
Math and geometry
Books
Read about the same math concepts on more than one book. Some books are targeted to game developers, like:
-
"Essential Mathematics for Games and Interactive Applications" by James M. Van Verth and Lars M. Bishop
-
"3D Math Primer for Graphics and Game Development" by Fletcher Dunn and Ian Parberry
-
"Mathematics for 3D Game Programming and Computer Graphics" by Eric Lengyel and John Flynt
Topics
-
Trigonometry
-
Vectors and matrices
-
Rendering pipeline
-
OpenGL transformations and matrices:
Algorithms and more
-
Sorting and data structures (lists, arrays, hash tables)
-
About hash tables: linear probing, quadratic probing, leapfrog probing, double hashing, cuckoo hashing, hopscotch hashing
-
-
Floating point (29.17 and Random ASCII blog)
-
Tricks With the Floating-Point Format (representation)
-
Comparing Floating Point Numbers, 2012 Edition (ULP comparison)
-
That’s Not Normal–the Performance of Odd Floats (hole around zero, denormals)
-
-
"Programming from the Ground Up" (PDF) by Jonathan Bartlett
-
Call stack, relocating code, dynamic libraries, data / bss / text segments
-
-
Virtual memory, paging, TLB, MMU, mmap
-
Custom allocator with pools
CPU
Important links from Wikipedia about the architecture of a CPU. One of the book you could read to learn more on the subject is "Computer Architecture: A Quantitative Approach" by David A. Patterson.
-
Instruction pipelining, Classic RISC pipeline → (fetch, decode, execute, memory access, writeback), Branch predication
-
Instruction-level parallelism, Out-of-order execution, Register renaming, Register spilling, Superscalar processor, VLIW (Very Long Instruction Word), Barrell processor
-
Hazard (computer architecture) → (RAW, WAR, WAW data hazards, pipeline bubbling, register forwarding)
-
Speculative execution, Instruction prefetch, Prefetch input queue
-
CPU cache, Cache replacement policies, Translation Lookaside Buffer (TLB), Scratchpad memory
-
Cache coherence (MESI protocol, MOESI protocol), Bus snooping, Write combining
-
Multiply–accumulate operation → (Fused multiply–add)
Multi-threading
One of the book on the topic is "The Art of Multiprocessor Programming" by Maurice Herlihy and Nir Shavit
-
Critical section, mutex, semaphore, Producer-consumer problem, Dining philosophers problem, Priority inversion, race condition
-
Atomics and lock-free programming (Preshing on Programming), Benaphore, ABA problem, Load-link/store-conditional, acquire and release semantics (Load-Acquire/Store-Release in the ARM Reference Manual)
-
Cache coherency, MOESI protocol, MESIF protocol, false sharing, branch misprediction, scratchpad memory
-
CPUs: How is branch prediction implemented in microprocessors?
-
Single Producer / Multiple Consumer
-
Lock-free queues
-
Aligning AoS to cache line size to avoid false sharing
More topics
-
Load-Hit-Stores and the
__restrict
keyword by Elan Ruskin -
Sponsored Feature: Common Performance Issues in Game Programming by Becky Heineman
Graphics
Mobile GPUs architecture
The book "OpenGL ES 3.0 Programming Guide" by Dan Ginsburg and Budirijanto Purnomo is a must-have.
-
Performance Tuning for Tile-Based Architectures (PDF), from chapter 23 of the "OpenGL Insights" book
ARM Mali
-
The Mali GPU: An Abstract Machine
-
Killing Pixels - A New Optimization for Shading on ARM Mali GPUs (Forward Pixel Kill)
-
How low can you go? Building low-power, low-bandwidth ARM Mali GPUs (Transaction elimination)
-
Mali Performance
-
Benchmarking floating-point precision in mobile GPUs
-
Efficient Rendering with Tile Local Storage (PDF) (SIGGRAPH 2014)
-
ARM Unveils Next Generation Bifrost GPU Architexture & Mali-G71: The New High-End Mali
Imagination PowerVR
Qualcomm Adreno
Desktop GPUs architecture
-
From Shader Code to a Teraflop: How GPU Shader Cores Work (PDF) by Kayvon Fatahalian (SIGGRAPH 2010)
-
Scheduling the Graphics Pipeline (PDF) by Jonathan Ragan-Kelley (SIGGRAPH 2011)
-
Triangles Are Precious - Let’s Treat Them With Care (PDF) by Dominik Baumeister (AMD)
-
A trip through the Graphics Pipeline 2011: Index by Fabian "ryg" Giesen
Graphics techniques
-
SIGGRAPH 2016 Course: Physically Based Shading in Theory and Practice
-
Background: Physics and Math of Shading (PDF) by Naty Hoffman
-
Real-Time Many-Light Management and Shadows with Clustered Shading a SIGGRAPH 2015 Course
-
Deus Ex: Human Revolution - Graphics Study by Adrian Courreges
-
Supreme Commander - Graphics Study by Adrian Courreges
-
GTA V - Graphics Study by Adrian Courreges
-
DOOM (2016) - Graphics Study by Adrian Courreges
-
Metal Gear Solid V - Graphics Study by Adrian Courreges
-
Practical Realtime Strategies for Accurate Indirect Occlusion (PDF) by Jorge Jimenez, Xian-Chun Wu, Angelo Pesce and Adrian Jarabo
-
An Introduction To Real-Time Subsurface Scattering by Matt Pettineo
Older resources
-
Variance Shadow Maps (PDF) by William Donnelly and Andrew Lauritzen
-
Iterative Parallax Mapping with Slope Information (PDF) by Mátyás Premecz
-
A Simple and Practical Approach to SSAO by José María Méndez
-
Advanced Depth of Field (PDF) by Thorsten Scheuermann
-
Order your graphics draw calls around! from the Real-Time Collision Detection blog
More topics
-
GLSL: Center or Centroid? (Or When Shaders Attack!) by Bill Licea-Kane (AMD)
-
Vulkan in 30 minutes by Baldur Karlsson
-
Texture filtering (PDF) (Mipmap selection with derivatives) by Steve Marschner
-
Reflecting a Vector (Vector reflection with vector projection and dot product)
-
Gram-Schmidt orthogonalization with vector projection and dot product
-
id Tech 5 Challanges - From Texture Virtualization to Massive Parallelization (PDF) by J.M.P. van Wavewer (id Software) (virtual texturing, sparse resources, parallel job system)
-
Approaching Zero Driver Overhead in OpenGL (PDF) (GDC Vault video), persistent mapping
-
Beyond Porting (PDF) (Steam Dev Days video) by Cass Everitt and John McDonald (NVIDIA) (persistent mapping, texture arrays, sparse and bindless textures)
-
Rendering deferred lights using Stencil culling algorithm by Yuriy O’Donnell
-
Depth Precision Visualized by Nathan Reed (NVIDIA)
-
What are screen space derivatives and when would I use them?
-
gl_HelperInvocation - OpenGL 4 Reference Pages
-
Life of a triangle - NVIDIA’s logical pipeline by Christoph Kubisch
-
1 - Signal Processing Primer by Matt Pettineo
-
2 - Applying Sampling Theory To Real-Time Graphics by Matt Pettineo
-
3 - A Quick Overview of MSAA by Matt Pettineo
-
4 - Experimenting With Reconstruction Filters for MSAA Resolve by Matt Pettineo
-
Breaking Down Barriers - Part 1: What’s a Barrier? by Matt Pettineo
-
Breaking Down Barriers - Part 2: Synchronizing GPU Threads by Matt Pettineo
-
Breaking Down Barriers - Part 3: Multiple Command Processors by Matt Pettineo
-
Breaking Down Barriers - Part 4: GPU Preemption by Matt Pettineo
-
Breaking Down Barriers - Part 5: Back to the Real World by Matt Pettineo
-
Breaking Down Barriers - Part 6: Experimenting with Overlap and Preemption by Matt Pettineo
-
Introduction to compute shaders by Matthäus G. Chajdas
-
More compute shaders by Matthäus G. Chajdas
-
Even more compute shaders by Matthäus G. Chajdas
-
The Elusive Frame Timing by Alen Ladavac
-
Intro to GPU Scalarization: Part 1 by Francesco Cifariello Ciardi
-
Intro to GPU Scalarization: Part 2 - Scalarize All the Lights by Francesco Cifariello Ciardi
Data Oriented Design
-
Pitfalls of Object Oriented Programming (PDF) by Tony Albrecht (SCEE)
-
Typical C++ Bullshit by Mike Acton (Insomniac Games)
-
Culling the Battlefield by Daniel Collin (Frostbite)
-
Multiprocessor Game Loops by Jason Gregory (Naughty Dog)
-
Parallelizing the Naughty Dog Engine Using Fibers (PDF) (GDC Vault video) by Christian Gyrling (Naughty Dog)
-
Memory Optimization (PDF) by Christer Ericson (Sony Santa Monica)
-
Introduction to Data Oriented Design (PDF) by Daniel Collin (DICE)
-
Data Locality (cache miss, branch misprediction, pipeline flush) from Game Programming Patterns by Robert Nystrom
-
Performance - Physics Optimization Strategies (PDF) by Sergiy Migdalskiy (Valve)
-
Roundup: Recent sketches on concurrency, data design and performance by Mike Acton (Insomniac Games)
-
Optimizing Software Occlusion Culling - Index by Fabian "ryg" Giesen
-
Practical Examples in Data Oriented Design by Niklas Frykholm (BitSquid)
-
What is Data-Oriented Game Engine Design? by David Davidović
-
Data-Oriented Design (Or Why You Might Be Shooting Yourself in The Foot With OOP) by Noel Llopis
-
Data-Oriented Design book by Richard Fabian
-
Mike Acton’s review of
OgreNode.cpp
-
Memory, Cache, CPU optimization resources by Omar Cornut
-
Entity Component Systems & Data Oriented Design (PDF) by Aras Pranckevičius (Unity Technologies)
-
Caches everywhere by Nicholas Frechette