29QSSGRenderLayer::QSSGRenderLayer()
30 : QSSGRenderNode(QSSGRenderNode::Type::Layer)
31 , firstEffect(
nullptr)
32 , antialiasingMode(QSSGRenderLayer::AAMode::NoAA)
33 , antialiasingQuality(QSSGRenderLayer::AAQuality::High)
34 , background(QSSGRenderLayer::Background::Transparent)
35 , temporalAAStrength(0.3f)
36 , ssaaMultiplier(1.5f)
37 , specularAAEnabled(
false)
38 , oitMethod(OITMethod::None)
39 , oitMethodDirty(
false)
40 , tonemapMode(TonemapMode::Linear)
42 flags = { FlagT(LocalState::Active) | FlagT(GlobalState::Active) };
57void QSSGRenderLayer::setProbeOrientation(
const QVector3D &angles)
59 if (angles != lightProbeSettings.probeOrientationAngles) {
60 lightProbeSettings.probeOrientationAngles = angles;
61 lightProbeSettings.probeOrientation = QQuaternion::fromEulerAngles(lightProbeSettings.probeOrientationAngles).toRotationMatrix();
81void QSSGRenderLayer::setImportScene(QSSGRenderNode &importedNode)
83 if (importedNode.parent !=
nullptr && !QSSGRenderGraphObjectUtils::isSceneRoot(importedNode.parent->type)) {
84 qWarning(
"The root of the imported scene node is already part of another scene graph.\n"
85 "Importing a sub-scene is unsupported and may not work as expected!");
90 if (importSceneNode ==
nullptr) {
91 importSceneNode =
new QSSGRenderNode(QSSGRenderGraphObject::Type::ImportScene);
94 children.push_front(*importSceneNode);
96 importSceneNode->children.clear();
100 auto &importChildren = importSceneNode->children;
101 Q_ASSERT(importChildren.isEmpty());
103 importChildren.m_head = importChildren.m_tail = &importedNode;
106 importedNode.setState(QSSGRenderNode::LocalState::Imported);
110 const bool warnAboutCrossWindowSharing = importedNode.rootNodeRef && QSSGRenderRoot::get(importedNode.rootNodeRef) != rootNode;
111 if (warnAboutCrossWindowSharing) {
112 qWarning(
"Sharing nodes across different windows is not supported and may lead to unexpected behavior!");
116 importSceneNode->markDirty(QSSGRenderNode::DirtyFlag::StickyDirty);