diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2016-03-16 17:20:37 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-03-21 19:15:33 +0000 |
commit | acb32c488b9ad6802b3e8b0d4293ae15748fb65e (patch) | |
tree | 1c34613ce1c30e3b43f96d5f23c7662720e5af25 /src/plugins | |
parent | 002bb76d8c8c0c3188d9ce83888cde883627a629 (diff) |
QDepthMask transformed into QNoDepthMask
By default the absence of a QNoDepthMask node in a RenderStateSet implies
depth mask is enabled. Its presence, disables it.
Change-Id: Iaa22b6cee12ee76e64d66a00e97f8aadfa82398b
Task-number: QTBUG-51433
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/sceneparsers/gltf/gltfparser.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/sceneparsers/gltf/gltfparser.cpp b/src/plugins/sceneparsers/gltf/gltfparser.cpp index 71dc23b22..b1167579a 100644 --- a/src/plugins/sceneparsers/gltf/gltfparser.cpp +++ b/src/plugins/sceneparsers/gltf/gltfparser.cpp @@ -58,7 +58,7 @@ #include <Qt3DRender/QBlendStateSeparate> #include <Qt3DRender/QColorMask> #include <Qt3DRender/QCullFace> -#include <Qt3DRender/QDepthMask> +#include <Qt3DRender/QNoDepthMask> #include <Qt3DRender/QDepthTest> #include <Qt3DRender/QEffect> #include <Qt3DRender/QFrontFace> @@ -1512,8 +1512,11 @@ QRenderState* GLTFParser::buildState(const QString& functionName, const QJsonVal } if (functionName == QStringLiteral("depthMask")) { - QDepthMask *depthMask = new QDepthMask; - depthMask->setMask(values.at(0).toBool(true)); + if (!values.at(0).toBool(true)) { + QNoDepthMask *depthMask = new QNoDepthMask; + return depthMask; + } + return Q_NULLPTR; } if (functionName == QStringLiteral("depthRange")) { |