Course Overview
In modern game engines, the rendering system occupies an extremely important position. It not only accounts for the largest portion of engine code but is also one of the most technically difficult and specialized fields. Although many people think “a game engine is just a drawing engine,” in reality rendering in game engines is fundamentally different from textbook computer graphics.
Game Rendering vs Theoretical Graphics
Computer graphics theory focuses on:
- Correctness of specific effects (such as refraction of transparent objects, water rendering, hair algorithms, etc.)
- Mathematical precision of algorithms, without considering hardware implementation details
- A frame can take minutes or even days to render (offline rendering)
Four major challenges faced by game engine rendering:
- All-in-One complexity: a scene must simultaneously handle thousands of objects with different effects such as water, vegetation, hair, skin, and clouds, and all algorithms must be integrated into one container and work together.
- Deep hardware adaptation: algorithms must run efficiently on contemporary hardware (PC, console, mobile devices), requiring an in-depth understanding of GPU architecture.
- Fixed budget constraints: must complete within a strict time budget (30fps ≈ 33ms/frame, 60fps ≈ 16ms/frame, esports requires 120fps+). Whether the scene is a small enclosed room or an open city, the frame rate must remain stable, and “frame drops when opening a door” must never happen.
- Limited resources: the rendering system usually can only use 10–20% of CPU resources, with the rest left for game logic, physics, networking, and other systems. Therefore, the rendering system of a game engine is an engineering practice science, a heavily optimized software system iterated and optimized by the industry over the past 30 years, rather than a pure theoretical model.
Therefore, the rendering system of a game engine is an engineering practice science, a heavily optimized software system iterated and optimized by the industry over the past 30 years, rather than a pure theoretical model.
Basic Render Pipeline
The process of turning data into a visible image:
Vertex $\rightarrow$ Face $\rightarrow$ Projection Matrix $\rightarrow$ Rasterized Pixel $\rightarrow$ Material/Texture $\rightarrow$ Image

The entire rendering module is divided into four parts:
- Fundamentals: basic concepts such as GPU hardware architecture, rendering data management, and visibility culling
- Lighting and Materials: modern lighting models (IBL), PBR material systems, and the Shader model
- Subsystems: terrain system, sky system, post-processing system, etc.
- Render Pipeline: advanced pipeline designs such as Deferred Shading
GPU Architecture Fundamentals: Understanding Hardware Is a Prerequisite for Optimization
To become an excellent graphics programmer, one must deeply understand GPU architecture. The design philosophies of modern GPUs and CPUs are completely different.
CPU: Each core is powerful, and there are few cores; suitable for complex computational tasks such as game logic and physics simulation.
GPU: Each core is weaker, and there are many cores; suitable for large-scale parallel computation such as pixel rendering.
GPU Parallel Architecture Characteristics
The core characteristic of modern GPUs is large-scale parallel computing, with a large number of small cores. This architecture determines the design philosophy of the rendering system:
- Data parallelism first: decompose complex tasks into a large number of simple, uniform computational units
- Move computation forward: shift operations from the CPU to the GPU as much as possible
- Batching mindset: reduce Draw Calls and set up once for multiple reuses
SIMD and SIMT Architectures
SIMD (Single Instruction Multiple Data):
- One instruction processes multiple data items simultaneously (e.g., simultaneous operations on the XYZW of a 4D vector)
- Widely supported by modern CPUs as well (e.g., the SSE instruction set)
SIMT (Single Instruction Multiple Threads):
- The core idea of GPUs: make computational units very small but extremely numerous (thousands)
- One instruction can execute the same operation simultaneously on hundreds or thousands of cores
- Modern GPU compute power can reach 10+ TeraFLOPs, far exceeding CPUs (usually <1 TeraFLOP)
TeraFLOP: one trillion floating-point operations per second, $10^{12}$ floating-point operations (FLOP), $10^{15}$ double-precision floating-point operations (DFLOP)
Modern GPU Hardware Structure (Using NVIDIA Fermi Architecture as an Example)
A GPU consists of multiple GPCs (Graphics Processing Clusters), and each GPC contains:
- SM (Stream Multiprocessor): contains dozens of CUDA cores and performs mathematical operations
- Dedicated hardware units:
- Texture Unit: dedicated to texture sampling (with filtering and Mipmap)
- SFU (Special Function Unit): handles complex mathematical operations such as trigonometric functions
- Tensor Core (after Ampere architecture): AI computation
- RT Core: ray tracing acceleration

