Featured image of post Game Engine Architecture

Game Engine Architecture

This blog is my learning notes while reading Game Engine Architecture. I’m using it to understand how game engine works under the hood and to keep track of what I learn along the way.

Introduction

What is a game engine

  • Software that is extensible and can be used as the foundation for many different games without major modification.

Some Basic Concepts

  • A view frustum is a pyramid-shaped volume representing the camera’s visible space, used to determine whether objects should be rendered based on whether they lie inside or outside this space.

  • Frustum Culling is a fundamental visibility optimization that skips rendering objects completely outside the camera’s view frustum, reducing draw calls and CPU/GPU workload at minimal cost.

  • Occlusion Culling is a visibility optimization technique that avoids rendering objects fully hidden behind other geometry, significantly reducing overdraw and GPU workload in complex scenes.

  • A bounding volume is a simple geometric shape used to roughly represent a complex object, enabling fast visibility and collision decisions in a game engine, while a Bounding Sphere is one specific type of bounding volume shaped as a sphere.

  • A Bounding Volume Hierarchy (BVH) is a tree structure of bounding volumes, allowing efficient visibility and collision tests by quickly excluding entire branches that are outside the camera view or occluded.

1
2
3
4
5
      BVH Root
       /   \
   Node1    Node2
   /   \    /   \
 Obj1 Obj2 Obj3 Obj4
  • An Axis-Aligned Bounding Box (AABB) is a box-shaped bounding volume with edges aligned to the world axes, used for fast visibility and collision checks. When an object rotates, the AABB may need to enlarge to fully contain it, making the box appear “fatter.”

  • Hierarchical Z-Buffer (HZB) is a GPU optimization technique that builds a multi-resolution depth map to quickly determine if objects are occluded, reducing the need for per-pixel visibility tests.

  • An Oriented Bounding Box (OBB) is a box-shaped bounding volume that can rotate to align with an object, providing a tighter fit for precise collision detection.

Basic Workflow

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
                        +----------------+
                        |   Camera       |
                        |   View Frustum |
                        +-------+--------+
                                |
                                v
                     +----------------------+
                     |  Frustum Culling     |
                     |  (Bounding Sphere)   |
                     +----------------------+
                                |
                                v
                     +----------------------+
                     |  Occlusion Culling   |
                     |  (AABB / OBB + HZB)  |
                     +----------------------+
                                |
                                v
                     +----------------------+
                     |   Render List        |
                     +----------------------+
                                |
                                v
                      +-----------------+
                      |     GPU Draw    |
                      +-----------------+

Reference

  1. Gregory, J. (2018). Game Engine Architecture (3rd ed.). CRC Press.
Kernel panic - not syncing: footer overloaded
Built with Hugo
Theme Stack designed by Jimmy