Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qssgrenderlayer.cpp
Go to the documentation of this file.
1// Copyright (C) 2008-2012 NVIDIA Corporation.
2// Copyright (C) 2019 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
5
6#include <QtQuick3DRuntimeRender/private/qssgrenderlayer_p.h>
7#include <QtQuick3DRuntimeRender/private/qssgrendereffect_p.h>
8#include <QtQuick3DRuntimeRender/private/qssglayerrenderdata_p.h>
9
11
14 , firstEffect(nullptr)
15 , antialiasingMode(QSSGRenderLayer::AAMode::NoAA)
16 , antialiasingQuality(QSSGRenderLayer::AAQuality::High)
18 , temporalAAEnabled(false)
19 , temporalAAStrength(0.3f)
20 , ssaaEnabled(false)
21 , ssaaMultiplier(1.5f)
22 , specularAAEnabled(false)
23 , tonemapMode(TonemapMode::Linear)
24{
25 flags = { FlagT(LocalState::Active) | FlagT(GlobalState::Active) }; // The layer node is alway active and not dirty.
26}
27
34
36{
37 if (angles != lightProbeSettings.probeOrientationAngles) {
38 lightProbeSettings.probeOrientationAngles = angles;
39 lightProbeSettings.probeOrientation = QQuaternion::fromEulerAngles(lightProbeSettings.probeOrientationAngles).toRotationMatrix();
40 }
41}
42
44{
45 // Effects need to be rendered in reverse order as described in the file.
46 inEffect.m_nextEffect = firstEffect;
47 firstEffect = &inEffect;
48}
49
51{
52 for (auto currentEffect = firstEffect; currentEffect != nullptr; currentEffect = currentEffect->m_nextEffect) {
53 if (currentEffect == inEffect)
54 return true;
55 }
56 return false;
57}
58
60{
61 // We create a dummy node to represent the imported scene tree, as we
62 // do absolutely not want to change the node links in that tree!
63 if (importSceneNode == nullptr) {
64 importSceneNode = new QSSGRenderNode(QSSGRenderGraphObject::Type::ImportScene);
65 // Now we can add the dummy node to the layers child list
67 } else {
68 importSceneNode->children.clear(); // Clear the list (or the list will modify the rootNode)
69 }
70
71 // The imported scene root node is now a child of the dummy node
72 auto &importChildren = importSceneNode->children;
73 Q_ASSERT(importChildren.isEmpty());
74 // We don't want the list to modify our node, so we set the tail and head manually.
75 importChildren.m_head = importChildren.m_tail = &rootNode;
76}
77
85
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
Combined button and popup list for selecting options.
GLbitfield flags
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
QObject::connect nullptr
void clear()
clear will set the head and tail of the list to null.
QSSGRenderEffect * m_nextEffect
void addEffect(QSSGRenderEffect &inEffect)
void setProbeOrientation(const QVector3D &angles)
QSSGRenderNode * importSceneNode
QSSGLayerRenderData * renderData
struct QSSGRenderLayer::LightProbeSettings lightProbeSettings
void removeImportScene(QSSGRenderNode &rootNode)
bool hasEffect(QSSGRenderEffect *inEffect) const
void setImportScene(QSSGRenderNode &rootNode)
QSSGRenderEffect * firstEffect
std::underlying_type_t< DirtyFlag > FlagT
Definition moc.h:23