Memory Architecture and Data Flow
Von Neumann architecture: computation and data are separated, resulting in relatively high data movement costs.
Key concepts:
- VRAM and memory: transfer from CPU memory to GPU VRAM is a major bottleneck, and the one-way data transfer principle must be followed (CPU→GPU, avoid readback as much as possible)
- Cache: key to modern computing performance. Accessing main memory may require 100+ clock cycles, while accessing cache takes only a few cycles
- Cache Hit: data is in the cache, fast access
- Cache Miss: data is not in the cache, requiring a wait
- Bandwidth: a common bottleneck in rendering, including texture bandwidth, vertex bandwidth, etc.
Render Data Organization: From Logical Objects to Drawable Entities
A GameObject in a game (such as a car or a character) is a logical object and cannot be drawn directly. It must be expressed through a Renderable (drawable object).
Composition of a Renderable
To draw an object (Renderable), you generally need:
- Mesh: vertex data, triangle indices
- Vertex Data: vertex position, normal, UV coordinates, etc.
- Index Data: triangle indices, reusing vertices to save memory (typically the number of vertices is about half the number of triangles)
- Triangle Strip: an optimized vertex storage method that improves cache friendliness
Important note: vertex normals must be stored separately and cannot simply be averaged from triangle face normals. For example, at the edges/corners of a cube, vertices at the same position need to store multiple normals in different directions.
- Material:
- Expresses surface properties of objects (metal, plastic, stone, etc.)
- Modern engines use the PBR (Physically Based Rendering) model
- Note the distinction from Physics Material: the former is used for visuals, while the latter is used for physical properties such as friction coefficient and elasticity
- Texture:
- Materials reference textures for sampling; one material may reference multiple textures, and the same texture may be referenced by multiple materials
- Stores not only color (Albedo) but also roughness (Roughness), normal (Normal), metallic (Metallic), etc.
- Texture sampling is an expensive operation: a single sample requires accessing 8 pixels and performing 7 interpolations (considering Mipmap and bilinear filtering)
I already have a Texture, so why do I still need a Material?
Because the GPU does not know:- Is this image color? Normal? Or roughness?
- Should it participate in lighting?
- Is it transparent or opaque?
- How should Gamma / Linear be handled?
Material tells the GPU how to interpret this image and how it should participate in computation
- Shader Code:
- A unique “code as data” existence: it is both source code and managed as a data asset
- Modern engines support Shader Graph, allowing artists to compose material logic like building blocks and automatically generate Shader code
SubMesh: The Key to Resource Reuse
SubMesh Concept
A face/patch may include:
- Vertices
- Orientation
- Color
Different parts of a complex model (such as a soldier) (helmet, cloth, skin, weapon) require different materials.

