diff options
author | Leena Miettinen <riitta-leena.miettinen@qt.io> | 2016-06-08 09:57:19 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-06-08 18:33:38 +0000 |
commit | 8ac70dc21e1dce73c79ad915f6eafcd832ead09c (patch) | |
tree | 4dc952ccc7d3623e8e90350d3be70a92f7495259 | |
parent | bb418b9edac57519d4fb4e33ee3cb1447d0f0a12 (diff) |
Doc: Add docs for Multi Viewport QML example
- Add a brief (needed by Qt Creator)
- Add an image (needed by Qt Creator)
- Add a standard include file about building and running
examples
- Copy instructions from the rendering overview (as applicable)
Change-Id: I5342a7ad644acf97ecd247d47725d5978e5c6fb4
Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com>
-rw-r--r-- | examples/qt3d/multiviewport/doc/images/multiviewport-qml-example.png | bin | 0 -> 21447 bytes | |||
-rw-r--r-- | examples/qt3d/multiviewport/doc/src/multiviewport.qdoc | 41 |
2 files changed, 41 insertions, 0 deletions
diff --git a/examples/qt3d/multiviewport/doc/images/multiviewport-qml-example.png b/examples/qt3d/multiviewport/doc/images/multiviewport-qml-example.png Binary files differnew file mode 100644 index 000000000..75c13ffcd --- /dev/null +++ b/examples/qt3d/multiviewport/doc/images/multiviewport-qml-example.png diff --git a/examples/qt3d/multiviewport/doc/src/multiviewport.qdoc b/examples/qt3d/multiviewport/doc/src/multiviewport.qdoc index 42eb836b2..86212c4c6 100644 --- a/examples/qt3d/multiviewport/doc/src/multiviewport.qdoc +++ b/examples/qt3d/multiviewport/doc/src/multiviewport.qdoc @@ -29,4 +29,45 @@ \example multiviewport \title Qt 3D: Multi Viewport QML Example \ingroup qt3d-examples-qml + \brief A QML example that demonstrates rendering a Scenegraph from multiple + viewports. + + \image multiviewport-qml-example.png + + \e {Multi Viewport} renders a Scenegraph from the point of view of four + virtual cameras into the four quadrants of a window. This is a common + configuration for 3D CAD or modelling tools or could be adjusted to help + with rendering a rear-view mirror in a car racing game or a CCTV camera + display. + + For more information, see \l{A Multi Viewport FrameGraph}. + + \include examples-run.qdocinc + + \section1 Creating Multiple RenderViews + + Using the rules defined in \l {Framegraph Rules}, we construct five + RenderView objects from the FrameGraph: + + \quotefromfile multiviewport/QuadViewportFrameGraph.qml + \skipto Viewport { + \printuntil /^\}/ + + The \e {order is important}. If the ClearBuffers node were to be the last + instead of the first, this would result in a black screen for the simple + reason that everything would be cleared right after having been so carefully + rendered. For a similar reason, it could not be used as the root of the + FrameGraph as that would result in a call to clear the whole screen for each + of our viewports. + + Although the declaration order of the FrameGraph is important, Qt 3D is able + to process each RenderView in parallel as each RenderView is independent of + the others for the purposes of generating a set of RenderCommands to be + submitted whilst the RenderView's state is in effect. + + Qt 3D uses a task-based approach to parallelism which naturally scales up + with the number of available cores. The RenderCommands for the RenderViews + can be generated in parallel across many cores, and as long as we take care + to submit the RenderViews in the correct order on the dedicated OpenGL + submission thread, the resulting scene will be rendered correctly. */ |