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)

Exploring the samples

All of the code presented in this book is available in the downloadable content for the book. There is one large sample, called AllChapters, which includes every sample in a single application. There is a Bin ZIP file that contains a pre-compiled executable of the AllChapters sample.

There are also individual folders for each chapter that contain multiple sub-folders. Every chapter contains Sample00, which is the code as it was written in the book with no additional content. The subsequently numbered samples add content.

The AllChapters sample looks a bit different from the samples in the individual chapter folders. This application uses Nuklear (https://github.com/vurtun/nuklear) to display its UI. The part of the UI that is displayed is a stats counter in the upper-right corner of the screen. It looks like this:

Figure 1.5: Stats counter for the AllChapters sample

Figure 1.5: Stats counter for the AllChapters sample

The top box contains some general information about the display that the application opened on. This information contains the display frequency, whether vsynch is enabled, and what the frame budget is in milliseconds.

The second box down contains high-level frame timings. The time displayed will turn red if there was a stale frame in the last 60 frames. Some stale frames are unavoidable; if the frame rate drops to 59.9, the text will show red for a second. Seeing red here occasionally is OK; it's only a concern if the numbers are solid red.

The third box down contains two GPU timers; these measure how fast the sample is running on the GPU. This is useful for debugging any heavy draw calls. The final box contains CPU timers, which are helpful for figuring out which phase of the problem has a bottleneck.

Important note

Throughout this book, you will use C++ stl containers. The Standard Library is a bit slow in debug mode, mostly due to error checking. It's a good idea to profile any samples in release mode only.

These examples should do a fair job of demonstrating what you will learn in each of the upcoming chapters. They also provide an example for you to compare your code against.