Fix tray visibility and message reception issues
Some checks failed
build / build-win64 (push) Waiting to run
build / build-macos (push) Waiting to run
build / build-pip (push) Failing after 16s

- Disable sound initialization to prevent hanging
- Add missing import re in utils.py
- Fix settings loading for QSettings
- Update file paths to use PROJECT_ROOT
- Revert to working API paths and listener from commit efdc63e
This commit is contained in:
kdusek
2025-12-07 22:39:07 +01:00
parent 7b695d7b7f
commit 5138303016
4060 changed files with 579123 additions and 23 deletions

View File

@@ -0,0 +1,93 @@
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick
import QtQuick3D
Node {
id: axisGrid_obj
property alias gridColor: gridMaterial.diffuseColor
property alias gridOpacity: gridMaterial.opacity
property alias enableXZGrid: gridXZ.visible
property alias enableXYGrid: gridXY.visible
property alias enableYZGrid: gridYZ.visible
property bool enableAxisLines: true
// Axis Lines
Model {
id: xAxis
source: "#Cube"
position: Qt.vector3d(5000, 0, 0)
scale: Qt.vector3d(100, .05, .05)
visible: axisGrid_obj.enableAxisLines
materials: DefaultMaterial {
lighting: DefaultMaterial.NoLighting
diffuseColor: "red"
}
}
Model {
id: yAxis
source: "#Cube"
position: Qt.vector3d(0, 5000, 0)
scale: Qt.vector3d(0.05, 100, 0.05)
visible: axisGrid_obj.enableAxisLines
materials: DefaultMaterial {
lighting: DefaultMaterial.NoLighting
diffuseColor: "green"
}
}
Model {
id: zAxis
source: "#Cube"
position: Qt.vector3d(0, 0, 5000)
scale: Qt.vector3d(0.05, 0.05, 100)
visible: axisGrid_obj.enableAxisLines
materials: DefaultMaterial {
lighting: DefaultMaterial.NoLighting
diffuseColor: "blue"
}
}
// Grid Lines
DefaultMaterial {
id: gridMaterial
lighting: DefaultMaterial.NoLighting
opacity: 0.5
diffuseColor: Qt.rgba(0.8, 0.8, 0.8, 1)
}
Model {
id: gridXZ
source: "meshes/axisGrid.mesh"
scale: Qt.vector3d(100, 100, 100)
materials: [
gridMaterial
]
}
Model {
id: gridXY
visible: false
source: "meshes/axisGrid.mesh"
scale: Qt.vector3d(100, 100, 100)
eulerRotation: Qt.vector3d(90, 0, 0)
materials: [
gridMaterial
]
}
Model {
id: gridYZ
visible: false
source: "meshes/axisGrid.mesh"
scale: Qt.vector3d(100, 100, 100)
eulerRotation: Qt.vector3d(0, 0, 90)
materials: [
gridMaterial
]
}
}

View File

@@ -0,0 +1,549 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick3D
import QtQuick3D.Helpers.impl
Pane {
id: root
property var source: null
property bool resourceDetailsVisible: false
opacity: 0.9
ColumnLayout {
id: layout
RowLayout {
Label {
Layout.fillWidth: true
text: root.source.renderStats.fps + " FPS"
font.pointSize: 14
}
Label {
text: "Details"
}
CheckBox {
checked: root.resourceDetailsVisible
onCheckedChanged: {
resourceDetailsVisible = checked;
}
}
}
component TimeLabel : RowLayout {
id: timeLabel
property alias text: label.text
property real value: 0.0
Label {
id: label
Layout.fillWidth: true
text: "Frame: "
}
Label {
text: timeLabel.value.toFixed(3) + "ms"
}
}
TimeLabel {
text: "Frame: "
value: root.source.renderStats.frameTime
}
TimeLabel {
text: " Sync: "
value: root.source.renderStats.syncTime
}
TimeLabel {
text: " Prep: "
value: root.source.renderStats.renderPrepareTime
}
TimeLabel {
text: " Render: "
value: root.source.renderStats.renderTime
}
TimeLabel {
text: "Max: "
value: root.source.renderStats.maxFrameTime
}
TimeLabel {
text: "GPU: "
value: root.source.renderStats.lastCompletedGpuTime
visible: root.source.renderStats.lastCompletedGpuTime > 0
}
Page {
Layout.fillWidth: true
Layout.minimumWidth: 530
visible: root.resourceDetailsVisible
header: TabBar {
id: tabBar
TabButton {
text: "Summary"
}
TabButton {
text: "Passes"
}
TabButton {
text: "Textures"
}
TabButton {
text: "Meshes"
}
TabButton {
text: "Tools"
}
TabButton {
text: "Shadows"
}
}
StackLayout {
anchors.fill: parent
anchors.margins: 10
currentIndex: tabBar.currentIndex
Pane {
id: summaryPane
ColumnLayout {
Label {
text: "Graphics API: " + root.source.renderStats.graphicsApiName
visible: root.resourceDetailsVisible
}
Label {
text: root.source.renderStats.renderPassCount + " render passes"
visible: root.resourceDetailsVisible
}
Label {
text: root.source.renderStats.drawCallCount + " draw calls"
visible: root.resourceDetailsVisible
}
Label {
text: root.source.renderStats.drawVertexCount + " vertices"
visible: root.resourceDetailsVisible
}
Label {
text: "Image assets: " + (root.source.renderStats.imageDataSize / 1024).toFixed(2) + " KB"
visible: root.resourceDetailsVisible
}
Label {
text: "Mesh assets: " + (root.source.renderStats.meshDataSize / 1024).toFixed(2) + " KB"
visible: root.resourceDetailsVisible
}
Label {
text: "Pipelines: " + root.source.renderStats.pipelineCount
visible: root.resourceDetailsVisible
}
Label {
text: "Material build time: " + root.source.renderStats.materialGenerationTime + " ms"
visible: root.resourceDetailsVisible
}
Label {
text: "Effect build time: " + root.source.renderStats.effectGenerationTime + " ms"
visible: root.resourceDetailsVisible
}
Label {
text: "Pipeline build time: " + root.source.renderStats.pipelineCreationTime + " ms"
visible: root.resourceDetailsVisible
}
Label {
text: root.source.renderStats.vmemAllocCount + " vmem allocs with " + root.source.renderStats.vmemUsedBytes + " bytes"
visible: root.resourceDetailsVisible && root.source.renderStats.vmemAllocCount > 0
}
}
}
Pane {
id: passesPane
RenderStatsPassesModel {
id: passesModel
passData: root.source.renderStats.renderPassDetails
}
ColumnLayout {
anchors.fill: parent
spacing: 0
HorizontalHeaderView {
syncView: passesTableView
resizableColumns: false // otherwise QTBUG-111013 happens
boundsBehavior: Flickable.StopAtBounds
flickableDirection: Flickable.VerticalFlick
}
ListModel {
id: passesHeaderModel
ListElement {
columnWidth: 300 // name
}
ListElement {
columnWidth: 80 // size
}
ListElement {
columnWidth: 60 // vertices
}
ListElement {
columnWidth: 60 // draw calls
}
}
Item {
Layout.fillHeight: true
Layout.fillWidth: true
TableView {
id: passesTableView
anchors.fill: parent
// name, size, vertices, draw calls
property var columnFactors: [58, 14, 12, 12]; // == 96, leave space for the scrollbar
columnWidthProvider: function (column) {
return passesPane.width * (columnFactors[column] / 100.0);
}
boundsBehavior: Flickable.StopAtBounds
flickableDirection: Flickable.VerticalFlick
ScrollBar.vertical: ScrollBar {
parent: passesTableView.parent
anchors.top: passesTableView.top
anchors.bottom: passesTableView.bottom
anchors.left: passesTableView.right
}
clip: true
model: passesModel
columnSpacing: 1
rowSpacing: 1
implicitWidth: parent.width + columnSpacing
implicitHeight: parent.height + rowSpacing
delegate: CustomTableItemDelegate {
required property string display
text: display
color: TableView.view.palette.base
textColor: TableView.view.palette.text
}
}
}
}
}
Pane {
id: texturesPane
RenderStatsTexturesModel {
id: texturesModel
textureData: root.source.renderStats.textureDetails
}
ColumnLayout {
anchors.fill: parent
spacing: 0
HorizontalHeaderView {
syncView: texturesTableView
resizableColumns: false // otherwise QTBUG-111013 happens
boundsBehavior: Flickable.StopAtBounds
flickableDirection: Flickable.VerticalFlick
}
Item {
Layout.fillHeight: true
Layout.fillWidth: true
TableView {
id: texturesTableView
anchors.fill: parent
// name, size, format, miplevels, flags
property var columnFactors: [48, 12, 12, 12, 12]; // == 96, leave space for the scrollbar
columnWidthProvider: function (column) {
return texturesPane.width * (columnFactors[column] / 100.0);
}
boundsBehavior: Flickable.StopAtBounds
flickableDirection: Flickable.VerticalFlick
ScrollBar.vertical: ScrollBar {
parent: texturesTableView.parent
anchors.top: texturesTableView.top
anchors.bottom: texturesTableView.bottom
anchors.left: texturesTableView.right
}
ScrollBar.horizontal: ScrollBar { }
clip: true
model: texturesModel
columnSpacing: 1
rowSpacing: 1
implicitWidth: parent.width + columnSpacing
implicitHeight: parent.height + rowSpacing
delegate: CustomTableItemDelegate {
required property string display
text: display
color: TableView.view.palette.base
textColor: TableView.view.palette.text
}
}
}
}
}
Pane {
id: meshesPane
RenderStatsMeshesModel {
id: meshesModel
meshData: root.source.renderStats.meshDetails
}
ColumnLayout {
anchors.fill: parent
spacing: 0
HorizontalHeaderView {
syncView: meshesTableView
resizableColumns: false // otherwise QTBUG-111013 happens
boundsBehavior: Flickable.StopAtBounds
flickableDirection: Flickable.VerticalFlick
}
Item {
Layout.fillHeight: true
Layout.fillWidth: true
TableView {
id: meshesTableView
anchors.fill: parent
// name, submeshes, vertices, vbufsize, ibufsize
property var columnFactors: [48, 12, 12, 12, 12]; // == 96, leave space for the scrollbar
columnWidthProvider: function (column) {
return meshesPane.width * (columnFactors[column] / 100.0);
}
boundsBehavior: Flickable.StopAtBounds
flickableDirection: Flickable.VerticalFlick
ScrollBar.vertical: ScrollBar {
parent: meshesTableView.parent
anchors.top: meshesTableView.top
anchors.bottom: meshesTableView.bottom
anchors.left: meshesTableView.right
}
clip: true
model: meshesModel
columnSpacing: 1
rowSpacing: 1
implicitWidth: parent.width + columnSpacing
implicitHeight: parent.height + rowSpacing
delegate: CustomTableItemDelegate {
required property string display
text: display
color: TableView.view.palette.base
textColor: TableView.view.palette.text
}
}
}
}
}
Pane {
id: visualizePane
ColumnLayout {
id: visCtrCol
width: parent.width
CheckBox {
text: "Wireframe mode"
onCheckedChanged: root.source.environment.debugSettings.wireframeEnabled = checked
}
RowLayout {
Label {
text: "Material override"
}
ComboBox {
id: materialOverrideComboBox
textRole: "text"
valueRole: "value"
implicitContentWidthPolicy: ComboBox.WidestText
onActivated: root.source.environment.debugSettings.materialOverride = currentValue
Component.onCompleted: materialOverrideComboBox.currentIndex = materialOverrideComboBox.indexOfValue(root.source.environment.debugSettings.materialOverride)
model: [
{ value: DebugSettings.None, text: "None"},
{ value: DebugSettings.BaseColor, text: "Base Color"},
{ value: DebugSettings.Roughness, text: "Roughness"},
{ value: DebugSettings.Metalness, text: "Metalness"},
{ value: DebugSettings.Diffuse, text: "Diffuse"},
{ value: DebugSettings.Specular, text: "Specular"},
{ value: DebugSettings.ShadowOcclusion, text: "Shadow Occlusion"},
{ value: DebugSettings.Emission, text: "Emission"},
{ value: DebugSettings.AmbientOcclusion, text: "Ambient Occlusion"},
{ value: DebugSettings.Normals, text: "Normals"},
{ value: DebugSettings.Tangents, text: "Tangents"},
{ value: DebugSettings.Binormals, text: "Binormals"},
{ value: DebugSettings.F0, text: "F0"}
]
}
}
RowLayout {
spacing: 20
Button {
text: "Release cached resources"
onClicked: root.source.renderStats.releaseCachedResources()
}
Button {
text: "Bake lightmap"
onClicked: root.source.bakeLightmap()
}
Button {
text: "Denoise lightmap"
onClicked: root.source.denoiseLightmap()
}
}
RowLayout {
Label {
text: "Render mode override"
}
ComboBox {
id: renderModeOverrideComboBox
textRole: "text"
valueRole: "value"
implicitContentWidthPolicy: ComboBox.WidestText
onActivated: root.source.renderMode = currentValue
Component.onCompleted: renderModeOverrideComboBox.currentIndex = renderModeOverrideComboBox.indexOfValue(root.source.renderMode)
model: [
{ value: View3D.Offscreen, text: "Offscreen" },
{ value: View3D.Underlay, text: "Underlay" },
{ value: View3D.Overlay, text: "Overlay" },
{ value: View3D.Inline, text: "Inline" }
]
}
}
Label {
text: "View3D logical size is " + root.source.width + "x" + root.source.height
}
Label {
text: "Backing texture pixel size is " + root.source.effectiveTextureSize.width + "x" + root.source.effectiveTextureSize.height
visible: root.source.renderMode === View3D.Offscreen
}
RowLayout {
CheckBox {
id: explicitTextureSizeCheckBox
visible: root.source.renderMode === View3D.Offscreen
text: "Explicit backing texture size"
property real aspectRatio: root.source.width / root.source.height
onCheckedChanged: updateSize()
function updateSize() {
if (!explicitTextureSizeCheckBox.checked) {
root.source.explicitTextureWidth = 0;
root.source.explicitTextureHeight = 0;
return;
}
var newWidth = explicitWidthSlider.value;
var newHeight = explicitHeightSlider.value;
if (keepAspectRatioCheckBox.checked) {
var aspectRatio = explicitTextureSizeCheckBox.aspectRatio;
if (newHeight * aspectRatio <= newWidth)
newWidth = newHeight * aspectRatio;
else
newHeight = newWidth * (1.0 / aspectRatio);
}
root.source.explicitTextureWidth = newWidth;
root.source.explicitTextureHeight = newHeight;
}
Connections {
target: root.source
function onWidthChanged() { explicitTextureSizeCheckBox.updateSize() }
function onHeightChanged() { explicitTextureSizeCheckBox.updateSize() }
}
}
CheckBox {
id: keepAspectRatioCheckBox
visible: root.source.renderMode === View3D.Offscreen && explicitTextureSizeCheckBox.checked
text: "Keep aspect ratio (" + explicitTextureSizeCheckBox.aspectRatio.toFixed(2) + ")"
checked: false
onCheckedChanged: explicitTextureSizeCheckBox.updateSize()
}
}
RowLayout {
visible: root.source.renderMode === View3D.Offscreen && explicitTextureSizeCheckBox.checked
Label {
text: "Width: " + explicitWidthSlider.value.toFixed(0) + " px"
}
Slider {
id: explicitWidthSlider
from: 16
to: 4096
value: 1280
onValueChanged: explicitTextureSizeCheckBox.updateSize()
Layout.maximumWidth: 120
}
Label {
text: "Height: " + explicitHeightSlider.value.toFixed(0) + " px"
}
Slider {
id: explicitHeightSlider
from: 16
to: 4096
value: 720
onValueChanged: explicitTextureSizeCheckBox.updateSize()
Layout.maximumWidth: 120
}
}
}
}
Pane {
id: shadowsPane
ColumnLayout {
width: parent.width
CheckBox {
text: "Draw directional light shadow bounding boxes"
checked: root.source.environment.debugSettings.drawDirectionalLightShadowBoxes
onCheckedChanged: root.source.environment.debugSettings.drawDirectionalLightShadowBoxes = checked
}
CheckBox {
text: "Draw point light shadow bounding boxes"
checked: root.source.environment.debugSettings.drawPointLightShadowBoxes
onCheckedChanged: root.source.environment.debugSettings.drawPointLightShadowBoxes = checked
}
CheckBox {
text: "Draw shadow casting bounding box"
checked: root.source.environment.debugSettings.drawShadowCastingBounds
onCheckedChanged: root.source.environment.debugSettings.drawShadowCastingBounds = checked
}
CheckBox {
text: "Draw shadow receiving bounding box"
checked: root.source.environment.debugSettings.drawShadowReceivingBounds
onCheckedChanged: root.source.environment.debugSettings.drawShadowReceivingBounds = checked
}
CheckBox {
text: "Draw cascades"
checked: root.source.environment.debugSettings.drawCascades
onCheckedChanged: root.source.environment.debugSettings.drawCascades = checked
}
CheckBox {
text: "Draw scene cascade intersection"
checked: root.source.environment.debugSettings.drawSceneCascadeIntersection
onCheckedChanged: root.source.environment.debugSettings.drawSceneCascadeIntersection = checked
}
CheckBox {
text: "Disable Shadow Camera Update"
checked: root.source.environment.debugSettings.disableShadowCameraUpdate
onCheckedChanged: root.source.environment.debugSettings.disableShadowCameraUpdate = checked
}
}
}
}
}
}
component CustomTableItemDelegate : Rectangle {
property alias text: textLabel.text
property alias textColor: textLabel.color
implicitWidth: 100
implicitHeight: textLabel.implicitHeight + 4
color: palette.base
Label {
id: textLabel
anchors.centerIn: parent
color: palette.text
}
}
function syncVisible() {
if (source) {
source.renderStats.extendedDataCollectionEnabled = visible && resourceDetailsVisible;
if (source.renderStats.extendedDataCollectionEnabled)
source.update();
}
}
Component.onCompleted: syncVisible()
onSourceChanged: syncVisible()
onVisibleChanged: syncVisible()
onResourceDetailsVisibleChanged: syncVisible()
}

