Library / SDK
PacktPublishing/3D-Graphics-Rendering-Cookbook avatar
PacktPublishing/3D-Graphics-Rendering-Cookbook

3D Graphics Rendering Cookbook, and a book repository you can actually compile

3D Graphics Rendering Cookbook, published by Packt.

1,122 stars159 forksC++MIT

At a glance

What is it?
This is the code repository for a Packt book on modern OpenGL and Vulkan rendering, and its value is that every chapter is a small buildable project with its own folder, its own dependencies and its own demo. The first edition dates from 2021, a Vulkan second edition arrived in 2025, and the repository still gets commits.
Who is it for?
Adopt this repository if you want worked examples of modern rendering code that compile, with the surrounding tooling shown alongside the technique, because the profiler and asset pipeline samples in chapter 2 are as instructive as the rendering chapters. Do not adopt it as a current reference for OpenGL or Vulkan practice, since the first edition predates several years of API evolution and the newer material lives in the separate Vulkan second edition repository.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 147 days ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Ten chapters, each a project rather than a snippet

This is the code repository for the 3D Graphics Rendering Cookbook, published by Packt in 2021, written by Sergey Kosarevsky and Viktor Latypov, and it is described as a comprehensive guide to exploring rendering algorithms in modern OpenGL and Vulkan.

The structure is the point. All of the code is organized into folders, one per chapter, and the top level of the repository holds Chapter1 through Chapter10, plus a shared directory, a deps directory, a data directory, a CMake directory, a CMakeLists.txt and the bootstrap.py script.

That layout means each chapter is an independent project rather than a set of fragments. Every chapter has its own build target, its own third party dependencies and its own demo application, so you can read one chapter and build one chapter. A reader who wants to know how a physically based rendering pipeline is put together can go to chapter 6 and compile only that.

The book description also makes clear what the repository is for, which is the framing a lot of book repositories get wrong. This is the code that goes with the text, with the toolchain and the assets, and the text itself is the product.

There is a second edition, the Vulkan 3D Graphics Rendering Cookbook from 2025, in a separate repository, and the first edition README points at it. That is worth knowing before you start, because a reader who wants Vulkan material should probably start there, and a reader who wants the OpenGL material is in the right place.

The primary language is C++, the licence is MIT, the last push was on 2026-05-29, and the repository is not archived.

Who the book assumes you already are

The audience is stated precisely, and it is narrower than a book title suggests.

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.

Three exclusions in one sentence. Not a beginner's book, not a book for people learning the mathematics, and not a book for people who want to assemble a game with an engine. It assumes you can already write a 3D application without Unity or Unreal, and it uses that starting point to talk about the parts that engines hide.

The feature list matches that audience. 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.

The AZDO item is the tell that this is a book about the driver and the API rather than about the algorithms in isolation, and the physics library item is the tell that it is about a real engine rather than a demo. Both are the parts a beginner cannot yet appreciate and an experienced graphics programmer cannot easily find written down.

The toolchain, the hardware, and 15 gigabytes of assets

The software and hardware list is short and specific, and it is the first thing to check before you start.

For chapters 1 to 10, the requirements are Microsoft Visual Studio 2019 on Windows, or GCC 8 on Linux, plus Python 3.x on either, plus the Vulkan SDK on either. The build is CMake on both platforms.

The hardware line is more interesting. The code runs on graphics cards as old as a GeForce 740M, however a GeForce GTX 1060 or newer is strongly recommended. That is a wide span, from a decade old laptop card to a current mid range desktop card, and it tells you two things: that the examples are not demanding a modern ray tracing capable GPU, and that the author has tested against a low end card as well.

The disk requirement is the one that will surprise people. You should make sure you have about 15Gb of free space before you download the assets and build the source code. That figure is for the assets, and the models come from Morgan McGuire's Computer Graphics Archive.

That archive is a well known collection of test models, and using it means the meshes in the book are the kind of models that expose the problems: real scans, real subdivision, real texture sizes, rather than a sphere and a cube. It is the reason the book can talk about content management and about mesh optimisation with something to point at.

The bootstrap script handles the download and the dependency build, and the instruction is to run it from the root folder of the repository. One script, fifteen gigabytes, and the chapters afterwards work.

Building on Windows and Linux, and a detail about the working directory

The build instructions are short, and the difference between the two platforms is the generator and the working directory.

On Windows, you create a build directory, change into it, configure with the Visual Studio generator and open the generated solution.

bash
mkdir build
cd build
cmake .. -G "Visual Studio 16 2019" -A x64
start RenderingCookbook.sln

On Linux, the same without the generator, and then you go back to the root.

bash
mkdir build
cd build
cmake ..
cd ..

That last cd is not a typo, and the reason is stated in the section that follows: the compiled demo applications have to be run from the root folder of the repository, because they load their assets through paths relative to it.

The naming of the solution, RenderingCookbook.sln, and the -A x64 flag tell you the target architecture, and the Visual Studio 16 2019 generator matches the Visual Studio 2019 in the software list, so a current Visual Studio will need the generator to be available.

For anyone writing their own book-adjacent code, the CMake code in the repository is a small lesson in itself. The snippet the README shows is a macro that takes a list of source files and derives the parent directory of each, which is the kind of helper that keeps a ten chapter repository from turning into a hundred hand written target definitions.

