0%

Build a 3D rendering engine from scratch while solving problems in a step-by-step way with the help of useful recipes

Key Features

  • Learn to integrate modern rendering techniques into a single performant 3D rendering engine
  • Leverage Vulkan to render 3D content, use AZDO in OpenGL applications, and understand modern real-time rendering methods
  • Implement a physically based rendering pipeline from scratch in Vulkan and OpenGL

Book Description

OpenGL is a popular cross-language, cross-platform application programming interface (API) used for rendering 2D and 3D graphics, while Vulkan is a low-overhead, cross-platform 3D graphics API that targets high-performance applications. 3D Graphics Rendering Cookbook helps you learn about modern graphics rendering algorithms and techniques using C++ programming along with OpenGL and Vulkan APIs.

The book begins by setting up a development environment and takes you through the steps involved in building a 3D rendering engine with the help of basic, yet self-contained, recipes. Each recipe will enable you to incrementally add features to your codebase and show you how to integrate different 3D rendering techniques and algorithms into one large project. You'll also get to grips with core techniques such as physically based rendering, image-based rendering, and CPU/GPU geometry culling, to name a few. As you advance, you'll explore common techniques and solutions that will help you to work with large datasets for 2D and 3D rendering. Finally, you'll discover how to apply optimization techniques to build performant and feature-rich graphics applications.

By the end of this 3D rendering book, you'll have gained an improved understanding of best practices used in modern graphics APIs and be able to create fast and versatile 3D rendering frameworks.

What you will learn

  • Improve the performance of legacy OpenGL applications
  • Manage a substantial amount of content in real-time 3D rendering engines
  • Discover how to debug and profile graphics applications
  • Understand how to use the Approaching Zero Driver Overhead (AZDO) philosophy in OpenGL
  • Integrate various rendering techniques into a single application
  • Find out how to develop Vulkan applications
  • Implement a physically based rendering pipeline from scratch
  • Integrate a physics library with your rendering engine

Who this book is for

This book is for 3D graphics developers who are familiar with the mathematical fundamentals of 3D rendering and want to gain expertise in writing fast rendering engines with advanced techniques using C++ libraries and APIs. A solid understanding of C++ and basic linear algebra, as well as experience in creating custom 3D applications without using premade rendering engines is required.