Why does every vertex need to store a normal instead of simply averaging the triangle face normals?
- The object surface is a continuous surface, not triangles; therefore, calculating from triangles will produce discontinuities.
- A pixel belongs to only one triangle and cannot know which surrounding faces exist.
- GPU interpolation is at the vertex level, so normals need to be recorded on vertices.
Vertex normal = weighted average of adjacent triangle face normals (usually weighted by triangle area), then normalized
- Split a Mesh into multiple SubMeshes by material
- All SubMeshes share the same Vertex Buffer / Index Buffer, but each records its own Offset (offset) range
- Each SubMesh corresponds to a specific material, texture, and Shader
Advantages:
- Memory efficiency: multiple objects share the same geometry data
- Rendering optimization: batch render after sorting by material, reducing state changes
- Industry standard: mainstream engines such as Unreal Engine use similar structures
Resource Pool Design
Modern engines solve data redundancy through resource pools:
- Mesh Pool: centrally manages all mesh data
- Texture Pool: textures are shared across objects (e.g., skins and clothing for multiplayer characters)
- Material Pool: material instancing system
Rendering Optimization Strategies
- Material sorting: group SubMeshes with the same material to reduce GPU state change overhead
- Instance: for identical geometry (such as minions or trees), store only one Definition and draw multiple copies through instance data (position, rotation, etc.)
- GPU-based Batch Rendering: modern engines use GPU compute shaders to handle the drawing of large numbers of identical objects at once, further reducing CPU submission overhead
GPU Based Batch Rendering
For large numbers of repeated objects (trees, grass, buildings), the traditional approach requires setting VBO/IBO once per object. Modern techniques use Computer Shader to achieve:
- Render hundreds of instances in a single Draw Call
- GPU-side instancing: pass transform data as a buffer, and the GPU computes the final position of each instance in parallel
- Applicable scenarios: large-scale vegetation, building clusters, particle systems
Migrating Computation from CPU to GPU
Core idea: migrate complex operations originally handled by the CPU to the GPU
- Animation system: GPU-based skeletal animation computation
- Physics simulation: particle and cloth simulation
- Visibility determination: Occlusion Query, Frustum Culling
Performance advantage: GPU parallel compute power is usually more than 10× that of the CPU, making it suitable for large-scale data.
Visibility Culling
The highest level of rendering optimization: “Do Nothing” — use algorithms to make the computer do as little work as possible.
Basic Culling Methods
View Frustum Culling
Use a Bounding Volume to quickly determine whether an object is inside the camera frustum
Bounding volume types:
- Bounding Sphere: fastest test, but loose bounds
- AABB (Axis-Aligned Bounding Box): axis-aligned bounding box; only two vertices need to be stored, and computation efficiency is extremely high
- OBB (Object-Oriented Bounding Box): object-aligned bounding box; fits more tightly but is more complex to compute
- Convex Hull: commonly used in physics computation

