C++ Game Animation Programming Learn Modern Animation Techniques from Theory to Implementation Using C++, OpenGL, and Vulkan

If you‘re fascinated by the complexities of animating video game characters and are curious about the transformation of model files into 3D avatars and NPCs that can explore virtual worlds, then this book is for you. In this new edition, you’ll learn everything you need to know about game animation,...

Descripción completa

Detalles Bibliográficos
Otros Autores: Dunsky, Michael, author (author), Szauer, Gabor, author
Formato: Libro electrónico
Idioma:Inglés
Publicado: Birmingham, England : Packt Publishing Ltd [2023]
Edición:Second edition
Materias:
Ver en Biblioteca Universitat Ramon Llull:https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009827938706719
Tabla de Contenidos:
  • Cover
  • Title Page
  • Copyright and Credits
  • Contributors
  • Dedicated
  • Table of Contents
  • Preface
  • Part 1: Building a Graphics Renderer
  • Chapter 1: Creating the Game Window
  • Technical requirements
  • Getting the source code and the basic tools
  • Code organization in this book
  • The basic code for our application
  • NULL versus nullptr
  • Creating your first window
  • Adding support for OpenGL or Vulkan to the window
  • GLFW and OpenGL
  • GLFW and Vulkan
  • Event handling in GLFW
  • The GLFW event queue handling
  • Mixing the C++ classes and the C callbacks
  • The mouse and keyboard input for the game window
  • Key code, scan code, and modifiers
  • Different styles of mouse movement
  • Summary
  • Practical sessions
  • Additional resources
  • Chapter 2: Building an OpenGL 4 Renderer
  • Technical requirements
  • The rendering pipeline of OpenGL 4
  • Basic elements of the OpenGL 4 renderer
  • The OpenGL loader generator Glad
  • Anatomy of the OpenGL renderer
  • The main OpenGL class
  • Buffer types for the OpenGL renderer
  • Loading and compiling shaders
  • Vertex and fragment shaders
  • Creating our shader loader
  • Creating the simple Model class
  • Getting an image for the texture
  • Summary
  • Practical sessions
  • Additional resources
  • Chapter 3: Building a Vulkan Renderer
  • Technical requirements
  • Basic anatomy of a Vulkan application
  • Differences and similarities between OpenGL 4 and Vulkan
  • Technical similarities
  • Differences
  • Using helper libraries for Vulkan
  • Initializing Vulkan via vk-bootstrap
  • Memory management with VMA
  • Fitting the Vulkan nuts and bolts together
  • General considerations about classes
  • Changes in the Window class
  • Passing around the VkRenderData structure
  • Vulkan object initialization structs
  • Required changes to the shaders
  • Drawing the triangles on the screen.
  • Differences and similarities between OpenGL and Vulkan, reprised
  • Summary
  • Practical sessions
  • Additional resources
  • Chapter 4: Working with Shaders
  • Technical requirements
  • Shader basics
  • GLM, the OpenGL Mathematics library
  • GLM data types and basic operations
  • GLM transformations
  • Vertex data transfer to the GPU
  • Switching shaders at runtime
  • Creating a new set of shaders
  • Binding the shader switching to a key
  • The shader switch in the draw call
  • Shader switching in Vulkan
  • Sending additional data to the GPU
  • Using uniform buffers to upload constant data
  • Creating a uniform buffer
  • Shader changes to use the data in the buffer
  • Preparing and uploading data
  • Using uniform buffers in Vulkan
  • Using push constants in Vulkan
  • Summary
  • Practical sessions
  • Additional resources
  • Chapter 5: Adding Dear ImGui to Show Valuable Information
  • Technical requirements
  • What is Dear ImGui?
  • Adding ImGui to the OpenGL and Vulkan renderers
  • Adding the headers to the OpenGL renderer
  • Adding the headers to the Vulkan renderer
  • CMake adjustments needed for ImGui
  • Moving the shared data to the OGLRenderData header
  • Creating the UserInterface class
  • Adding the implementation of the UserInterface class
  • Adding the UserInterface class to the OpenGL renderer
  • Creating an FPS counter
  • Using GLFW as a simple timer
  • Adding the values to the user interface
  • Timing sections of your code and showing the results
  • Adding the Timer class
  • Integrating the new Timer class into the renderer
  • Adding UI elements to control the application
  • Adding a checkbox
  • Adding a button to switch between the shaders
  • Adding a slider to control the field of view
  • Summary
  • Practical sessions
  • Additional resources
  • Part 2: Mathematics Roundup
  • Chapter 6: Understanding Vector and Matrix.
  • Technical requirements
  • A review of the vector and its operations
  • Representations of vectors
  • Adding and subtracting vectors
  • Calculating the length of a vector
  • Zero and unit vectors
  • Vector normalization
  • Vector multiplication
  • A review of the matrix and its operations
  • Matrix representation
  • Null matrix and identity matrix
  • Matrix addition and subtraction
  • Matrix multiplication
  • Transposed and inverse matrices
  • Matrix/vector multiplication
  • Adding a camera to the renderer
  • Creating the new Camera class
  • Integrating the new camera into the Renderer class
  • Implementing mouse control in the Window class
  • Showing the camera values in the user interface
  • Adding camera movement
  • Using new variables to change the camera position
  • Moving the camera around
  • Adding the camera position to the user interface
  • Summary
  • Practical sessions
  • Additional resources
  • Chapter 7: A Primer on Quaternions and Splines
  • Technical requirements
  • What are quaternions?
  • Imaginary and complex numbers
  • The discovery of the quaternion
  • Creating a quaternion
  • Quaternion operations and transformations
  • Exploring vector rotation
  • The Euler rotations
  • The gimbal lock
  • Rotating using quaternions
  • Incremental rotations
  • Using quaternions for smooth rotations
  • A quick take on splines
  • Constructing a Hermite spline
  • Spline continuity
  • Hermite polynomials
  • Combining quaternions and splines
  • Summary
  • Practical sessions
  • Additional resources
  • Part 3: Working with Models and Animations
  • Chapter 8: Loading Models in the glTF Format
  • Technical requirements
  • An analysis of the glTF file format
  • Exploring an example glTF file
  • Understanding the scenes element
  • Finding the nodes and meshes
  • Decoding the raw data in the buffers element
  • Understanding the accessor element.
  • Translating data using the buffer views
  • Checking the glTF version in the asset element
  • Using a C++ glTF loader to get the model data
  • Adding new glTF shaders
  • Organizing the loaded data into a C++ class
  • Learning about the design and implementation of the C++ class
  • Adding the new model class to the renderer
  • Adding the glTF loader and model to the Vulkan renderer
  • Summary
  • Practical sessions
  • Additional resources
  • Chapter 9: The Model Skeleton and Skin
  • Technical requirements
  • These skeletons are not spooky
  • Why do we create a node tree of the skeleton?
  • Adding the node class
  • Filling the skeleton tree in the Gltf model class
  • The inverse bind matrices and the binding pose
  • How (not) to apply a skin to a skeleton
  • Naive model skinning
  • Vertex skinning in glTF
  • Connecting joints and nodes
  • Joints and weights for the vertices
  • Creating the joint transformation matrices
  • Applying vertex skinning
  • Implementing GPU-based skinning
  • Moving the joints and weights to the vertex shader
  • Getting rid of the UBO fixed array size
  • Identifying linear skinning problems
  • The dual quaternion
  • Using dual quaternions as data storage
  • Dual quaternions in GLM
  • Adding dual quaternions to the glTF model
  • Adding a dual quaternion shader
  • Adjusting the renderer
  • Summary
  • Practical sessions
  • Additional resources
  • Chapter 10: About Poses, Frames, and Clips
  • Technical requirements
  • A brief overview of animations
  • What is a pose and how do we represent it?
  • From a single frame to an entire animation clip
  • Pouring the knowledge into C++ classes
  • Storing the channel data in a class
  • Adding the class for the animation clips
  • Loading the animation data from the glTF model file
  • Adding new control variables for the animations
  • Managing the animations in the user interface.
  • Adding the animation replay to the renderer
  • Summary
  • Practical sessions
  • Additional resources
  • Chapter 11: Blending between Animations
  • Technical requirements
  • Does it blend?
  • Fading animation clips in and out
  • Crossfading between animation clips
  • Adding multiple animation clips into one clip
  • Blending between the binding pose and animation clip
  • Enhancing the node class
  • Updating the model class
  • Adding the blend to the animation clip class
  • Implementing animation blending in the OpenGL renderer
  • Crossfading animations
  • Upgrading the model classes
  • Adjusting the OpenGL renderer
  • Adding new controls to the user interface
  • How to do additive blending
  • Splitting the node skeleton - part I
  • Splitting the node skeleton - part II
  • Updating the animation clip class
  • Finalizing additive blending in the OpenGL renderer
  • Exposing the additive blending parameters in the user interface
  • Summary
  • Practical sessions
  • Part 4: Advancing Your Code to the Next Level
  • Chapter 12: Cleaning Up the User Interface
  • Technical requirements
  • UI controls are cool
  • Creating combo boxes and radio buttons
  • Implementing a combo box the C++ way
  • Swapping the data types
  • Filling the arrays for the combo boxes
  • Fine-tuning selections with radio buttons
  • Adjusting the renderer code
  • Updating the model class
  • Switching the control elements in the user interface
  • Drawing time series with ImGui
  • One ring buffer to rule them all
  • Creating plots in ImGui
  • Adding plots to the user interface
  • Popping up a tooltip with the plot
  • The sky is the limit
  • Summary
  • Practical sessions
  • Additional resources
  • Chapter 13: Implementing Inverse Kinematics
  • Technical requirements
  • What is Inverse Kinematics, and why do we need it?
  • The two types of Kinematics
  • Choosing a path to reach the target.
  • Building a CCD solver.