Table of Contents

  1. 3D Graphics Rendering Cookbook
  2. Contributors
  3. About the authors
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Sections
    8. Getting ready
    9. How to do it…
    10. How it works…
    11. There's more…
    12. See also
    13. Get in touch
    14. Share Your Thoughts
  6. Chapter 1: Establishing a Build Environment
    1. Technical requirements
    2. OpenGL 4.6 with AZDO and Vulkan
    3. What is the essence of modern OpenGL?
    4. Setting up our development environment on Windows
    5. Getting ready
    6. How to do it...
    7. There's more...
    8. Setting up our development environment on Linux
    9. Getting ready
    10. How to do it...
    11. Installing the Vulkan SDK for Windows and Linux
    12. Getting ready
    13. How to do it...
    14. There's more...
    15. Managing dependencies
    16. Getting ready
    17. How to do it...
    18. How it works...
    19. There's more...
    20. Getting the demo data 
    21. How to do it
    22. There's more...
    23. Creating utilities for CMake projects
    24. Getting ready
    25. How to do it...
    26. There's more...
  7. Chapter 2: Using Essential Libraries
    1. Technical requirements
    2. Using the GLFW library
    3. Getting ready
    4. How to do it...
    5. There's more...
    6. Doing math with GLM
    7. Getting ready
    8. How to do it...
    9. There's more...
    10. Loading images with STB
    11. Getting ready
    12. How to do it...
    13. There's more...
    14. Rendering a basic UI with Dear ImGui
    15. Getting ready
    16. How to do it...
    17. There's more…
    18. Integrating EasyProfiler 
    19. Getting ready
    20. How to do it...
    21. How it works...
    22. There's more...
    23. Integrating Optick
    24. Getting ready
    25. How to do it...
    26. How it works...
    27. There's more…
    28. Using the Assimp library
    29. Getting ready
    30. How to do it...
    31. Getting started with Etc2Comp 
    32. Getting ready
    33. How to do it...
    34. There's more...
    35. Multithreading with Taskflow
    36. Getting ready
    37. How to do it...
    38. There's more...
    39. Introducing MeshOptimizer 
    40. Getting ready
    41. How to do it...
    42. There's more...
  8. Chapter 3: Getting Started with OpenGL and Vulkan
    1. Technical requirements
    2. Intercepting OpenGL API calls
    3. Getting ready
    4. How to do it...
    5. How it works...
    6. Working with Direct State Access (DSA)
    7. Getting ready
    8. How to do it...
    9. There's more...
    10. Loading and compiling shaders in OpenGL
    11. Getting ready
    12. How to do it...
    13. There's more...
    14. Implementing programmable vertex pulling (PVP) in OpenGL
    15. Getting ready
    16. How to do it...
    17. How it works...
    18. There's more...
    19. Working with cube map textures
    20. Getting ready
    21. How to do it...
    22. There's more...
    23. Compiling Vulkan shaders at runtime
    24. Getting ready
    25. How to do it...
    26. How it works...
    27. There's more...
    28. Initializing Vulkan instances and graphical devices
    29. Getting ready
    30. How to do it...
    31. Initializing the Vulkan swap chain
    32. Getting ready
    33. How to do it...
    34. Setting up Vulkan's debugging capabilities
    35. How to do it...
    36. There's more…
    37. Tracking and cleaning up Vulkan objects
    38. Getting ready
    39. How to do it...
    40. Using Vulkan command buffers
    41. How to do it...
    42. See also
    43. Dealing with buffers in Vulkan
    44. Getting ready
    45. How to do it...
    46. How it works...
    47. Using texture data in Vulkan
    48. Getting ready
    49. How to do it...
    50. Using mesh geometry data in Vulkan
    51. Getting ready
    52. How to do it...
    53. Using Vulkan descriptor sets
    54. How to do it...
    55. There's more…
    56. Initializing Vulkan shader modules
    57. Getting ready
    58. How to do it...
    59. Initializing the Vulkan pipeline
    60. Getting ready...
    61. How to do it...
    62. There's more…
    63. See also
    64. Putting it all together into a Vulkan application
    65. Getting ready
    66. How to do it...
  9. Chapter 4: Adding User Interaction and Productivity Tools
    1. Technical requirements
    2. Organizing Vulkan frame rendering code
    3. Getting ready
    4. How to do it...
    5. There's more…
    6. Organizing mesh rendering in Vulkan
    7. Getting ready
    8. How to do it...
    9. Implementing an immediate mode drawing canvas
    10. Getting ready
    11. How to do it...
    12. Rendering a Dear ImGui user interface with Vulkan
    13. Getting ready
    14. How to do it...
    15. Working with a 3D camera and basic user interaction
    16. Getting ready
    17. How to do it...
    18. How it works...
    19. There's more...
    20. Adding a frames-per-second counter
    21. Getting ready
    22. How to do it...
    23. There's more...
    24. Adding camera animations and motion
    25. Getting ready
    26. How to do it...
    27. How it works...
    28. There's more...
    29. Integrating EasyProfiler and Optick into C++ applications
    30. Getting ready
    31. How to do it...
    32. How it works...
    33. Using cube map textures in Vulkan
    34. Getting ready
    35. How to do it...
    36. Rendering onscreen charts
    37. Getting ready
    38. How to do it...
    39. How it works...
    40. Putting it all together into a Vulkan application
    41. Getting ready
    42. How to do it...
  10. Chapter 5: Working with Geometry Data
    1. Technical requirements
    2. Organizing the storage of mesh data
    3. Getting ready
    4. How to do it...
    5. How it works...
    6. There's more...
    7. Implementing a geometry conversion tool
    8. Getting ready
    9. How to do it...
    10. How it works...
    11. There's more...
    12. Indirect rendering in Vulkan
    13. Getting ready
    14. How to do it...
    15. There's more...
    16. Implementing an infinite grid GLSL shader
    17. Getting ready
    18. How to do it...
    19. There's more...
    20. Rendering multiple meshes with OpenGL
    21. Getting ready
    22. How to do it…
    23. Generating LODs using MeshOptimizer
    24. Getting ready
    25. How to do it...
    26. There's more...
    27. Integrating tessellation into the OpenGL graphics pipeline
    28. Getting ready
    29. How to do it...
    30. There's more...
  11. Chapter 6: Physically Based Rendering Using the glTF2 Shading Model
    1. Technical requirements
    2. Simplifying Vulkan initialization and frame composition
    3. How to do it...
    4. Initializing compute shaders in Vulkan
    5. Getting ready
    6. How to do it...
    7. There's more...
    8. Using descriptor indexing and texture arrays in Vulkan
    9. Getting ready
    10. How to do it...
    11. There's more...
    12. Using descriptor indexing in Vulkan to render an ImGui
    13. Getting ready
    14. How to do it...
    15. Generating textures in Vulkan using compute shaders
    16. Getting ready
    17. How to do it...
    18. Implementing computed meshes in Vulkan
    19. Getting ready
    20. How to do it...
    21. There's more...
    22. Precomputing BRDF LUTs
    23. Getting ready
    24. How to do it...
    25. There's more...
    26. Precomputing irradiance maps and diffuse convolution
    27. Getting ready
    28. How to do it...
    29. There's more...
    30. Implementing the glTF2 shading model
    31. Getting ready
    32. How to do it...
    33. There's more...
  12. Chapter 7: Graphics Rendering Pipeline
    1. Technical requirements
    2. How not to do a scene graph
    3. Using data-oriented design for a scene graph
    4. Getting ready
    5. How to do it...
    6. There's more...
    7. Loading and saving a scene graph
    8. Getting ready
    9. How to do it...
    10. There's more...
    11. Implementing transformation trees
    12. Getting ready
    13. How to do it...
    14. There's more...
    15. Implementing a material system
    16. Getting ready
    17. How to do it...
    18. Importing materials from Assimp
    19. Getting ready
    20. How to do it...
    21. There's more...
    22. Implementing a scene conversion tool
    23. Getting ready
    24. How to do it...
    25. There's more...
    26. Managing Vulkan resources
    27. Getting ready
    28. How to do it...
    29. There's more...
    30. Refactoring Vulkan initialization and the main loop
    31. Getting ready
    32. How to do it...
    33. Working with rendering passes
    34. Getting ready
    35. How to do it...
    36. There's more...
    37. Unifying descriptor set creation routines
    38. Getting ready
    39. How to do it...
    40. There's more...
    41. Putting it all together into a Vulkan application
    42. Getting ready
    43. How to do it...
    44. How it works…
    45. There's more...
  13. Chapter 8: Image-Based Techniques
    1. Technical requirements
    2. Implementing offscreen rendering in OpenGL
    3. Getting ready
    4. How to do it…
    5. Implementing fullscreen quad rendering
    6. Getting ready
    7. How to do it…
    8. There's more...
    9. Implementing shadow maps in OpenGL
    10. Getting ready
    11. How to do it…
    12. There's more…
    13. Implementing SSAO in OpenGL
    14. Getting ready
    15. How to do it...
    16. There's more...
    17. Implementing HDR rendering and tone mapping
    18. Getting ready
    19. How to do it...
    20. There's more...
    21. Implementing HDR light adaptation
    22. Getting ready
    23. How to do it...
    24. There's more...
    25. Writing postprocessing effects in Vulkan
    26. Getting ready...
    27. How to do it...
    28. Implementing SSAO in Vulkan
    29. Getting ready...
    30. How to do it...
    31. Implementing HDR rendering in Vulkan
    32. Getting ready…
    33. How to do it...
    34. There's more…
  14. Chapter 9: Working with Scene Graphs
    1. Technical requirements
    2. Deleting nodes and merging scene graphs
    3. How to do it...
    4. Finalizing the scene-converter tool
    5. Getting ready
    6. How to do it...
    7. There's more...
    8. Implementing lightweight rendering queues in OpenGL
    9. Getting ready
    10. How to do it...
    11. There's more...
    12. Working with shape lists in Vulkan
    13. Getting ready
    14. How to do it...
    15. Adding Bullet physics to a graphics application
    16. Getting ready
    17. How to do it...
    18. There's more...
  15. Chapter 10: Advanced Rendering Techniques and Optimizations
    1. Technical requirements
    2. Doing frustum culling on the CPU
    3. Getting ready
    4. How to do it…
    5. There's more...
    6. Doing frustum culling on the GPU with compute shaders
    7. Getting ready
    8. How to do it…
    9. There's more...
    10. Implementing order-independent transparency
    11. Getting ready
    12. How to do it…
    13. Loading texture assets asynchronously
    14. Getting ready
    15. How to do it...
    16. There's more...
    17. Implementing projective shadows for directional lights
    18. Getting ready
    19. How to do it...
    20. There's more...
    21. Using GPU atomic counters in Vulkan
    22. Getting ready
    23. How to do it...
    24. There's more…
    25. Putting it all together into an OpenGL demo
    26. Getting ready
    27. How to do it...
    28. There's more…
    29. Why subscribe?
  16. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts
3.233.221.42