Spatial Acceleration Structures
- Quadtree/Octree: suitable for large static scenes
- BVH (Bounding Volume Hierarchy): tree structure, suitable for dynamic scenes (FPS games with frequent object movement)
BVH (Bounding Volume Hierarchy)
Applicable scenarios: scenes with many dynamic objects (such as large numbers of units in RTS games)
Principle:
| |
- Hierarchical bounding boxes: test from top to bottom; cull entire branches of invisible nodes
- Dynamic rebuild: BVH has low rebuild cost when objects move, making it suitable for dynamic scenes
PVS (Potential Visibility Set)
Origin of the idea: John Carmack’s pioneering work in Doom/Quake
Core principle:
- Divide space into Cells (rooms) connected by Portals (doors/windows)
- Precomputation: each Cell records which other Cells are visible from that position through Portals
- Runtime: only render objects in the PVS of the current Cell
Modern application extensions:
- Level Streaming: open worlds load by Zone
- Resource preloading: use PVS to predict the area the player is about to enter and asynchronously load resources in advance
- Although pure PVS culling is rarely used now, its ideas guide resource scheduling
GPU Based Culling
Modern hardware performance allows some culling to be done directly on the GPU, using GPU parallel computing capability to parallelize bounding-box tests for thousands of objects.
- Occlusion Query: the GPU returns a visibility 0/1 array
- Early-Z / Hi-Z: hardware-level depth testing; occluded pixels do not execute the Fragment Shader
- Compute Shader Hierarchy: build BVH on the GPU and cull in parallel
Texture Compression Technology
Texture compression is an important module of the engine resource system and directly affects VRAM bandwidth and loading performance.
Texture Compression Formats
The special requirements of game engines differ from ordinary image compression (JPEG); texture compression must support:
- Random access: quickly read any texel
- Real-time decompression: extremely low decompression overhead
- Fixed compression ratio: predictable VRAM usage
Block-based Compression
Core idea: split the texture into 4×4 or larger blocks and compress each block independently.
- Split the texture into small 4×4 pixel blocks
- Record the maximum and minimum colors within the block; other pixels store interpolation ratios
DXT/BC series (PC/console): DXT1/3/5, BC1-7, supporting real-time compression/decompression
ASTC (mobile devices): supports non-square blocks (such as 4×4, 6×6, 8×8), with higher compression ratios but more complex compression computation
Asset Production Pipeline
Modern game assets come from diverse sources, driving advances in rendering technology:
| Production Method | Tools | Advantages | Disadvantages | Applicable Scenarios |
|---|---|---|---|---|
| Manual Modeling | 3D Max, Maya, Blender | Precise modeling based on points, lines, and faces; flexible and controllable | Time-consuming and labor-intensive | Machinery, architecture |
| Sculpting | ZBrush | Freely add details like sculpting; highly unrestricted | Difficult to parameterize | Characters, creatures |
| 3D Scanning | RealityCapture | Acquired through photogrammetry; ultra-high precision | Requires a physical prototype | Artifacts, realistic props |
| Procedural Generation | Houdini, AI | Automatically generated based on algorithms; efficient at scale | Difficult to control | Terrain, vegetation |
Trend: AI generation technology frees artists from tedious details so they can focus on creativity itself.
Development Directions of Modern Render Pipelines
Technology keeps advancing, and render pipelines are also evolving, requiring developers to keep learning.
Cluster Based Mesh Pipeline
Driving force: open worlds cause data volume to grow more than 10×, and traditional pipelines (CPU prepares vertex data → submits to GPU) cannot handle it.
Core idea:
- Split high-detail models into fixed-size Meshlets (32–64 triangles)
- Mesh Shader: the GPU “conjures” geometric detail from algorithms and data, without the CPU pre-preparing vertex Buffers
- Amplification Shader: determines which Meshlets need subdivision (distance-based LOD) or culling
- GPU-driven: all culling, LOD selection, and rejection are completed entirely on the GPU, and the CPU only submits high-level commands
Advantages:
- Supports pixel-level geometric density (such as Nanite in Unreal Engine)
- Fine-grained culling: can cull just one hand of a monster instead of the entire model
- Artists do not need to consider the polygon budget and can freely use models with hundreds of millions of triangles
Representative technologies:
- Ubisoft 2015: Assassin’s Creed Unity was the first to apply Cluster Based Mesh Pipeline at scale
- Unreal Engine 5: Nanite virtual geometry technology, achieving “pixel-level mesh density”
Requirements for developers:
- Deeper understanding of GPU architecture
- More complex Shader programming models
- But in exchange for ultimate detail expressiveness
Pipeline Evolution Summary
| Stage | Technology | Characteristics |
|---|---|---|
| Traditional Pipeline | VS+PS | Prebuilt Vertex/Index Buffer |
| Intermediate Pipeline | Hull/Domain/Geometry Shader | GPU-side geometry subdivision |
| Modern Pipeline | Mesh Shader | Fully GPU-driven, dynamically generates geometry |
Summary of the Core Cognitive Framework
Four Core Concepts
Hardware-driven thinking
- Rendering is an engineering science that deeply depends on understanding GPU architecture
- Be familiar with the language of “performance bottlenecks”: bandwidth, fill rate, ALU utilization
Data relationship thinking
- The core is resolving the relationships among Mesh, SubMesh, material, and Shader
- Instancing is a general pattern for resource management (sound, particles, vegetation)
Extreme culling thinking
- Optimization = making the computer do the least work (the Do Nothing philosophy)
- Visibility is the first factor in rendering performance
GPU Responsibility thinking
- GPU Driven: migrate CPU logic to the GPU
- Future trend: animation, physics, and AI fully GPU-ified
Advice for Developers
- Render pipeline selection: in-house engines should follow industry standards and avoid excessive innovation that makes maintenance difficult
- Debugging methodology:
- Graphics debugging is extremely difficult (second only to server debugging)
- Step-by-step verification: split the algorithm into multiple steps and verify each step separately
- Use vendor tools: NVIDIA NSight, AMD Radeon GPU Profiler
- Learning path: first read the code and set breakpoints to understand the flow, then start modifying it
The game engine rendering system is a bridge connecting hardware and art; it requires both solid engineering ability and a sense of aesthetics. Understand hardware, optimize data, cull to the extreme, and embrace the GPU—these four principles will run through the entire rendering module. The next lesson will dive into lighting models and the PBR material system, exploring how to make the image “look like the real deal.”
The game engine rendering system is a highly practical engineering endeavor—it does not pursue theoretical optimality, but rather finds the best balance among hardware limitations, development efficiency, and image quality.