Convert the assets first, or chapters 5 to 10 will not run

The running section contains the instruction that will save an evening.

Demo applications from this book require obj and gltf2 assets to be converted to the run-time loadable formats. Make sure you run Chapter5/MeshConvert before running anything else from chapters 5 to 10, and Chapter7/SceneConverter before running demos from chapters 7 to 10.

The distinction is between the interchange formats that assets are authored in and the formats the engine loads at run time, and the book treats that conversion as part of the material rather than as a build detail. The MeshConvert tool is a chapter 5 program and the SceneConverter tool is a chapter 7 program, so the tooling for the pipeline is itself taught in the book.

The chapter 2 sample list shows the shape of the whole book, because it is a list of tools rather than of rendering techniques. There is 01_GLFW for the windowing library, 02_GLM for the maths library, 03_STB for the single header library, 04_ImGui for the immediate mode GUI, 05_EasyProfiler and 06_Optick for profiling, 07_Assimp for asset import, 08_ETC2Comp for texture compression, 09_Taskflow for task scheduling and 10_MeshOptimizer for mesh optimisation.

A reader who has worked in graphics will recognise that list as the real toolchain of a small engine, and that the book devotes a whole chapter to it before any rendering happens. Chapter 1 is 1_Bootstrap and 2_CMake, so even the build system is taught.

Later chapters follow the same convention, with Chapter3 holding GL01_APIWrapping, GL02_VtxPulling and GL03_CubeMap on the OpenGL side and VK01_GLSLang and VK02_DemoApp on the Vulkan side, Chapter4 a camera and an FPS counter, and Chapter5 a grid, tessellation and a mesh renderer with VK01_MultiMeshDraw.

Where the second edition leaves you, and what the licence allows

Two things are worth saying plainly about the state of this repository.

The first is that it is not maintained in the way an engine is maintained. The releases are 1.0.0 from 2021-07-28 and 1.0.1 from 2021-09-02, and there have been no others, which is what you would expect from a book companion repository whose content is frozen at the state of the printed edition. The last push was on 2026-05-29 and the repository is not archived, so something is still being touched, but it is not a moving target and it is not where new material will appear.

The second is that the newer material is elsewhere. The Vulkan 3D Graphics Rendering Cookbook, the second edition, published in 2025, is a separate repository, and the first edition points you at it. The two are complements rather than editions in the usual sense, because the first covers OpenGL as well as Vulkan and the second goes deeper on Vulkan.

The licence is MIT, which for a book companion repository is the most permissive choice available and means the sample code can be lifted into your own project, adapted, and used in commercial work without any obligation beyond keeping the notice. There is a LICENSE file at the top level of the repository.

That is the practical value of this repository for an engineer: it is a corpus of modern rendering code that compiles, is organised by technique, and comes with the profiling and asset tooling that shows how the technique is supposed to be measured.

Editorial conclusion

Adopt this repository if you want worked examples of modern rendering code that compile, with the surrounding tooling shown alongside the technique, because the profiler and asset pipeline samples in chapter 2 are as instructive as the rendering chapters. Do not adopt it as a current reference for OpenGL or Vulkan practice, since the first edition predates several years of API evolution and the newer material lives in the separate Vulkan second edition repository. Before you start, run the bootstrap script and expect to spend about 15 gigabytes of disk on the assets, and build the asset converters before the later chapters, because the demo applications expect converted formats rather than the raw obj and gltf2 files.

Frequently asked questions

What is in the 3D Graphics Rendering Cookbook repository?

It is the code for a Packt book published in 2021, with the source organised into folders per chapter from Chapter1 to Chapter10, plus shared code, third party dependencies, data and the bootstrap script. Each chapter is a separate buildable project with its own demo.

What do I need to build the code?

Microsoft Visual Studio 2019 on Windows or GCC 8 on Linux, plus Python 3.x and the Vulkan SDK. The code runs on cards as old as a GeForce 740M, but a GeForce GTX 1060 or newer is strongly recommended, and you need about 15Gb of free space for the assets.

How do I get the assets?

Run the bootstrap.py script from the root folder of the repository, which downloads the models from Morgan McGuire's Computer Graphics Archive and builds the source code. The book says to have around 15Gb free before you start.

Why do the demos fail to find their assets?

The demo applications need obj and gltf2 assets converted into the run-time loadable formats. Run Chapter5/MeshConvert before anything from chapters 5 to 10 and Chapter7/SceneConverter before chapters 7 to 10, and run the compiled demos from the root folder of the repository.

Is there a newer edition?

Yes, the Vulkan 3D Graphics Rendering Cookbook, the second edition from 2025, is in a separate repository which the first edition points to. The first edition's releases are 1.0.0 from 2021-07-28 and 1.0.1 from 2021-09-02, under the MIT licence.

Official sources

  1. Issues
  2. License: MIT
  3. PacktPublishing/3D-Graphics-Rendering-Cookbook on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/packtpublishing-3d-graphics-rendering-cookbook.svg)](https://hysenlabs.com/projects/packtpublishing-3d-graphics-rendering-cookbook)