0%

Chapters

Hours read

Total Words

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

- 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

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.

- 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

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.

- 3D Graphics Rendering Cookbook
- Contributors
- About the authors
- About the reviewers
- Preface
- Chapter 1: Establishing a Build Environment
- Technical requirements
- OpenGL 4.6 with AZDO and Vulkan
- What is the essence of modern OpenGL?
- Setting up our development environment on Windows
- Getting ready
- How to do it...
- There's more...
- Setting up our development environment on Linux
- Getting ready
- How to do it...
- Installing the Vulkan SDK for Windows and Linux
- Getting ready
- How to do it...
- There's more...
- Managing dependencies
- Getting ready
- How to do it...
- How it works...
- There's more...
- Getting the demo data
- How to do it
- There's more...
- Creating utilities for CMake projects
- Getting ready
- How to do it...
- There's more...

- Chapter 2: Using Essential Libraries
- Technical requirements
- Using the GLFW library
- Getting ready
- How to do it...
- There's more...
- Doing math with GLM
- Getting ready
- How to do it...
- There's more...
- Loading images with STB
- Getting ready
- How to do it...
- There's more...
- Rendering a basic UI with Dear ImGui
- Getting ready
- How to do it...
- There's more…
- Integrating EasyProfiler
- Getting ready
- How to do it...
- How it works...
- There's more...
- Integrating Optick
- Getting ready
- How to do it...
- How it works...
- There's more…
- Using the Assimp library
- Getting ready
- How to do it...
- Getting started with Etc2Comp
- Getting ready
- How to do it...
- There's more...
- Multithreading with Taskflow
- Getting ready
- How to do it...
- There's more...
- Introducing MeshOptimizer
- Getting ready
- How to do it...
- There's more...

- Chapter 3: Getting Started with OpenGL and Vulkan
- Technical requirements
- Intercepting OpenGL API calls
- Getting ready
- How to do it...
- How it works...
- Working with Direct State Access (DSA)
- Getting ready
- How to do it...
- There's more...
- Loading and compiling shaders in OpenGL
- Getting ready
- How to do it...
- There's more...
- Implementing programmable vertex pulling (PVP) in OpenGL
- Getting ready
- How to do it...
- How it works...
- There's more...
- Working with cube map textures
- Getting ready
- How to do it...
- There's more...
- Compiling Vulkan shaders at runtime
- Getting ready
- How to do it...
- How it works...
- There's more...
- Initializing Vulkan instances and graphical devices
- Getting ready
- How to do it...
- Initializing the Vulkan swap chain
- Getting ready
- How to do it...
- Setting up Vulkan's debugging capabilities
- How to do it...
- There's more…
- Tracking and cleaning up Vulkan objects
- Getting ready
- How to do it...
- Using Vulkan command buffers
- How to do it...
- See also
- Dealing with buffers in Vulkan
- Getting ready
- How to do it...
- How it works...
- Using texture data in Vulkan
- Getting ready
- How to do it...
- Using mesh geometry data in Vulkan
- Getting ready
- How to do it...
- Using Vulkan descriptor sets
- How to do it...
- There's more…
- Initializing Vulkan shader modules
- Getting ready
- How to do it...
- Initializing the Vulkan pipeline
- Getting ready...
- How to do it...
- There's more…
- See also
- Putting it all together into a Vulkan application
- Getting ready
- How to do it...

- Chapter 4: Adding User Interaction and Productivity Tools
- Technical requirements
- Organizing Vulkan frame rendering code
- Getting ready
- How to do it...
- There's more…
- Organizing mesh rendering in Vulkan
- Getting ready
- How to do it...
- Implementing an immediate mode drawing canvas
- Getting ready
- How to do it...
- Rendering a Dear ImGui user interface with Vulkan
- Getting ready
- How to do it...
- Working with a 3D camera and basic user interaction
- Getting ready
- How to do it...
- How it works...
- There's more...
- Adding a frames-per-second counter
- Getting ready
- How to do it...
- There's more...
- Adding camera animations and motion
- Getting ready
- How to do it...
- How it works...
- There's more...
- Integrating EasyProfiler and Optick into C++ applications
- Getting ready
- How to do it...
- How it works...
- Using cube map textures in Vulkan
- Getting ready
- How to do it...
- Rendering onscreen charts
- Getting ready
- How to do it...
- How it works...
- Putting it all together into a Vulkan application
- Getting ready
- How to do it...

