3D Graphics Rendering Cookbook
Sergey Kosarevsky, Viktor Latypov
- 670 Seiten
- English
- ePUB (handyfreundlich)
- Über iOS und Android verfügbar
3D Graphics Rendering Cookbook
Sergey Kosarevsky, Viktor Latypov
Über dieses Buch
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.
]]>
Häufig gestellte Fragen
Information
Chapter 1: Establishing a Build Environment
- OpenGL 4.6 with AZDO and Vulkan
- Setting up our development environment on Windows
- Setting up our development environment on Linux
- Installing the Vulkan SDK for Windows and Linux
- Managing dependencies
- Getting the demo data
- Creating utilities for CMake projects
Technical requirements
OpenGL 4.6 with AZDO and Vulkan
What is the essence of modern OpenGL?
- OpenGL 4.2:ARB_texture_storage introduces immutable textures whose metadata should be provided up front. For example, the classic glTexImage() function does not have any information on how many MIP levels would be required for a texture. The new glTexStorage/glTextureStorage API is more versatile and allows more driver-side optimizations.
- OpenGL 4.3:ARB_multi_draw_indirect (MDI) is batching "on steroids" and, compared to the classic instancing, can render a number of different geometries at once in a single draw call. This feature plays best when object data, such as geometry and material properties, is stored in large buffers. When combined with persistent mapped buffers, MDI buffers can be filled with commands from different threads. Pointers to the buffers can be passed to threads and do not require any OpenGL context to be available. The buffer content does not have to be regenerated every frame so it can be reused and even changed by the GPU directly. This allows for various GPU-based culling techniques and automatic level-of-detail implemented via compute shaders.
- OpenGL 4.4:ARB_buffer_storage gives better usage hints than glBufferData() and allows applications to pass additional information about the requested allocation to the implementation, which may use this information for further optimizations. Furthermore, this extension introduces the concept of persistent mapped buffers, which allow applications to retain mapped buffer pointers. To implement a buffer update workflow identical to Vulkan, OpenGL app developers should use persistent mapped buffers for all buffers that are expected to be used for read or write access on the CPU. Persistent mapped buffers allow multiple threads to write them without using OpenGL at all. This opens the possibility to do straightforward multi-threaded command buffer generation for MDI buffers.ARB_enhanced_layouts allows, among other things, the use of compile-time constant expressions in layout qualifiers and specifying explicit byte offsets within a uniform or shader storage block. These features are added on top of the explicit GLSL attribute locations functionality introduced in OpenGL 3.3, which allows us to explicitly specify our binding points. Vulkan uses hardcoded SPIR-V bindings as well and does not allow querying binding information at all.
- OpenGL 4.5:ARB_direct_state_access (DSA) provides a set of API functions to manipulate OpenGL objects, such as textures and buffers, directly rather than by means of the classic bind-to-edit approach. Using DSA allows one to modify an object state without affecting the global OpenGL state shared among all parts of the application. It also makes the API more Vulkan-like, enabling handle-based object access.
- OpenGL 4.6:GL_ARB_indirect_parameters allows us to store some parameters like draw count to MDI drawing commands inside buffers. This approach introduces even more possibilities to create...