Book Image

Hands-On C++ Game Animation Programming

By : Gabor Szauer
Book Image

Hands-On C++ Game Animation Programming

By: Gabor Szauer

Overview of this book

Animation is one of the most important parts of any game. Modern animation systems work directly with track-driven animation and provide support for advanced techniques such as inverse kinematics (IK), blend trees, and dual quaternion skinning. This book will walk you through everything you need to get an optimized, production-ready animation system up and running, and contains all the code required to build the animation system. You’ll start by learning the basic principles, and then delve into the core topics of animation programming by building a curve-based skinned animation system. You’ll implement different skinning techniques and explore advanced animation topics such as IK, animation blending, dual quaternion skinning, and crowd rendering. The animation system you will build following this book can be easily integrated into your next game development project. The book is intended to be read from start to finish, although each chapter is self-contained and can be read independently as well. By the end of this book, you’ll have implemented a modern animation system and got to grips with optimization concepts and advanced animation techniques.
Table of Contents (17 chapters)

What this book covers

Chapter 1, Creating a Game Window, explains how to create a new visual studio project, create a Win32 window, set up an OpenGL 3.3 render context, and enable vsynch. The code samples for this book are compiled against OpenGL 3.3. All the OpenGL code is compatible with the latest version of OpenGL and OpenGL 4.6.

Chapter 2, Implementing Vectors, covers vector math for game animation programming.

Chapter 3, Implementing Matrices, discusses matrix math for game animation programming.

Chapter 4, Implementing Quaternions, explains how to use quaternion math for game animation programming.

Chapter 5, Implementing Transforms, explains how to combine position, rotation, and scale into a transform object. These transform objects can be arranged in a hierarchy.

Chapter 6, Building an Abstract Renderer, shows you how to create an abstraction layer on top of OpenGL 3.3. The rest of this book will use this abstraction for rendering. By using an abstraction, we can focus on the core concepts of animation programming instead of the API being used to implement it. The abstraction layer targets OpenGL 3.3, but the code is valid with OpenGL 4.6 as well.

Chapter 7, Understanding the glTF File Format, introduces the glTF file format. glTF is a standard open file format that is supported by most 3D content creation tools. Being able to load a common format will let you load animation authored in almost any creation tool.

Chapter 8 Creating Curves, Frames, and Tracks, covers how to interpolate curves and how cruces can be used to animate transforms stored in a hierarchy.

Chapter 9, Implementing Animation Clips, explains how to implement animation clips. Animation clips modify a transform hierarchy over time.

Chapter 10, Mesh Skinning, covers how to deform a mesh so that it matches the pose generated by sampling an animation clip.

Chapter 11, Optimizing the Animation Pipeline, shows you how to optimize parts of the animation pipeline to make it faster and more production-ready.

Chapter 12, Blending between Animations, explains how to blend two animated poses together. This technique can be used to switch between two animations smoothly, without any visual popping.

Chapter 13, Implementing Inverse Kinematics, covers how to use inverse kinematics to make animations interact with the environment. For example, you'll learn how to make an animated character's foot not penetrate the ground on uneven terrain.

Chapter 14, Using Dual Quaternions for Skinning, covers dual quaternion math for game animation. Dual quaternions can be used to avoid pinching at animated joints.

Chapter 15, Rendering Instanced Crowds, shows how to encode animation data to a texture and move pose generation into a vertex shader. You will use this technique to render a large crowd using instancing.