| 1 |
// Copyright (C) 2016 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only |
| 3 |
|
| 4 |
/*! |
| 5 |
\example deferred-renderer-cpp |
| 6 |
\title Qt 3D: Deferred Renderer C++ Example |
| 7 |
\ingroup qt3d-examples-cpp |
| 8 |
\brief A C++ application that demonstrates rendering to an intermediate |
| 9 |
G-buffer. |
| 10 |
|
| 11 |
\e {Deferred Renderer} demonstrates using a two pass rendering method. |
| 12 |
First, all the meshes in the scene are drawn using the same shader that will |
| 13 |
output the following values for each fragment: world normal vector, color, |
| 14 |
depth, and world position vector. |
| 15 |
|
| 16 |
Each of these values will be stored in a texture, which together form what |
| 17 |
is called the G-buffer. Nothing is drawn onscreen during the first pass, but |
| 18 |
rather drawn into the G-buffer ready for later use. |
| 19 |
|
| 20 |
Once all the meshes have been drawn, the G-buffer is filled with all the |
| 21 |
meshes that can currently be seen by the camera. The second render pass is |
| 22 |
then used to render the scene to the back buffer with the final color |
| 23 |
shading by reading the values from the G-buffer textures and outputting a |
| 24 |
color onto a full screen quad. |
| 25 |
|
| 26 |
For more information, see \l{Deferred Renderer}. |
| 27 |
|
| 28 |
\include examples-run.qdocinc |
| 29 |
*/ |