- Chapter 5: Working with Geometry Data
- Technical requirements
- Organizing the storage of mesh data
- Getting ready
- How to do it...
- How it works...
- There's more...
- Implementing a geometry conversion tool
- Getting ready
- How to do it...
- How it works...
- There's more...
- Indirect rendering in Vulkan
- Getting ready
- How to do it...
- There's more...
- Implementing an infinite grid GLSL shader
- Getting ready
- How to do it...
- There's more...
- Rendering multiple meshes with OpenGL
- Getting ready
- How to do it…
- Generating LODs using MeshOptimizer
- Getting ready
- How to do it...
- There's more...
- Integrating tessellation into the OpenGL graphics pipeline
- Getting ready
- How to do it...
- There's more...

- Chapter 6: Physically Based Rendering Using the glTF2 Shading Model
- Technical requirements
- Simplifying Vulkan initialization and frame composition
- How to do it...
- Initializing compute shaders in Vulkan
- Getting ready
- How to do it...
- There's more...
- Using descriptor indexing and texture arrays in Vulkan
- Getting ready
- How to do it...
- There's more...
- Using descriptor indexing in Vulkan to render an ImGui
- Getting ready
- How to do it...
- Generating textures in Vulkan using compute shaders
- Getting ready
- How to do it...
- Implementing computed meshes in Vulkan
- Getting ready
- How to do it...
- There's more...
- Precomputing BRDF LUTs
- Getting ready
- How to do it...
- There's more...
- Precomputing irradiance maps and diffuse convolution
- Getting ready
- How to do it...
- There's more...
- Implementing the glTF2 shading model
- Getting ready
- How to do it...
- There's more...

- Chapter 7: Graphics Rendering Pipeline
- Technical requirements
- How not to do a scene graph
- Using data-oriented design for a scene graph
- Getting ready
- How to do it...
- There's more...
- Loading and saving a scene graph
- Getting ready
- How to do it...
- There's more...
- Implementing transformation trees
- Getting ready
- How to do it...
- There's more...
- Implementing a material system
- Getting ready
- How to do it...
- Importing materials from Assimp
- Getting ready
- How to do it...
- There's more...
- Implementing a scene conversion tool
- Getting ready
- How to do it...
- There's more...
- Managing Vulkan resources
- Getting ready
- How to do it...
- There's more...
- Refactoring Vulkan initialization and the main loop
- Getting ready
- How to do it...
- Working with rendering passes
- Getting ready
- How to do it...
- There's more...
- Unifying descriptor set creation routines
- Getting ready
- How to do it...
- There's more...
- Putting it all together into a Vulkan application
- Getting ready
- How to do it...
- How it works…
- There's more...

- Chapter 8: Image-Based Techniques
- Technical requirements
- Implementing offscreen rendering in OpenGL
- Getting ready
- How to do it…
- Implementing fullscreen quad rendering
- Getting ready
- How to do it…
- There's more...
- Implementing shadow maps in OpenGL
- Getting ready
- How to do it…
- There's more…
- Implementing SSAO in OpenGL
- Getting ready
- How to do it...
- There's more...
- Implementing HDR rendering and tone mapping
- Getting ready
- How to do it...
- There's more...
- Implementing HDR light adaptation
- Getting ready
- How to do it...
- There's more...
- Writing postprocessing effects in Vulkan
- Getting ready...
- How to do it...
- Implementing SSAO in Vulkan
- Getting ready...
- How to do it...
- Implementing HDR rendering in Vulkan
- Getting ready…
- How to do it...
- There's more…

- Chapter 9: Working with Scene Graphs
- Technical requirements
- Deleting nodes and merging scene graphs
- How to do it...
- Finalizing the scene-converter tool
- Getting ready
- How to do it...
- There's more...
- Implementing lightweight rendering queues in OpenGL
- Getting ready
- How to do it...
- There's more...
- Working with shape lists in Vulkan
- Getting ready
- How to do it...
- Adding Bullet physics to a graphics application
- Getting ready
- How to do it...
- There's more...

- Chapter 10: Advanced Rendering Techniques and Optimizations
- Technical requirements
- Doing frustum culling on the CPU
- Getting ready
- How to do it…
- There's more...
- Doing frustum culling on the GPU with compute shaders
- Getting ready
- How to do it…
- There's more...
- Implementing order-independent transparency
- Getting ready
- How to do it…
- Loading texture assets asynchronously
- Getting ready
- How to do it...
- There's more...
- Implementing projective shadows for directional lights
- Getting ready
- How to do it...
- There's more...
- Using GPU atomic counters in Vulkan
- Getting ready
- How to do it...
- There's more…
- Putting it all together into an OpenGL demo
- Getting ready
- How to do it...
- There's more…
- Why subscribe?

- Other Books You May Enjoy