Modern Game Engine Course Notes 02

Course from: BoomingTech

Rendering on Game Engine

A heavily optimized practical software framework to fulfill the critical rendering requirements of games on modern hardware (PC, console and mobiles).

Outline of Rendering

Building Blocks of Rendering

Pipeline and data: Vertex Data -> Triangle Data -> Material Parameters -> Textures

Understand the Hardware

SIMD and SIMT Single Instruction Multiple Data Single Instruction Multiple Threads

GPU Architecture

GPU Arch

Data Flow from CPU to GPU

Try not to read memory from GPU

GPU Bounds and Performance

Application performance is limited by:

Renderable

Game object - Components - Mesh Render Component.

Vertex and Index Buffer: Vertex data is accessed through index.

Materials: determine the appearance of objects, and how objects interact with light.

Various Textures in Materials: Albedo, Normal, Metallic, Roughness, AO.

Variety of Shaders

Render Objects in Engine

Model assets are made based on local coordinate systems, and eventually are rendered in screen space through transformation and projection.

Display different textures on a single model with submesh!

Resource pool: Instance - use handle to reuse resources

Definition and Instance, vital concept for game engine!

Within a scene, using resource pools, all the materials are sorted.

GPU Batch Rendering.

Visibility Culling

For each view, there are a lot of objects which are not needed to be rendered.

Using the simplest bound to create culling (BVH, PVS Potential Visibility Set).

Construction and Insertion of BVH in Game Engine

Texture Compression

Traditional image compression like JPG and PNG

In game texture compression

Common block-based compression format

Cluster-Based Mesh Pipeline

Nanite:

Lighting, Materials and Shaders

Lighting

Material

Shader

The Rendering Equation Rendering Equation

The 1st Challenge: How to get incoming radiance for any given incoming direction.

The 2nd Challenge: Integral of lighting and scatting function on hemisphere is expensive. 2nd Challenge

The 3rd Challenge: To evaluate incoming radiance, we have to compute yet another integral, i.e. rendering equation is recursive. 3rd Challenge

Blinn-Phong Model: Simple and Useful

Ambient + Diffuse + Specular = Blinn-Phong Reflection

L = k_a * I_a + k_d * (I / r^2) + k_s * * (I / r^2) * max(0, dot(N, H))^2

Problem of Blinn-Phong:

Shadow

Already obsolete method: planar shadow, shadow volume, projective texture.

Shadow Map: Shadow Map

Pre-computed Global Illumination

Lightmap:

Light Probes + Reflection Probes

Physical-Based Material

BRDF Model Based on Microfacet BRDF

Disney Principled BRDF

Principles to follow when implementing model:

PBR Specular Glossiness BRDF

PBR Metallic Roughness

Two most important models for learners

To find out more details by yourself: Image-Based Lighting (IBL), Cascade Shadow.

Summary of Popular AAA Rendering

The Challenges and Fun of Rendering the Beautiful Mother Nature

Environment Components in Games:

Terrain

Vegetation

Sky

Analytic Atmosphere Appearance Modeling

Participating Media

Participating Media

Volume Rendering Equation

Real Physics in Atmosphere

Scattering Types

Variant Air Molecules Absorption

Ray Marching

Precomputed Atmospheric Scattering

Those knowledge is too complex for me to understand, thus I just link the reference for further reading:

Cloud

Billboard Cloud

Volumetric Cloud Modeling

Noise Function

Cloud Density Model

Ray Marching Cloud

Render Pipeline, Post-process and Everything

Ambient Occlusion

Ambient Occlusion

Precomputed AO: Using ray tracing to compute the AO offline and store the result into texture, which is widely used in object modeling process

Screen Space Ambient Occlusion (SSAO)

SSAO+

HBAO Horizon-based Ambient Occlusion

GTAO - Ground Truth-based Ambient Occlusion

Ray-Tracing Ambient Occlusion

Fog

Depth Fog

Height Fog Height Fog

Voxel-based Volumetric Fog

Anti-aliasing

Reason of Aliasing

Anti-aliasing

Super-sample AA (SSAA) and Multi-sample AA (MSAA)

FXAA (Fast Approximate Anti-aliasing)

TAA (Temporal Anti-aliasing)

Post-process

Post-process in 3D Graphics refers to any algorithm that will be applied to the final image. It can be done for stylistic reasons (color correction, contrast, etc.) or for realistic reasons (tone mapping, depth of field, etc.)

What is Bloom

Bloom

  1. Detect Bright Area by Threshold
  2. Gaussian Blur / Pyramid Gaussian Blur
  3. Bloom Composite

Tone Mapping

Filmic Curve

ACES Academy Color Encoding System

The useful bits

HDR and SDR Pipeline

Color Grading

Lookup Table (LUT)

Rendering Pipeline

Rendering pipeline is the management order of all rendering operation execution and resource allocation

Forward rendering

for n meshes 
    for m lights
        color += shading(mesh, light)

Sort and Render Transparent after Opaque Objects

Deferred Rendering

Deferred Rendering

Advanced rendering techniques for further reading:

Challenges

Advanced solutions for further reading

Render to monitor