Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > c936229ef0138f42857f36beadbeda30 > files > 929

qt3d5-doc-5.12.2-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qt3drender-protips.qdoc -->
  <title>Qt 3D Render Pro Tips | Qt 3D 5.12.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qt3d-index.html">Qt 3D</a></td><td >Qt 3D Render Pro Tips</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qt3d-index.html">Qt 5.12.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level2"><a href="#technique-selection">Technique Selection</a></li>
<li class="level2"><a href="#order-matters">Order Matters</a></li>
<li class="level2"><a href="#blending">Blending</a></li>
<li class="level2"><a href="#useful-tools">Useful Tools</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Qt 3D Render Pro Tips</h1>
<span class="subtitle"></span>
<!-- $$$qt3drender-protips.html-description -->
<div class="descr"> <a name="details"></a>
<p>To render even the simplest shapes, Qt 3D needs to perform various operations through several stages. If anything goes wrong at any of these stages you may end up, in the best cases with something different than what you expected, in the worst cases with a black screen.</p>
<ul>
<li><a href="qt3drender-protips.html#technique-selection">Technique Selection</a></li>
<li><a href="qt3drender-protips.html#order-matters">Order Matters</a></li>
<li><a href="qt3drender-protips.html#blending">Blending</a></li>
<li><a href="qt3drender-protips.html#useful-tools">Useful Tools</a></li>
</ul>
<a name="technique-selection"></a>
<h3 >Technique Selection</h3>
<p>Qt 3D provides a technique selection mechanism allowing you to provide shaders for various rendering APIs and versions of these APIs.</p>
<p>In order to avoid unnecessary waste of your time, you should make sure that your technique's API filter data is correct for the platform you are targeting.</p>
<a name="order-matters"></a>
<h3 >Order Matters</h3>
<p>The order of the draw calls performed by the renderer is not necessarily the same as the order of the entities in the scene.</p>
<p>The renderer tries to optimize calls that are sent to the graphics API. It orders draw calls based on the material/shader being used, the render states that are defined for a given material, their depth, the parameters shared in common between two materials, etc.</p>
<p>If your rendering depends on a specific draw order you should then have a few options:</p>
<ul>
<li>Filtering with a <a href="qt3drender-qlayer.html">Qt3DRender::QLayer</a> component and <a href="qt3drender-qlayerfilter.html">Qt3DRender::QLayerFilter</a> in the FrameGraph</li>
<li><a href="qml-qt3d-render-renderpass.html">RenderPass</a> or Technique filtering using <a href="qt3drender-qrenderpassfilter.html">Qt3DRender::QRenderPassFilter</a> or <a href="qt3drender-qtechniquefilter.html">Qt3DRender::QTechniqueFilter</a> in the FrameGraph</li>
</ul>
<a name="blending"></a>
<h3 >Blending</h3>
<p>Mastering blending with proper arguments and functions is an art in itself. Therefore obtaining the proper visual result is often hit and miss.</p>
<p><a href="http://www.andersriggelsen.dk/glblendfunc.php">Anders Riggelsen's online visualizer</a> may help you find out which arguments and functions work for you.</p>
<a name="blending-with-scene3d"></a>
<h4 >Blending with Scene3D</h4>
<p>When rendering a Qt 3D scene through a Qt Quick scene with the <a href="qml-qtquick-scene3d-scene3d.html">Scene3D</a> element you should be aware that you might have to adjust the blending arguments of your render state to obtain a sensible rendering. This is because of the way Qt 3D first renders a scene into an offscreen texture which is then blended in with the rest of the Qt Quick scene.</p>
<p>Sensible values are often <a href="qt3drender-qblendequationarguments.html#Blending-enum">Qt3DRender::QBlendEquationArguments::Zero</a> for the source alpha and <a href="qt3drender-qblendequationarguments.html#Blending-enum">Qt3DRender::QBlendEquationArguments::One</a> for the destination alpha.</p>
<a name="useful-tools"></a>
<h3 >Useful Tools</h3>
<p>Given the rather limited of troubleshooting given by Qt 3D in its first versions it sometimes helps to have tools to capture OpenGL draw calls and get more clues about what's happening</p>
<ul>
<li><a href="https://github.com/apitrace/apitrace">apitrace</a></li>
<li><a href="https://github.com/ValveSoftware/vogl">vogl</a></li>
</ul>
<p>These tools allow you to gather traces of all the OpenGL calls being made by a Qt 3D application. Having a look at a generated trace file may help you verify that draw calls are being made, textures correctly uploaded, uniforms set with proper values, ..&#x2e;</p>
<p>There are plans for Qt 3D tooling in later releases.</p>
</div>
<!-- @@@qt3drender-protips.html -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>