View File

@@ -0,0 +1,100 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick
import QtQuick3D.Helpers.impl
SceneEffectEnvironment {
id: sceneEnvironment
// Depth of Field Effect
property alias depthOfFieldEnabled: dofBlurEffect.enabled
property alias depthOfFieldFocusDistance: dofBlurEffect.focusDistance
property alias depthOfFieldFocusRange: dofBlurEffect.focusRange
property alias depthOfFieldBlurAmount: dofBlurEffect.blurAmount
// Tonemapper
property alias exposure: sceneEffect.exposure
property alias whitePoint: sceneEffect.white
property alias ditheringEnabled: sceneEffect.ditheringEnabled
property alias sharpnessAmount: sceneEffect.sharpnessAmount
// FXAA
property alias fxaaEnabled: sceneEffect.applyFXAA
// Adjustments
property alias colorAdjustmentsEnabled: sceneEffect.colorAdjustmentsEnabled
property alias adjustmentBrightness: sceneEffect.adjustmentBrightness
property alias adjustmentContrast: sceneEffect.adjustmentContrast
property alias adjustmentSaturation: sceneEffect.adjustmentSaturation
// Color Grading Effect
property alias lutEnabled: sceneEffect.enableLut
property alias lutSize: sceneEffect.lutSize
property alias lutFilterAlpha: sceneEffect.lutFilterAlpha
property alias lutTexture: sceneEffect.lutTextureAlias
// Glow Effect
enum GlowBlendMode {
Additive,
Screen,
SoftLight, // Default
Replace
}
enum GlowLevel {
One = 0x1,
Two = 0x2,
Three = 0x4,
Four = 0x8,
Five = 0x10,
Six = 0x20,
Seven = 0x40
}
property alias glowEnabled: sceneEffect.isGlowEnabled
property alias glowQualityHigh: sceneEffect.glowQualityHigh
property alias glowUseBicubicUpscale: sceneEffect.glowUseBicubicUpscale
property alias glowStrength: sceneEffect.glowStrength
property alias glowIntensity: sceneEffect.glowIntensity
property alias glowBloom: sceneEffect.glowBloom
property alias glowBlendMode: sceneEffect.glowBlendMode
property alias glowHDRMaximumValue: sceneEffect.glowHDRMaximumValue
property alias glowHDRScale: sceneEffect.glowHDRScale
property alias glowHDRMinimumValue: sceneEffect.glowHDRMinimumValue
property alias glowLevel: sceneEffect.glowLevel
// Vignette
property alias vignetteEnabled: sceneEffect.vignetteEnabled
property alias vignetteStrength: sceneEffect.vignetteStrength
property alias vignetteColor: sceneEffect.vignetteColor
property alias vignetteRadius: sceneEffect.vignetteRadius
// Lens Flare
property alias lensFlareEnabled: sceneEffect.lensFlareEnabled
property alias lensFlareBloomScale: sceneEffect.lensFlareBloomScale
property alias lensFlareBloomBias: sceneEffect.lensFlareBloomBias
property alias lensFlareGhostDispersal: sceneEffect.lensFlareGhostDispersal
property alias lensFlareGhostCount: sceneEffect.lensFlareGhostCount
property alias lensFlareHaloWidth: sceneEffect.lensFlareHaloWidth
property alias lensFlareStretchToAspect: sceneEffect.lensFlareStretchToAspect
property alias lensFlareDistortion: sceneEffect.lensFlareDistortion
property alias lensFlareBlurAmount: sceneEffect.lensFlareBlurAmount
property alias lensFlareApplyDirtTexture: sceneEffect.lensFlareApplyDirtTexture
property alias lensFlareApplyStarburstTexture: sceneEffect.lensFlareApplyStarburstTexture
property alias lensFlareCameraDirection: sceneEffect.lensFlareCameraDirection
property alias lensFlareLensColorTexture: sceneEffect.lensColorTextureAlias
property alias lensFlareLensDirtTexture: sceneEffect.lensDirtTextureAlias
property alias lensFlareLensStarburstTexture: sceneEffect.starburstTextureAlias
DepthOfFieldBlur {
id: dofBlurEffect
environment: sceneEnvironment
}
SceneEffect {
id: sceneEffect
environment: sceneEnvironment
tonemapMode: sceneEnvironment.tonemapMode
}
}

View File

@@ -0,0 +1,80 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick
import QtQuick3D
Node {
id: root
required property Camera camera
required property var distances
property real fadeDistance: 0.0
onChildrenChanged: {
// Add distance threshold values to instanced children
var distIndex = 0; // Handle distance index separately to allow non-node children
for (var i = 0; i < children.length; i++) {
if (!(children[i] instanceof Model) || !children[i].instancing)
continue;
if (distIndex - 1 >= 0)
children[i].instancingLodMin = distances[distIndex - 1];
if (distances.length > distIndex)
children[i].instancingLodMax = distances[distIndex];
distIndex++;
}
}
function update() {
var distIndex = 0; // Handle distance index separately to allow non-node children
for (var i = 0; i < root.children.length; i++) {
var node = root.children[i];
if (!(node instanceof Node))
continue;
if (node instanceof Model && node.instancing)
continue;
if (distIndex > distances.length)
break;
// Hide all nodes by default
node.visible = false;
var minThreshold = 0;
var maxThreshold = -1;
if (distIndex - 1 >= 0)
minThreshold = distances[distIndex - 1] - fadeDistance;
if (distances.length > distIndex)
maxThreshold = distances[distIndex] + fadeDistance;
// Show nodes that are inside the minimum and maximum distance thresholds
var distance = node.scenePosition.minus(camera.scenePosition).length();
if (distance >= minThreshold && (maxThreshold < 0 || distance < maxThreshold))
node.visible = true;
// Fade models by adjusting opacity if fadeDistance is set
if (children[i] instanceof Model && fadeDistance > 0) {
var fadeAlpha = -(minThreshold - distance) / fadeDistance;
if (fadeAlpha > 1.0 && maxThreshold > 0)
fadeAlpha = (maxThreshold - distance) / fadeDistance;
children[i].opacity = fadeAlpha;
}
distIndex++;
}
}
Component.onCompleted: {
root.update()
}
Connections {
target: root.camera
function onScenePositionChanged() {
root.update()
}
}
}

View File

@@ -0,0 +1,231 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick
import QtQuick3D
Item {
id: root
required property Node origin
required property Camera camera
property real xSpeed: 0.1
property real ySpeed: 0.1
property bool xInvert: false
property bool yInvert: true
property bool mouseEnabled: true
property bool panEnabled: true
property bool automaticClipping: true
property alias acceptedButtons: dragHandler.acceptedButtons
readonly property bool inputsNeedProcessing: status.useMouse || status.isPanning
implicitWidth: parent.width
implicitHeight: parent.height
Connections {
enabled: root.automaticClipping
target: root.camera
function onZChanged() {
// Adjust near/far values based on distance
let distance = root.camera.z
if (distance < 1) {
root.camera.clipNear = 0.01
root.camera.clipFar = 100
if (root.camera.z === 0) {
console.warn("camera z set to 0, setting it to near clip")
root.camera.z = root.camera.clipNear
}
} else if (distance < 100) {
root.camera.clipNear = 0.1
root.camera.clipFar = 1000
} else {
root.camera.clipNear = 1
root.camera.clipFar = 10000
}
}
}
DragHandler {
id: dragHandler
target: null
enabled: root.mouseEnabled
acceptedModifiers: Qt.NoModifier
onCentroidChanged: {
root.mouseMoved(Qt.vector2d(centroid.position.x, centroid.position.y), false);
}
onActiveChanged: {
if (active)
root.mousePressed(Qt.vector2d(centroid.position.x, centroid.position.y));
else
root.mouseReleased(Qt.vector2d(centroid.position.x, centroid.position.y));
}
}
DragHandler {
id: ctrlDragHandler
target: null
enabled: root.mouseEnabled && root.panEnabled
acceptedButtons: root.acceptedButtons
acceptedModifiers: Qt.ControlModifier
onCentroidChanged: {
root.panEvent(Qt.vector2d(centroid.position.x, centroid.position.y));
}
onActiveChanged: {
if (active)
root.startPan(Qt.vector2d(centroid.position.x, centroid.position.y));
else
root.endPan();
}
}
PinchHandler {
id: pinchHandler
target: null
enabled: root.mouseEnabled
onTranslationChanged: (delta) => {
if (!root.panEnabled)
return;
delta.x = -(delta.x / root.width) * root.camera.z;
delta.y = (delta.y / root.height) * root.camera.z;
let movement = Qt.vector3d(0, 0, 0)
// X Movement
let xDirection = root.origin.right
movement = movement.plus(Qt.vector3d(xDirection.x * delta.x,
xDirection.y * delta.x,
xDirection.z * delta.x));
// Y Movement
let yDirection = root.origin.up
movement = movement.plus(Qt.vector3d(yDirection.x * delta.y,
yDirection.y * delta.y,
yDirection.z * delta.y));
root.origin.position = root.origin.position.plus(movement)
}
onScaleChanged: (delta) => {
root.camera.z = root.camera.z * (1 / delta)
}
}
TapHandler {
acceptedButtons: root.acceptedButtons
onTapped: root.forceActiveFocus() // qmllint disable signal-handler-parameters
}
WheelHandler {
id: wheelHandler
orientation: Qt.Vertical
target: null
enabled: root.mouseEnabled
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
onWheel: event => {
let delta = -event.angleDelta.y * 0.01;
root.camera.z += root.camera.z * 0.1 * delta
}
}
function mousePressed(newPos) {
root.forceActiveFocus()
status.currentPos = newPos
status.lastPos = newPos
status.useMouse = true;
}
function mouseReleased(newPos) {
status.useMouse = false;
}
function mouseMoved(newPos: vector2d) {
status.currentPos = newPos;
}
function startPan(pos: vector2d) {
status.isPanning = true;
status.currentPanPos = pos;
status.lastPanPos = pos;
}
function endPan() {
status.isPanning = false;
}
function panEvent(newPos: vector2d) {
status.currentPanPos = newPos;
}
FrameAnimation {
id: updateTimer
running: root.inputsNeedProcessing
onTriggered: status.processInput(frameTime * 100)
}
QtObject {
id: status
property bool useMouse: false
property bool isPanning: false
property vector2d lastPos: Qt.vector2d(0, 0)
property vector2d lastPanPos: Qt.vector2d(0, 0)
property vector2d currentPos: Qt.vector2d(0, 0)
property vector2d currentPanPos: Qt.vector2d(0, 0)
function negate(vector) {
return Qt.vector3d(-vector.x, -vector.y, -vector.z)
}
function processInput(frameDelta) {
if (useMouse) {
// Get the delta
var rotationVector = root.origin.eulerRotation;
var delta = Qt.vector2d(lastPos.x - currentPos.x,
lastPos.y - currentPos.y);
// rotate x
var rotateX = delta.x * root.xSpeed * frameDelta
if (root.xInvert)
rotateX = -rotateX;
rotationVector.y += rotateX;
// rotate y
var rotateY = delta.y * -root.ySpeed * frameDelta
if (root.yInvert)
rotateY = -rotateY;
rotationVector.x += rotateY;
root.origin.setEulerRotation(rotationVector);
lastPos = currentPos;
}
if (isPanning) {
let delta = currentPanPos.minus(lastPanPos);
delta.x = -delta.x
delta.x = (delta.x / root.width) * root.camera.z * frameDelta
delta.y = (delta.y / root.height) * root.camera.z * frameDelta
let velocity = Qt.vector3d(0, 0, 0)
// X Movement
let xDirection = root.origin.right
velocity = velocity.plus(Qt.vector3d(xDirection.x * delta.x,
xDirection.y * delta.x,
xDirection.z * delta.x));
// Y Movement
let yDirection = root.origin.up
velocity = velocity.plus(Qt.vector3d(yDirection.x * delta.y,
yDirection.y * delta.y,
yDirection.z * delta.y));
root.origin.position = root.origin.position.plus(velocity)
lastPanPos = currentPanPos
}
}
}
}

View File

@@ -0,0 +1,290 @@
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick
import QtQuick3D
Item {
id: root
property Node controlledObject: undefined
property real speed: 1
property real shiftSpeed: 3
property real forwardSpeed: 5
property real backSpeed: 5
property real rightSpeed: 5
property real leftSpeed: 5
property real upSpeed: 5
property real downSpeed: 5
property real xSpeed: 0.1
property real ySpeed: 0.1
property bool xInvert: false
property bool yInvert: true
property bool mouseEnabled: true
property bool keysEnabled: true
readonly property bool inputsNeedProcessing: status.moveForward | status.moveBack
| status.moveLeft | status.moveRight
| status.moveUp | status.moveDown
| status.useMouse
property alias acceptedButtons: dragHandler.acceptedButtons
implicitWidth: parent.width
implicitHeight: parent.height
focus: keysEnabled
DragHandler {
id: dragHandler
target: null
enabled: root.mouseEnabled
onCentroidChanged: {
root.mouseMoved(Qt.vector2d(centroid.position.x, centroid.position.y));
}
onActiveChanged: {
if (active)
root.mousePressed(Qt.vector2d(centroid.position.x, centroid.position.y));
else
root.mouseReleased(Qt.vector2d(centroid.position.x, centroid.position.y));
}
}
TapHandler {
acceptedButtons: dragHandler.acceptedButtons
onTapped: root.forceActiveFocus() // qmllint disable signal-handler-parameters
}
Keys.onPressed: (event)=> { if (keysEnabled && !event.isAutoRepeat) handleKeyPress(event) }
Keys.onReleased: (event)=> { if (keysEnabled && !event.isAutoRepeat) handleKeyRelease(event) }
function mousePressed(newPos) {
root.forceActiveFocus()
status.currentPos = newPos
status.lastPos = newPos
status.useMouse = true;
}
function mouseReleased(newPos) {
status.useMouse = false;
}
function mouseMoved(newPos) {
status.currentPos = newPos;
}
function forwardPressed() {
status.moveForward = true
status.moveBack = false
}
function forwardReleased() {
status.moveForward = false
}
function backPressed() {
status.moveBack = true
status.moveForward = false
}
function backReleased() {
status.moveBack = false
}
function rightPressed() {
status.moveRight = true
status.moveLeft = false
}
function rightReleased() {
status.moveRight = false
}
function leftPressed() {
status.moveLeft = true
status.moveRight = false
}
function leftReleased() {
status.moveLeft = false
}
function upPressed() {
status.moveUp = true
status.moveDown = false
}
function upReleased() {
status.moveUp = false
}
function downPressed() {
status.moveDown = true
status.moveUp = false
}
function downReleased() {
status.moveDown = false
}
function shiftPressed() {
status.shiftDown = true
}
function shiftReleased() {
status.shiftDown = false
}
function handleKeyPress(event)
{
switch (event.key) {
case Qt.Key_W:
case Qt.Key_Up:
forwardPressed();
break;
case Qt.Key_S:
case Qt.Key_Down:
backPressed();
break;
case Qt.Key_A:
case Qt.Key_Left:
leftPressed();
break;
case Qt.Key_D:
case Qt.Key_Right:
rightPressed();
break;
case Qt.Key_R:
case Qt.Key_PageUp:
upPressed();
break;
case Qt.Key_F:
case Qt.Key_PageDown:
downPressed();
break;
case Qt.Key_Shift:
shiftPressed();
break;
}
}
function handleKeyRelease(event)
{
switch (event.key) {
case Qt.Key_W:
case Qt.Key_Up:
forwardReleased();
break;
case Qt.Key_S:
case Qt.Key_Down:
backReleased();
break;
case Qt.Key_A:
case Qt.Key_Left:
leftReleased();
break;
case Qt.Key_D:
case Qt.Key_Right:
rightReleased();
break;
case Qt.Key_R:
case Qt.Key_PageUp:
upReleased();
break;
case Qt.Key_F:
case Qt.Key_PageDown:
downReleased();
break;
case Qt.Key_Shift:
shiftReleased();
break;
}
}
FrameAnimation {
id: updateTimer
running: root.inputsNeedProcessing
onTriggered: status.processInput(frameTime * 100)
}
QtObject {
id: status
property bool moveForward: false
property bool moveBack: false
property bool moveLeft: false
property bool moveRight: false
property bool moveUp: false
property bool moveDown: false
property bool shiftDown: false
property bool useMouse: false
property vector2d lastPos: Qt.vector2d(0, 0)
property vector2d currentPos: Qt.vector2d(0, 0)
function updatePosition(vector, speed, position)
{
if (shiftDown)
speed *= root.shiftSpeed;
else
speed *= root.speed
var direction = vector;
var velocity = Qt.vector3d(direction.x * speed,
direction.y * speed,
direction.z * speed);
controlledObject.position = Qt.vector3d(position.x + velocity.x,
position.y + velocity.y,
position.z + velocity.z);
}
function negate(vector) {
return Qt.vector3d(-vector.x, -vector.y, -vector.z)
}
function processInput(frameDelta) {
if (root.controlledObject == undefined)
return;
if (moveForward)
updatePosition(root.controlledObject.forward, root.forwardSpeed * frameDelta, root.controlledObject.position);
else if (moveBack)
updatePosition(negate(root.controlledObject.forward), root.backSpeed * frameDelta, root.controlledObject.position);
if (moveRight)
updatePosition(root.controlledObject.right, root.rightSpeed * frameDelta, root.controlledObject.position);
else if (moveLeft)
updatePosition(negate(root.controlledObject.right), root.leftSpeed * frameDelta, root.controlledObject.position);
if (moveDown)
updatePosition(negate(root.controlledObject.up), root.downSpeed * frameDelta, root.controlledObject.position);
else if (moveUp)
updatePosition(root.controlledObject.up, root.upSpeed * frameDelta, root.controlledObject.position);
if (useMouse) {
// Get the delta
var rotationVector = root.controlledObject.eulerRotation;
var delta = Qt.vector2d(lastPos.x - currentPos.x,
lastPos.y - currentPos.y);
// rotate x
var rotateX = delta.x * xSpeed * frameDelta
if (xInvert)
rotateX = -rotateX;
rotationVector.y += rotateX;
// rotate y
var rotateY = delta.y * -ySpeed * frameDelta
if (yInvert)
rotateY = -rotateY;
rotationVector.x += rotateY;
controlledObject.setEulerRotation(rotationVector);
lastPos = currentPos;
}
}
}
}

View File

@@ -0,0 +1,112 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Column {
width: parent.width
Section {
width: parent.width
caption: qsTr("Axis Helper")
SectionLayout {
PropertyLabel {
text: qsTr("Axis Lines")
tooltip: qsTr("Show colored axis indicator lines.")
}
SecondColumnLayout {
CheckBox {
text: qsTr("Enabled")
backendValue: backendValues.enableAxisLines
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("XY Grid")
tooltip: qsTr("Show grid on XY plane.")
}
SecondColumnLayout {
CheckBox {
text: qsTr("Enabled")
backendValue: backendValues.enableXYGrid
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("XZ Grid")
tooltip: qsTr("Show grid on XZ plane.")
}
SecondColumnLayout {
CheckBox {
text: qsTr("Enabled")
backendValue: backendValues.enableXZGrid
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("YZ Grid")
tooltip: qsTr("Show grid on YZ plane.")
}
SecondColumnLayout {
CheckBox {
text: qsTr("Enabled")
backendValue: backendValues.enableYZGrid
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Grid Opacity")
tooltip: qsTr("Sets the opacity of the visible grids.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 1
decimals: 2
stepSize: 0.1
backendValue: backendValues.gridOpacity
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Grid Color")
tooltip: qsTr("Sets the color of the visible grids.")
}
ColorEditor {
backendValue: backendValues.gridColor
supportGradient: false
}
}
}
}

View File

@@ -0,0 +1,18 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
Column {
width: parent.width
AxisHelperSection {
width: parent.width
}
NodeSection {
width: parent.width
}
}

View File

@@ -0,0 +1,50 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Column {
width: parent.width
Section {
width: parent.width
caption: qsTr("Debug View")
SectionLayout {
PropertyLabel {
text: qsTr("Source View")
tooltip: qsTr("Sets the source View3D item to show render statistics for.")
}
SecondColumnLayout {
ItemFilterComboBox {
typeFilter: "QtQuick3D.View3D"
backendValue: backendValues.source
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Detailed Mode")
tooltip: qsTr("Enables detailed mode, which shows more detailed resource usage statistics.")
}
SecondColumnLayout {
CheckBox {
text: backendValues.resourceDetailsVisible.valueToString
backendValue: backendValues.resourceDetailsVisible
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}
}

View File

@@ -0,0 +1,14 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
Column {
width: parent.width
DebugViewSection {
width: parent.width
}
}

View File

@@ -0,0 +1,14 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
Column {
width: parent.width
ExtendedSceneEnvironmentSection {
width: parent.width
}
}

View File

@@ -0,0 +1,92 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Column {
width: parent.width
Section {
width: parent.width
caption: qsTr("Grid Geometry")
SectionLayout {
PropertyLabel {
text: qsTr("Horizontal Lines")
tooltip: qsTr("Sets the number of horizontal lines in the grid.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 0
backendValue: backendValues.horizontalLines
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Vertical Lines")
tooltip: qsTr("Sets the number of vertical lines in the grid.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 0
backendValue: backendValues.verticalLines
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Horizontal Step")
tooltip: qsTr("Sets the space between horizontal lines.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.horizontalStep
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Vertical Step")
tooltip: qsTr("Sets the space between vertical lines.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.verticalStep
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}
}

View File

@@ -0,0 +1,14 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
Column {
width: parent.width
GridGeometrySection {
width: parent.width
}
}

View File

@@ -0,0 +1,122 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Column {
width: parent.width
Section {
width: parent.width
caption: qsTr("Height Field Geometry")
ColumnLayout {
spacing: StudioTheme.Values.transform3DSectionSpacing
SectionLayout {
PropertyLabel {
text: qsTr("Extents")
tooltip: qsTr("Sets the dimensions of a box contain the geometry.")
}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.extents_x
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "X"
color: StudioTheme.Values.theme3DAxisXColor
}
ExpandingSpacer {}
}
PropertyLabel {}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.extents_y
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "Y"
color: StudioTheme.Values.theme3DAxisYColor
}
ExpandingSpacer {}
}
PropertyLabel {}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.extents_z
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "Z"
color: StudioTheme.Values.theme3DAxisZColor
}
ExpandingSpacer {}
}
}
SectionLayout {
PropertyLabel {
text: qsTr("Source")
tooltip: qsTr("Sets the location of an image file containing the heightmap data.")
}
SecondColumnLayout {
UrlChooser {
backendValue: backendValues.source
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Smooth Shading")
tooltip: qsTr("Sets whether the height map is shown with smooth shading or with hard angles between the squares of the map.")
}
SecondColumnLayout {
CheckBox {
text: backendValues.smoothShading.valueToString
backendValue: backendValues.smoothShading
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}
}
}

View File

@@ -0,0 +1,14 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
Column {
width: parent.width
HeightFieldGeometrySection {
width: parent.width
}
}

View File

@@ -0,0 +1,61 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Column {
width: parent.width
Section {
width: parent.width
caption: qsTr("Infinite Grid")
SectionLayout {
PropertyLabel {
text: qsTr("Visible")
tooltip: qsTr("Sets whether the infinite grid is visible.")
}
CheckBox {
text: backendValues.visible.valueToString
backendValue: backendValues.visible
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
PropertyLabel {
text: qsTr("Axis Lines")
tooltip: qsTr("Sets whether the axis lines are visible.")
}
CheckBox {
text: backendValues.gridAxes ? qsTr("On") : qsTr("Off")
backendValue: backendValues.gridAxes
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
PropertyLabel {
text: qsTr("Grid Interval")
tooltip: qsTr("Sets the distance between grid lines.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 9999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.gridInterval
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}
}

View File

@@ -0,0 +1,14 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
Column {
width: parent.width
InfiniteGridSection {
width: parent.width
}
}

View File

@@ -0,0 +1,30 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Section {
caption: qsTr("Instance Model")
width: parent.width
SectionLayout {
PropertyLabel {
text: qsTr("Instancing Table")
tooltip: qsTr("Sets the underlying instance table of the model.")
}
SecondColumnLayout {
ItemFilterComboBox {
typeFilter: "QtQuick3D.Instancing"
backendValue: backendValues.instancingTable
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}

View File

@@ -0,0 +1,14 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
Column {
width: parent.width
InstanceModelSection {
width: parent.width
}
}

View File

@@ -0,0 +1,30 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Section {
caption: qsTr("Instance Repeater")
width: parent.width
SectionLayout {
PropertyLabel {
text: qsTr("Instancing Table")
tooltip: qsTr("Sets the instance table used by the repeater.")
}
SecondColumnLayout {
ItemFilterComboBox {
typeFilter: "QtQuick3D.Instancing"
backendValue: backendValues.instancingTable
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}

View File

@@ -0,0 +1,22 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
Column {
width: parent.width
InstanceRepeaterSection {
width: parent.width
}
Repeater3DSection {
width: parent.width
}
NodeSection {
width: parent.width
}
}

View File

@@ -0,0 +1,80 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Section {
caption: qsTr("Lod Manager")
width: parent.width
SectionLayout {
PropertyLabel {
text: qsTr("Camera")
tooltip: qsTr("Specifies the camera from which the distance to the child nodes is calculated.")
}
SecondColumnLayout {
ItemFilterComboBox {
typeFilter: "QtQuick3D.Camera"
backendValue: backendValues.camera
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Fade Distance")
tooltip: qsTr("Specifies the distance at which the cross-fade between the detail levels starts.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.fadeDistance
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Distances")
tooltip: qsTr("Specifies the thresholds when the detail level changes. The first number is the distance when the first node changes to the second one, etc.")
}
SecondColumnLayout {
ActionIndicator {
icon.color: extFuncLogic.color
icon.text: extFuncLogic.glyph
onClicked: extFuncLogic.show()
forceVisible: extFuncLogic.menuVisible
ExtendedFunctionLogic {
id: extFuncLogic
backendValue: backendValues.distances
}
}
// Placeholder until we can do list of value types: QDS-9090
Label {
text: qsTr("Currently only editable in QML.")
Layout.fillWidth: true
Layout.preferredWidth: StudioTheme.Values.singleControlColumnWidth
Layout.minimumWidth: StudioTheme.Values.singleControlColumnWidth
Layout.maximumWidth: StudioTheme.Values.singleControlColumnWidth
}
ExpandingSpacer {}
}
}
}

View File

@@ -0,0 +1,18 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
Column {
width: parent.width
LodManagerSection {
width: parent.width
}
NodeSection {
width: parent.width
}
}

View File

@@ -0,0 +1,34 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Column {
width: parent.width
Section {
width: parent.width
caption: qsTr("Look-at Node")
SectionLayout {
PropertyLabel {
text: qsTr("Target Node")
tooltip: qsTr("Sets the target node to look at.")
}
SecondColumnLayout {
ItemFilterComboBox {
typeFilter: "QtQuick3D.Node"
backendValue: backendValues.target
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}
}

View File

@@ -0,0 +1,18 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
Column {
width: parent.width
LookAtNodeSection {
width: parent.width
}
NodeSection {
width: parent.width
}
}

View File

@@ -0,0 +1,350 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Column {
width: parent.width
Section {
width: parent.width
caption: qsTr("Visibility")
SectionLayout {
PropertyLabel {
text: qsTr("Visibility")
tooltip: qsTr("Sets the local visibility of the node.")
}
SecondColumnLayout {
// ### should be a slider
CheckBox {
text: qsTr("Visible")
backendValue: backendValues.visible
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Opacity")
tooltip: qsTr("Sets the local opacity value of the node.")
}
SecondColumnLayout {
// ### should be a slider
SpinBox {
minimumValue: 0
maximumValue: 1
decimals: 2
stepSize: 0.1
backendValue: backendValues.opacity
sliderIndicatorVisible: true
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}
Section {
id: transformSection
width: parent.width
caption: qsTr("Transform")
ColumnLayout {
spacing: StudioTheme.Values.transform3DSectionSpacing
SectionLayout {
PropertyLabel {
text: qsTr("Translation")
tooltip: qsTr("Sets the translation of the node.")
}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.x
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "X"
color: StudioTheme.Values.theme3DAxisXColor
}
ExpandingSpacer {}
}
PropertyLabel {}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.y
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "Y"
color: StudioTheme.Values.theme3DAxisYColor
}
ExpandingSpacer {}
}
PropertyLabel {}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.z
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "Z"
color: StudioTheme.Values.theme3DAxisZColor
}
ExpandingSpacer {}
}
}
SectionLayout {
PropertyLabel {
text: qsTr("Rotation")
tooltip: qsTr("Sets the rotation of the node in degrees.")
}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.eulerRotation_x
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "X"
color: StudioTheme.Values.theme3DAxisXColor
}
ExpandingSpacer {}
}
PropertyLabel {}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.eulerRotation_y
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "Y"
color: StudioTheme.Values.theme3DAxisYColor
}
ExpandingSpacer {}
}
PropertyLabel {}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.eulerRotation_z
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "Z"
color: StudioTheme.Values.theme3DAxisZColor
}
ExpandingSpacer {}
}
}
SectionLayout {
PropertyLabel {
text: qsTr("Scale")
tooltip: qsTr("Sets the scale of the node.")
}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.scale_x
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "X"
color: StudioTheme.Values.theme3DAxisXColor
}
ExpandingSpacer {}
}
PropertyLabel {}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.scale_y
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "Y"
color: StudioTheme.Values.theme3DAxisYColor
}
ExpandingSpacer {}
}
PropertyLabel {}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.scale_z
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "Z"
color: StudioTheme.Values.theme3DAxisZColor
}
ExpandingSpacer {}
}
}
SectionLayout {
PropertyLabel {
text: qsTr("Pivot")
tooltip: qsTr("Sets the pivot of the node.")
}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.pivot_x
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "X"
color: StudioTheme.Values.theme3DAxisXColor
}
ExpandingSpacer {}
}
PropertyLabel {}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.pivot_y
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "Y"
color: StudioTheme.Values.theme3DAxisYColor
}
ExpandingSpacer {}
}
PropertyLabel {}
SecondColumnLayout {
SpinBox {
minimumValue: -9999999
maximumValue: 9999999
decimals: 2
backendValue: backendValues.pivot_z
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "Z"
color: StudioTheme.Values.theme3DAxisZColor
}
ExpandingSpacer {}
}
}
}
}
}

View File

@@ -0,0 +1,162 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Column {
width: parent.width
Section {
width: parent.width
caption: qsTr("Orbit Camera Controller")
SectionLayout {
PropertyLabel {
text: qsTr("Origin")
tooltip: qsTr("The node that the camera will orbit around.")
}
SecondColumnLayout {
ItemFilterComboBox {
typeFilter: "QtQuick3D.Node"
backendValue: backendValues.origin
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Camera")
tooltip: qsTr("The camera that will be controlled.")
}
SecondColumnLayout {
ItemFilterComboBox {
typeFilter: "QtQuick3D.Camera"
backendValue: backendValues.camera
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Mouse/Touch")
tooltip: qsTr("Enables interaction via mouse and touch.")
}
SecondColumnLayout {
CheckBox {
id: mouseEnabledCheckBox
text: backendValues.mouseEnabled.valueToString
backendValue: backendValues.mouseEnabled
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
visible: mouseEnabledCheckBox.checked
text: qsTr("Pan Controls")
tooltip: qsTr("Enables panning gestures.")
}
SecondColumnLayout {
visible: mouseEnabledCheckBox.checked
CheckBox {
text: backendValues.panEnabled.valueToString
backendValue: backendValues.panEnabled
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
visible: mouseEnabledCheckBox.checked
text: qsTr("Invert X")
tooltip: qsTr("Enables inverting X-axis controls.")
}
SecondColumnLayout {
visible: mouseEnabledCheckBox.checked
CheckBox {
text: backendValues.xInvert.valueToString
backendValue: backendValues.xInvert
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
visible: mouseEnabledCheckBox.checked
text: qsTr("X Speed")
tooltip: qsTr("The speed of the X-axis controls.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.xSpeed
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
visible: mouseEnabledCheckBox.checked
text: qsTr("Invert Y")
tooltip: qsTr("Enables inverting Y-axis controls.")
}
SecondColumnLayout {
visible: mouseEnabledCheckBox.checked
CheckBox {
text: backendValues.yInvert.valueToString
backendValue: backendValues.yInvert
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
visible: mouseEnabledCheckBox.checked
text: qsTr("Y Speed")
tooltip: qsTr("The speed of the Y-axis controls.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.ySpeed
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}
}

View File

@@ -0,0 +1,14 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
Column {
width: parent.width
OrbitCameraControllerSection {
width: parent.width
}
}

View File

@@ -0,0 +1,307 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Column {
width: parent.width
Section {
width: parent.width
caption: qsTr("Procedural Sky Texture Data")
SectionLayout {
PropertyLabel {
text: qsTr("Quality")
tooltip: qsTr("This property sets the size of the texture. The higher the quality, the more memory is used.")
}
SecondColumnLayout {
ComboBox {
scope: "ProceduralSkyTextureData"
model: ["SkyTextureQualityLow", "SkyTextureQualityMedium", "SkyTextureQualityHigh", "SkyTextureQualityVeryHigh"]
backendValue: backendValues.textureQuality
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}
Section {
width: parent.width
caption: qsTr("Sky")
SectionLayout {
PropertyLabel {
text: qsTr("Top Color")
tooltip: qsTr("Specifies the sky color at the top of the skybox.")
}
ColorEditor {
backendValue: backendValues.skyTopColor
supportGradient: false
}
PropertyLabel {
text: qsTr("Horizon Color")
tooltip: qsTr("Specifies the sky color at the horizon.")
}
ColorEditor {
backendValue: backendValues.skyHorizonColor
supportGradient: false
}
PropertyLabel {
text: qsTr("Energy")
tooltip: qsTr("Specifies the HDR color intensity of the top half of the skybox.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 64
decimals: 3
stepSize: 0.01
sliderIndicatorVisible: true
backendValue: backendValues.skyEnergy
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Curve")
tooltip: qsTr("Modifies the curve (n^x) of the sky gradient from the horizon to the top.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 64
decimals: 3
stepSize: 0.01
sliderIndicatorVisible: true
backendValue: backendValues.skyCurve
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}
Section {
width: parent.width
caption: qsTr("Ground")
SectionLayout {
PropertyLabel {
text: qsTr("Bottom Color")
tooltip: qsTr("Specifies the ground color at the bottom of the skybox.")
}
ColorEditor {
backendValue: backendValues.groundBottomColor
supportGradient: false
}
PropertyLabel {
text: qsTr("Horizon Color")
tooltip: qsTr("Specifies the ground color at the horizon.")
}
ColorEditor {
backendValue: backendValues.groundHorizonColor
supportGradient: false
}
PropertyLabel {
text: qsTr("Energy")
tooltip: qsTr("Specifies the HDR color intensity of the bottom half of the skybox.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 64
decimals: 3
stepSize: 0.01
sliderIndicatorVisible: true
backendValue: backendValues.groundEnergy
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Curve")
tooltip: qsTr("Modifies the curve (n^x) of the ground gradient from the horizon to the bottom.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 64
decimals: 3
stepSize: 0.01
sliderIndicatorVisible: true
backendValue: backendValues.groundCurve
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}
Section {
width: parent.width
caption: qsTr("Sun")
SectionLayout {
PropertyLabel {
text: qsTr("Color")
tooltip: qsTr("Specifies the color at the sun on the skybox.")
}
ColorEditor {
backendValue: backendValues.sunColor
supportGradient: false
}
PropertyLabel {
text: qsTr("Energy")
tooltip: qsTr("Specifies the HDR color intensity of sun on the skybox.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 64
decimals: 3
stepSize: 0.01
sliderIndicatorVisible: true
backendValue: backendValues.sunEnergy
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Fade Start")
tooltip: qsTr("Specifies the angle from the center of the sun to where it starts to fade.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 360
decimals: 1
stepSize: 0.1
sliderIndicatorVisible: true
backendValue: backendValues.sunAngleMin
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Fade End")
tooltip: qsTr("Specifies the angle from the center of the sun to where it fades out completely.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 360
decimals: 1
stepSize: 0.1
sliderIndicatorVisible: true
backendValue: backendValues.sunAngleMax
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Curve")
tooltip: qsTr("Modifies the curve (n^x) of the gradient from the sky color and the sun.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 64
decimals: 3
stepSize: 0.01
sliderIndicatorVisible: true
backendValue: backendValues.sunCurve
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Latitude")
tooltip: qsTr("Specifies the angle between the horizon and the sun position.")
}
SecondColumnLayout {
SpinBox {
minimumValue: -180
maximumValue: 180
decimals: 1
stepSize: 0.1
sliderIndicatorVisible: true
backendValue: backendValues.sunLatitude
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Longitude")
tooltip: qsTr("Specifies the angle between the forward direction and the sun position.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 360
decimals: 1
stepSize: 0.1
sliderIndicatorVisible: true
backendValue: backendValues.sunLongitude
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}
}

View File

@@ -0,0 +1,14 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
Column {
width: parent.width
ProceduralSkyTextureDataSection {
width: parent.width
}
}

View File

@@ -0,0 +1,48 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Section {
caption: qsTr("Repeater")
width: parent.width
SectionLayout {
PropertyLabel {
text: qsTr("Model")
tooltip: qsTr("The model providing data for the repeater. This can simply specify the number of delegate instances to create or it can be bound to an actual model.")
}
SecondColumnLayout {
LineEdit {
backendValue: backendValues.model
showTranslateCheckBox: false
writeAsExpression: true
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
width: implicitWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Delegate")
tooltip: qsTr("The delegate provides a template defining each object instantiated by the repeater.")
}
SecondColumnLayout {
ItemFilterComboBox {
typeFilter: "Component"
backendValue: backendValues.delegate
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}

View File

@@ -0,0 +1,298 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Column {
width: parent.width
Section {
width: parent.width
caption: qsTr("WASD Controller")
SectionLayout {
PropertyLabel {
text: qsTr("Controlled Node")
tooltip: qsTr("Sets the 3D node controlled by this controller.")
}
SecondColumnLayout {
ItemFilterComboBox {
typeFilter: "QtQuick3D.Node"
backendValue: backendValues.controlledObject
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Invert X")
tooltip: qsTr("Enables inverting X-axis controls.")
}
SecondColumnLayout {
CheckBox {
text: qsTr("Enabled")
backendValue: backendValues.xInvert
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Invert Y")
tooltip: qsTr("Enables inverting Y-axis controls.")
}
SecondColumnLayout {
CheckBox {
text: qsTr("Enabled")
backendValue: backendValues.yInvert
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Mouse Control")
tooltip: qsTr("Enables using mouse to control the target node.")
}
SecondColumnLayout {
CheckBox {
text: qsTr("Enabled")
backendValue: backendValues.mouseEnabled
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Keyboard Control")
tooltip: qsTr("Enables using keyboard to control the target node.")
}
SecondColumnLayout {
CheckBox {
text: qsTr("Enabled")
backendValue: backendValues.keysEnabled
implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
// TODO: acceptedButtons has no control as there is currently no support for a flags
// type of property control in QDS.
}
}
Section {
width: parent.width
caption: qsTr("Speeds")
SectionLayout {
PropertyLabel {
text: qsTr("Speed")
tooltip: qsTr("Sets the general navigation speed multiplier.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.speed
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Shift Speed")
tooltip: qsTr("Sets the navigation speed multiplier when the Shift key is pressed.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.shiftSpeed
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Forward Speed")
tooltip: qsTr("Sets the navigation speed when forward key is pressed.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.forwardSpeed
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Back Speed")
tooltip: qsTr("Sets the navigation speed when back key is pressed.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.backSpeed
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Right Speed")
tooltip: qsTr("Sets the navigation speed when right key is pressed.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.rightSpeed
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Left Speed")
tooltip: qsTr("Sets the navigation speed when left key is pressed.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.leftSpeed
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Up Speed")
tooltip: qsTr("Sets the navigation speed when up key is pressed.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.upSpeed
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Down Speed")
tooltip: qsTr("Sets the navigation speed when down key is pressed.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.downSpeed
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("X Speed")
tooltip: qsTr("Sets the navigation speed when mouse is moved along X-axis.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.xSpeed
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
PropertyLabel {
text: qsTr("Y Speed")
tooltip: qsTr("Sets the navigation speed when mouse is moved along Y-axis.")
}
SecondColumnLayout {
SpinBox {
minimumValue: 0
maximumValue: 999999
decimals: 2
stepSize: 0.1
backendValue: backendValues.ySpeed
implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth
}
ExpandingSpacer {}
}
}
}
}

View File

@@ -0,0 +1,14 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick 2.15
import QtQuick.Layouts 1.15
import HelperWidgets 2.0
Column {
width: parent.width
WasdControllerSection {
width: parent.width
}
}

View File

@@ -0,0 +1,261 @@
MetaInfo {
Type {
name: "QtQuick3D.Helpers.LookAtNode"
icon: "images/lookatnode16.png"
Hints {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
canBeDroppedInView3D: true
}
ItemLibraryEntry {
name: "Look-at Node"
category: "Helpers"
libraryIcon: "images/lookatnode.png"
version: "6.4"
requiredImport: "QtQuick3D.Helpers"
}
}
Type {
name: "QtQuick3D.Helpers.AxisHelper"
icon: "images/axishelper16.png"
Hints {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
canBeDroppedInView3D: true
}
ItemLibraryEntry {
name: "Axis Helper"
category: "Helpers"
libraryIcon: "images/axishelper.png"
version: "6.0"
requiredImport: "QtQuick3D.Helpers"
}
}
Type {
name: "QtQuick3D.Helpers.DebugView"
icon: "images/debugview16.png"
Hints {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: true
canBeDroppedInView3D: false
}
ItemLibraryEntry {
name: "Debug View"
category: "Helpers"
libraryIcon: "images/debugview.png"
version: "6.0"
requiredImport: "QtQuick3D.Helpers"
}
}
Type {
name: "QtQuick3D.Helpers.GridGeometry"
icon: "images/gridgeometry16.png"
Hints {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
canBeDroppedInView3D: true
}
ItemLibraryEntry {
name: "Grid Geometry"
category: "Helpers"
libraryIcon: "images/gridgeometry.png"
version: "6.0"
requiredImport: "QtQuick3D.Helpers"
}
}
Type {
name: "QtQuick3D.Helpers.HeightFieldGeometry"
icon: "images/heightfieldgeometry16.png"
Hints {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
canBeDroppedInView3D: true
}
ItemLibraryEntry {
name: "Height Field Geometry"
category: "Helpers"
libraryIcon: "images/heightfieldgeometry.png"
version: "6.4"
requiredImport: "QtQuick3D.Helpers"
}
}
Type {
name: "QtQuick3D.Helpers.InstanceModel"
icon: "images/instancemodel16.png"
Hints {
visibleInNavigator: false
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
canBeDroppedInView3D: false
}
ItemLibraryEntry {
name: "Instance Model"
category: "Helpers"
libraryIcon: "images/instancemodel.png"
version: "6.4"
requiredImport: "QtQuick3D.Helpers"
}
}
Type {
name: "QtQuick3D.Helpers.InstanceRepeater"
icon: "images/instancerepeater16.png"
Hints {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
canBeDroppedInView3D: true
}
ItemLibraryEntry {
name: "Instance Repeater"
category: "Helpers"
libraryIcon: "images/instancerepeater.png"
version: "6.4"
requiredImport: "QtQuick3D.Helpers"
}
}
Type {
name: "QtQuick3D.Helpers.WasdController"
icon: "images/wasdcontroller16.png"
Hints {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: true
canBeDroppedInView3D: false
}
ItemLibraryEntry {
name: "Wasd Controller"
category: "Helpers"
libraryIcon: "images/wasdcontroller.png"
version: "6.0"
requiredImport: "QtQuick3D.Helpers"
}
}
Type {
name: "QtQuick3D.Helpers.InfiniteGrid"
icon: "images/infinitegrid16.png"
Hints {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
canBeDroppedInView3D: false
}
ItemLibraryEntry {
name: "Infinite Grid"
category: "Helpers"
libraryIcon: "images/infinitegrid.png"
version: "6.5"
requiredImport: "QtQuick3D.Helpers"
}
}
Type {
name: "QtQuick3D.Helpers.OrbitCameraController"
icon: "images/orbitcameracontroller16.png"
Hints {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: true
canBeDroppedInView3D: false
}
ItemLibraryEntry {
name: "Orbit Camera Controller"
category: "Helpers"
libraryIcon: "images/orbitcameracontroller.png"
version: "6.4"
requiredImport: "QtQuick3D.Helpers"
}
}
Type {
name: "QtQuick3D.Helpers.ProceduralSkyTextureData"
icon: "images/proceduralskytexturedata16.png"
Hints {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
canBeDroppedInView3D: false
}
ItemLibraryEntry {
name: "Procedural Sky Texture Data"
category: "Helpers"
libraryIcon: "images/proceduralskytexturedata.png"
version: "6.4"
requiredImport: "QtQuick3D.Helpers"
}
}
Type {
name: "QtQuick3D.Helpers.ExtendedSceneEnvironment"
icon: "images/extendedsceneenvironment16.png"
Hints {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
canBeDroppedInView3D: false
}
ItemLibraryEntry {
name: "Extended Scene Environment"
category: "Helpers"
libraryIcon: "images/extendedsceneenvironment.png"
version: "6.5"
requiredImport: "QtQuick3D.Helpers"
}
}
Type {
name: "QtQuick3D.Helpers.LodManager"
icon: "images/lodmanager16.png"
Hints {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
canBeDroppedInView3D: true
}
ItemLibraryEntry {
name: "Lod Manager"
category: "Helpers"
libraryIcon: "images/lodmanager.png"
version: "6.5"
requiredImport: "QtQuick3D.Helpers"
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 821 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 890 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

View File

@@ -0,0 +1,66 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick
import QtQuick3D
import QtQuick3D.Helpers.impl
DepthOfFieldEffect {
readonly property TextureInput sourceSampler: TextureInput {
texture: Texture {}
}
property real focusDistance: 600
property real focusRange: 100
property real blurAmount: 4
Shader {
id: downsampleVert
stage: Shader.Vertex
shader: "qrc:/qtquick3d_helpers/shaders/downsample.vert"
}
Shader {
id: downsampleFrag
stage: Shader.Fragment
shader: "qrc:/qtquick3d_helpers/shaders/downsample.frag"
}
Shader {
id: blurVert
stage: Shader.Vertex
shader: "qrc:/qtquick3d_helpers/shaders/depthoffieldblur.vert"
}
Shader {
id: blurFrag
stage: Shader.Fragment
shader: "qrc:/qtquick3d_helpers/shaders/depthoffieldblur.frag"
}
Buffer {
id: downsampleBuffer
name: "downsampleBuffer"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
sizeMultiplier: 0.5
}
passes: [
Pass {
shaders: [ downsampleVert, downsampleFrag ]
output: downsampleBuffer
},
Pass {
shaders: [ blurVert, blurFrag ]
commands: [
// INPUT is the texture for downsampleBuffer
BufferInput {
buffer: downsampleBuffer
},
// the actual input texture is exposed as sourceSampler
BufferInput {
sampler: "sourceSampler"
}
]
}
]
}

View File

@@ -0,0 +1,703 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick
import QtQuick3D
import QtQuick3D.Helpers.impl
MainSceneEffect {
id: sceneEffect
property int tonemapMode: SceneEnvironment.TonemapModeLinear
property real exposure: 1.0
property real white: 1.0
property bool applyFXAA: false
property bool ditheringEnabled: false
property real sharpnessAmount: 0.0 // 0.0 - 1.0
property bool colorAdjustmentsEnabled: false
property real adjustmentBrightness: 1.0
property real adjustmentContrast: 1.0
property real adjustmentSaturation: 1.0
// Lens Flare
property bool lensFlareEnabled: false
property real lensFlareBloomScale: 10 // 0 - 20
property real lensFlareBloomBias: 0.95 // 0 - x (basically maximum color value)
property real lensFlareGhostDispersal: 0.5 // 0 - 1
property int lensFlareGhostCount: 4 // 0 - 20
property real lensFlareHaloWidth: 0.25 // 0 - 1
property real lensFlareStretchToAspect: 0.5 // 0 - 1
property real lensFlareDistortion: 5 // 0.0 - 20.0
property real lensFlareBlurAmount: 3 // 0.0 - 5.0
property bool lensFlareApplyDirtTexture: false
property bool lensFlareApplyStarburstTexture: false
property vector3d lensFlareCameraDirection: Qt.vector3d(0, 0, -1)
property bool lensFlareDebug: false
property TextureInput lensColorTexture: TextureInput {
id: lensColorTextureInput
texture: defaultLensColorTexture
}
property alias lensColorTextureAlias: lensColorTextureInput.texture
Texture {
id: defaultLensColorTexture
source: "qrc:/qtquick3d_helpers/images/gradientTexture.png"
tilingModeHorizontal: Texture.ClampToEdge
tilingModeVertical: Texture.ClampToEdge
}
property TextureInput lensDirtTexture: TextureInput {
id: lensDirtTextureInput
texture: defaultLensDirtTexture
}
property alias lensDirtTextureAlias: lensDirtTextureInput.texture
Texture {
id: defaultLensDirtTexture
source: "qrc:/qtquick3d_helpers/images/lens_dirt_default.jpeg"
}
property TextureInput starburstTexture: TextureInput {
id: lensStarburstTextureInput
texture: defaultLensStarburstTexture
}
property alias starburstTextureAlias: lensStarburstTextureInput.texture
Texture {
id: defaultLensStarburstTexture
source: "qrc:/qtquick3d_helpers/images/noiseTexture.png"
}
// Glow data
readonly property bool isFirstPass: true
property bool isGlowEnabled: false
property bool glowQualityHigh: false
property bool glowUseBicubicUpscale: false
property real glowStrength : 1.0 // 0.0 - 2.0
property real glowIntensity : 0.8 // 0.0 - 8.0
property real glowBloom : 0.0 // 0.0 - 1.0
property int glowBlendMode : 2 // Additive,Screen,Softlight,Replace
property real glowHDRMaximumValue: 12.0 // 0.0 - 256.0
property real glowHDRScale: 2.0 // 0.0 - 4.0
property real glowHDRMinimumValue: 1.0 // 0.0 - 4.0
property int glowLevel: 1 // 1 - 7
// Color Grading (LUT)
property bool enableLut: false
property alias lutTextureAlias: lutTextureInput.texture
property TextureInput lut: TextureInput {
id: lutTextureInput
texture: defaultLutTexture
}
property real lutSize: 16.0 // size of texture, textures are 3d in 2d, so width = lutSize * lutSize, height = lutSize
property real lutFilterAlpha: 1.0 // 0.0 - 1.0
Texture {
id: defaultLutTexture
source: "qrc:/qtquick3d_helpers/luts/identity.png"
}
// Vignette
property bool vignetteEnabled: false
property real vignetteStrength: 15 // 0 - 15
property color vignetteColor: "gray"
property real vignetteRadius: 0.35 // 0 - 5
readonly property TextureInput glowBuffer1: TextureInput {
texture: Texture {}
}
readonly property TextureInput glowBuffer2: TextureInput {
texture: Texture {}
}
readonly property TextureInput glowBuffer3: TextureInput {
texture: Texture {}
}
readonly property TextureInput glowBuffer4: TextureInput {
texture: Texture {}
}
readonly property TextureInput glowBuffer5: TextureInput {
texture: Texture {}
}
readonly property TextureInput glowBuffer6: TextureInput {
texture: Texture {}
}
readonly property TextureInput glowBuffer7: TextureInput {
texture: Texture {}
}
readonly property TextureInput lensFlareDownsampleBuffer: TextureInput {
texture: Texture {}
}
readonly property TextureInput lensFlareFeaturesBuffer: TextureInput {
texture: Texture {}
}
readonly property TextureInput lensFlareTexture: TextureInput {
texture: Texture {}
}
Component.onCompleted: buildPasses()
onIsGlowEnabledChanged: buildPasses()
onLensFlareEnabledChanged: buildPasses()
function buildPasses() {
let passList = [];
if (lensFlareEnabled) {
passList.push(lensFlareDownsamplePass)
passList.push(lensFlareFeaturesPass)
passList.push(lensFlareBlurHorizontalPass)
passList.push(lensFlareBlurVerticalPass)
}
if (isGlowEnabled) {
passList.push(horizontalBlurPass1)
passList.push(verticalBlurPass1)
passList.push(horizontalBlurPass2)
passList.push(verticalBlurPass2)
passList.push(horizontalBlurPass3)
passList.push(verticalBlurPass3)
passList.push(horizontalBlurPass4)
passList.push(verticalBlurPass4)
passList.push(horizontalBlurPass5)
passList.push(verticalBlurPass5)
passList.push(horizontalBlurPass6)
passList.push(verticalBlurPass6)
passList.push(horizontalBlurPass7)
passList.push(verticalBlurPass7)
}
passList.push(tonemapPass)
tonemapPass.rebuildCommands();
sceneEffect.passes = passList // qmllint disable read-only-property
}
Shader {
id: tonemapperFrag
stage: Shader.Fragment
shader: "qrc:/qtquick3d_helpers/shaders/tonemapper.frag"
}
Shader {
id: glowHorizontalBlur
stage: Shader.Fragment
shader: "qrc:/qtquick3d_helpers/shaders/glowhorizontalblur.frag"
}
Shader {
id: glowVerticalBlur
stage: Shader.Fragment
shader: "qrc:/qtquick3d_helpers/shaders/glowverticalblur.frag"
}
Shader {
id: lensFlareDownsample
stage: Shader.Fragment
shader: "qrc:/qtquick3d_helpers/shaders/lensflaredownsample.frag"
}
Shader {
id: lensFlareFeatures
stage: Shader.Fragment
shader: "qrc:/qtquick3d_helpers/shaders/lensflarefeatures.frag"
}
Shader {
id: lensFlareVerticalBlurVert
stage: Shader.Vertex
shader: "qrc:/qtquick3d_helpers/shaders/lensflareblurvertical.vert"
}
Shader {
id: lensFlareHorizontalVert
stage: Shader.Vertex
shader: "qrc:/qtquick3d_helpers/shaders/lensflareblurhorizontal.vert"
}
Shader {
id: lensFlareGaussianBlur
stage: Shader.Fragment
shader: "qrc:/qtquick3d_helpers/shaders/lensflaregaussianblur.frag"
}
Buffer {
id: tempBuffer1
name: "tempBuffer1"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.5
}
Buffer {
id: tempBuffer2
name: "tempBuffer2"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.25
}
Buffer {
id: tempBuffer3
name: "tempBuffer3"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.125
}
Buffer {
id: tempBuffer4
name: "tempBuffer4"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.0625
}
Buffer {
id: tempBuffer5
name: "tempBuffer5"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.03125
}
Buffer {
id: tempBuffer6
name: "tempBuffer6"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.015625
}
Buffer {
id: tempBuffer7
name: "tempBuffer7"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.0078125
}
Buffer {
id: glowBuffer1
name: "glowBuffer1"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.5
}
Buffer {
id: glowBuffer2
name: "glowBuffer2"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.25
}
Buffer {
id: glowBuffer3
name: "glowBuffer3"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.125
}
Buffer {
id: glowBuffer4
name: "glowBuffer4"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.0625
}
Buffer {
id: glowBuffer5
name: "glowBuffer5"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.03125
}
Buffer {
id: glowBuffer6
name: "glowBuffer6"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.015625
}
Buffer {
id: glowBuffer7
name: "glowBuffer7"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.0078125
}
Buffer {
id: lensFlareDownsampleBuffer
name: "lensFlareDownsampleBuffer"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.5
}
Buffer {
id: lensFlareFeaturesBuffer
name: "lensFlareFeaturesBuffer"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.5
}
Buffer {
id: lensFlareBlurTempBuffer
name: "lensFlareBlurTempBuffer"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.5
}
Buffer {
id: lensFlareBlurBuffer
name: "lensFlareBlurBuffer"
format: Buffer.RGBA16F
textureFilterOperation: Buffer.Linear
textureCoordOperation: Buffer.ClampToEdge
bufferFlags: Buffer.None
sizeMultiplier: 0.5
}
Pass {
id: horizontalBlurPass1
shaders: [glowHorizontalBlur]
commands: [
SetUniformValue {
target: "isFirstPass"
value: true
}
]
output: tempBuffer1
}
Pass {
id: verticalBlurPass1
shaders: [glowVerticalBlur]
commands: [
SetUniformValue {
target: "isFirstPass"
value: false
},
BufferInput {
buffer: tempBuffer1
}
]
output: glowBuffer1
}
Pass {
id: horizontalBlurPass2
shaders: [glowHorizontalBlur]
commands: [
SetUniformValue {
target: "isFirstPass"
value: false
},
BufferInput {
buffer: glowBuffer1
}
]
output: tempBuffer2
}
Pass {
id: verticalBlurPass2
shaders: [glowVerticalBlur]
commands: [
SetUniformValue {
target: "isFirstPass"
value: false
},
BufferInput {
buffer: tempBuffer2
}
]
output: glowBuffer2
}
Pass {
id: horizontalBlurPass3
shaders: [glowHorizontalBlur]
commands: [
SetUniformValue {
target: "isFirstPass"
value: false
},
BufferInput {
buffer: glowBuffer2
}
]
output: tempBuffer3
}
Pass {
id: verticalBlurPass3
shaders: [glowVerticalBlur]
commands: [
SetUniformValue {
target: "isFirstPass"
value: false
},
BufferInput {
buffer: tempBuffer3
}
]
output: glowBuffer3
}
Pass {
id: horizontalBlurPass4
shaders: [glowHorizontalBlur]
commands: [
SetUniformValue {
target: "isFirstPass"
value: false
},
BufferInput {
buffer: glowBuffer3
}
]
output: tempBuffer4
}
Pass {
id: verticalBlurPass4
shaders: [glowVerticalBlur]
commands: [
SetUniformValue {
target: "isFirstPass"
value: false
},
BufferInput {
buffer: tempBuffer4
}
]
output: glowBuffer4
}
Pass {
id: horizontalBlurPass5
shaders: [glowHorizontalBlur]
commands: [
SetUniformValue {
target: "isFirstPass"
value: false
},
BufferInput {
buffer: glowBuffer4
}
]
output: tempBuffer5
}
Pass {
id: verticalBlurPass5
shaders: [glowVerticalBlur]
commands: [
SetUniformValue {
target: "isFirstPass"
value: false
},
BufferInput {
buffer: tempBuffer5
}
]
output: glowBuffer5
}
Pass {
id: horizontalBlurPass6
shaders: [glowHorizontalBlur]
commands: [
SetUniformValue {
target: "isFirstPass"
value: false
},
BufferInput {
buffer: glowBuffer5
}
]
output: tempBuffer6
}
Pass {
id: verticalBlurPass6
shaders: [glowVerticalBlur]
commands: [
SetUniformValue {
target: "isFirstPass"
value: false
},
BufferInput {
buffer: tempBuffer6
}
]
output: glowBuffer6
}
Pass {
id: horizontalBlurPass7
shaders: [glowHorizontalBlur]
commands: [
SetUniformValue {
target: "isFirstPass"
value: false
},
BufferInput {
buffer: glowBuffer6
}
]
output: tempBuffer7
}
Pass {
id: verticalBlurPass7
shaders: [glowVerticalBlur]
commands: [
SetUniformValue {
target: "isFirstPass"
value: false
},
BufferInput {
buffer: tempBuffer7
}
]
output: glowBuffer7
}
Pass {
id: lensFlareDownsamplePass
shaders: [lensFlareDownsample]
output: lensFlareDownsampleBuffer
}
Pass {
id: lensFlareFeaturesPass
shaders: [lensFlareFeatures]
commands: [
BufferInput {
buffer: lensFlareDownsampleBuffer
sampler: "lensFlareDownsampleBuffer"
}
]
output: lensFlareFeaturesBuffer
}
Pass {
id: lensFlareBlurHorizontalPass
shaders: [lensFlareHorizontalVert, lensFlareGaussianBlur]
commands: [
BufferInput {
buffer: lensFlareFeaturesBuffer
sampler: "lensFlareTexture"
}
]
output: lensFlareBlurTempBuffer
}
Pass {
id: lensFlareBlurVerticalPass
shaders: [lensFlareVerticalBlurVert, lensFlareGaussianBlur]
commands: [
BufferInput {
buffer: lensFlareBlurTempBuffer
sampler: "lensFlareTexture"
}
]
output: lensFlareBlurBuffer
}
Connections {
target: sceneEffect
function onIsGlowEnabledChanged() { tonemapPass.rebuildCommands() }
function onLensFlareEnabledChanged() { tonemapPass.rebuildCommands() }
}
BufferInput {
id: glowBufferInput1
buffer: glowBuffer1
sampler: "glowBuffer1"
}
BufferInput {
id: glowBufferInput2
buffer: glowBuffer2
sampler: "glowBuffer2"
}
BufferInput {
id: glowBufferInput3
buffer: glowBuffer3
sampler: "glowBuffer3"
}
BufferInput {
id: glowBufferInput4
buffer: glowBuffer4
sampler: "glowBuffer4"
}
BufferInput {
id: glowBufferInput5
buffer: glowBuffer5
sampler: "glowBuffer5"
}
BufferInput {
id: glowBufferInput6
buffer: glowBuffer6
sampler: "glowBuffer6"
}
BufferInput {
id: glowBufferInput7
buffer: glowBuffer7
sampler: "glowBuffer7"
}
BufferInput {
id: lensFlareBufferInput
buffer: lensFlareBlurBuffer
sampler: "lensFlareTexture"
}
Pass {
id: tonemapPass;
shaders: [tonemapperFrag]
function rebuildCommands() {
let dynamicCommands = []
if (sceneEffect.isGlowEnabled) {
dynamicCommands.push(glowBufferInput1)
dynamicCommands.push(glowBufferInput2)
dynamicCommands.push(glowBufferInput3)
dynamicCommands.push(glowBufferInput4)
dynamicCommands.push(glowBufferInput5)
dynamicCommands.push(glowBufferInput6)
dynamicCommands.push(glowBufferInput7)
}
if (sceneEffect.lensFlareEnabled) {
dynamicCommands.push(lensFlareBufferInput)
}
tonemapPass.commands = dynamicCommands; // qmllint disable read-only-property
}
}
}

View File

@@ -0,0 +1,160 @@
import QtQuick.tooling 1.2
// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
// This file was auto-generated by qmltyperegistrar.
Module {
Component {
file: "private/sceneeffects_p.h"
lineNumber: 62
name: "DepthOfFieldEffect"
accessSemantics: "reference"
prototype: "SceneEffectBase"
exports: ["QtQuick3D.Helpers.impl/DepthOfFieldEffect 6.0"]
exportMetaObjectRevisions: [1536]
Property {
name: "enabled"
type: "bool"
read: "enabled"
write: "setEnabled"
notify: "enabledChanged"
index: 0
lineNumber: 65
}
Signal { name: "enabledChanged"; lineNumber: 74 }
}
Component {
file: "private/sceneeffects_p.h"
lineNumber: 50
name: "MainSceneEffect"
accessSemantics: "reference"
prototype: "SceneEffectBase"
exports: ["QtQuick3D.Helpers.impl/MainSceneEffect 6.0"]
exportMetaObjectRevisions: [1536]
}
Component {
file: "qabstractitemmodel.h"
lineNumber: 451
name: "QAbstractTableModel"
accessSemantics: "reference"
prototype: "QAbstractItemModel"
}
Component {
file: "private/qquick3drenderstatsmeshesmodel_p.h"
lineNumber: 24
name: "QQuick3DRenderStatsMeshesModel"
accessSemantics: "reference"
prototype: "QAbstractTableModel"
exports: [
"QtQuick3D.Helpers.impl/RenderStatsMeshesModel 6.0",
"QtQuick3D.Helpers.impl/RenderStatsMeshesModel 6.4"
]
exportMetaObjectRevisions: [1536, 1540]
Property {
name: "meshData"
type: "QString"
read: "meshData"
write: "setMeshData"
notify: "meshDataChanged"
index: 0
lineNumber: 27
}
Signal { name: "meshDataChanged"; lineNumber: 43 }
Method {
name: "setMeshData"
lineNumber: 40
Parameter { name: "newMeshData"; type: "QString" }
}
}
Component {
file: "private/qquick3drenderstatspassesmodel_p.h"
lineNumber: 24
name: "QQuick3DRenderStatsPassesModel"
accessSemantics: "reference"
prototype: "QAbstractTableModel"
exports: [
"QtQuick3D.Helpers.impl/RenderStatsPassesModel 6.0",
"QtQuick3D.Helpers.impl/RenderStatsPassesModel 6.4"
]
exportMetaObjectRevisions: [1536, 1540]
Property {
name: "passData"
type: "QString"
read: "passData"
write: "setPassData"
notify: "passDataChanged"
index: 0
lineNumber: 27
}
Signal { name: "passDataChanged"; lineNumber: 42 }
Method {
name: "setPassData"
lineNumber: 39
Parameter { name: "newPassData"; type: "QString" }
}
}
Component {
file: "private/qquick3drenderstatstexturesmodel_p.h"
lineNumber: 24
name: "QQuick3DRenderStatsTexturesModel"
accessSemantics: "reference"
prototype: "QAbstractTableModel"
exports: [
"QtQuick3D.Helpers.impl/RenderStatsTexturesModel 6.0",
"QtQuick3D.Helpers.impl/RenderStatsTexturesModel 6.4"
]
exportMetaObjectRevisions: [1536, 1540]
Property {
name: "textureData"
type: "QString"
read: "textureData"
write: "setTextureData"
notify: "textureDataChanged"
index: 0
lineNumber: 27
}
Signal { name: "textureDataChanged"; lineNumber: 43 }
Method {
name: "setTextureData"
lineNumber: 40
Parameter { name: "newTextureData"; type: "QString" }
}
}
Component {
file: "private/sceneeffects_p.h"
lineNumber: 26
name: "SceneEffectBase"
accessSemantics: "reference"
prototype: "QQuick3DEffect"
exports: ["QtQuick3D.Helpers.impl/SceneEffectBase 6.0"]
isCreatable: false
exportMetaObjectRevisions: [1536]
Property {
name: "environment"
type: "QQuick3DSceneEnvironment"
isPointer: true
read: "environment"
write: "setEnvironment"
notify: "environmentChanged"
index: 0
lineNumber: 29
}
Signal { name: "environmentChanged"; lineNumber: 39 }
}
Component {
file: "private/sceneeffects_p.h"
lineNumber: 82
name: "SceneEffectEnvironment"
accessSemantics: "reference"
prototype: "QQuick3DSceneEnvironment"
exports: [
"QtQuick3D.Helpers.impl/SceneEffectEnvironment 6.0",
"QtQuick3D.Helpers.impl/SceneEffectEnvironment 6.4",
"QtQuick3D.Helpers.impl/SceneEffectEnvironment 6.5",
"QtQuick3D.Helpers.impl/SceneEffectEnvironment 6.9"
]
exportMetaObjectRevisions: [1536, 1540, 1541, 1545]
}
}

View File

@@ -0,0 +1,11 @@
module QtQuick3D.Helpers.impl
linktarget Qt6::qtquick3dhelpersimplplugin
plugin qtquick3dhelpersimplplugin
classname QtQuick3DHelpersImplPlugin
typeinfo plugins.qmltypes
depends QtQuick3D auto
prefer :/qt-project.org/imports/QtQuick3D/Helpers/impl/
DepthOfFieldBlur 6.0 DepthOfFieldBlur.qml
SceneEffect 6.0 SceneEffect.qml
depends QtQuick

View File

@@ -0,0 +1,23 @@
module QtQuick3D.Helpers
linktarget Qt6::qtquick3dhelpersplugin
optional plugin qtquick3dhelpersplugin
classname QtQuick3DHelpersPlugin
designersupported
typeinfo plugins.qmltypes
depends QtQuick3D.Helpers.impl auto
depends QtQuick3D auto
prefer :/qt-project.org/imports/QtQuick3D/Helpers/
AxisHelper 6.0 AxisHelper.qml
AxisHelper 1.0 AxisHelper.qml
DebugView 6.0 DebugView.qml
DebugView 1.0 DebugView.qml
WasdController 6.0 WasdController.qml
WasdController 1.0 WasdController.qml
OrbitCameraController 6.0 OrbitCameraController.qml
OrbitCameraController 1.0 OrbitCameraController.qml
LodManager 6.0 LodManager.qml
LodManager 1.0 LodManager.qml
ExtendedSceneEnvironment 6.0 ExtendedSceneEnvironment.qml
ExtendedSceneEnvironment 1.0 ExtendedSceneEnvironment.qml
depends QtQuick