Qt Quick 3D - Scene Effects Example▲
Sélectionnez
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import
QtQuick
import
QtQuick.Controls
import
QtQuick.Layouts
import
QtQuick3D
import
QtQuick3D.Helpers
Rectangle
{
id
:
toolPage
required property
Camera
camera
required property
var sceneEnvironment
required property
Texture lutTexture
ScrollView
{
anchors.fill
:
parent
anchors.margins
:
10
ScrollBar.horizontal.policy
:
ScrollBar.AlwaysOff
ColumnLayout
{
width
:
parent.width
// AA
SectionLayout {
id
:
antialiasingSection
title
:
&
quot;Antialiasing&
quot;
RowLayout
{
Label
{
text
:
&
quot;AA Mode&
quot;
Layout.fillWidth
:
true
}
ComboBox
{
id
:
antialiasingModeComboBox
textRole
:
&
quot;text
&
quot;
valueRole
:
&
quot;value
&
quot;
implicitContentWidthPolicy
:
ComboBox.WidestText
onActivated
:
sceneEnvironment.antialiasingMode =
currentValue
Component.onCompleted
:
antialiasingModeComboBox.currentIndex =
antialiasingModeComboBox.indexOfValue(sceneEnvironment.antialiasingMode)
model
:
[
{
value
:
SceneEnvironment.NoAA, text
:
&
quot;No Antialiasing&
quot;}
,
{
value
:
SceneEnvironment.SSAA, text
:
&
quot;Supersample AA&
quot;}
,
{
value
:
SceneEnvironment.MSAA, text
:
&
quot;Multisample AA&
quot;}
,
{
value
:
SceneEnvironment.ProgressiveAA, text
:
&
quot;Progressive AA&
quot;}
]
}
}
RowLayout
{
visible
:
sceneEnvironment.antialiasingMode !==
SceneEnvironment.NoAA
Label
{
text
:
&
quot;AA Quality&
quot;
Layout.fillWidth
:
true
}
ComboBox
{
id
:
antialiasingQualityComboBox
textRole
:
&
quot;text
&
quot;
valueRole
:
&
quot;value
&
quot;
implicitContentWidthPolicy
:
ComboBox.WidestText
onActivated
:
sceneEnvironment.antialiasingQuality =
currentValue
Component.onCompleted
:
antialiasingQualityComboBox.currentIndex =
antialiasingQualityComboBox.indexOfValue(sceneEnvironment.antialiasingQuality)
model
:
[
{
value
:
SceneEnvironment.Medium, text
:
&
quot;Medium&
quot;}
,
{
value
:
SceneEnvironment.High, text
:
&
quot;High&
quot;}
,
{
value
:
SceneEnvironment.VeryHigh, text
:
&
quot;VeryHigh&
quot;}
]
}
}
CheckBox
{
text
:
&
quot;Enable FXAA&
quot;
checked
:
sceneEnvironment.fxaaEnabled
onCheckedChanged
: {
sceneEnvironment.
fxaaEnabled =
checked
}
}
CheckBox
{
text
:
&
quot;Enable Temporal AA&
quot;
checked
:
sceneEnvironment.temporalAAEnabled
onCheckedChanged
: {
sceneEnvironment.
temporalAAEnabled =
checked
}
}
RowLayout
{
visible
:
sceneEnvironment.temporalAAEnabled
Label
{
text
:
&
quot;Temporal AA Strength (&
quot; +
sceneEnvironment.temporalAAStrength.toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
1.0
value
:
sceneEnvironment.temporalAAStrength
onValueChanged
:
sceneEnvironment.temporalAAStrength =
value
}
}
CheckBox
{
text
:
&
quot;Enable Specular AA&
quot;
checked
:
sceneEnvironment.specularAAEnabled
onCheckedChanged
: {
sceneEnvironment.
specularAAEnabled =
checked
}
}
}
// AO
SectionLayout {
id
:
aoSection
title
:
&
quot;Ambient Occlusion&
quot;
CheckBox
{
text
:
&
quot;Enable SSAO&
quot;
checked
:
sceneEnvironment.aoEnabled
onCheckedChanged
: {
sceneEnvironment.
aoEnabled =
checked
}
}
RowLayout
{
Label
{
text
:
&
quot;Strength (&
quot; +
(sceneEnvironment.aoStrength).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
100.0
value
:
sceneEnvironment.aoStrength
onValueChanged
: {
sceneEnvironment.
aoStrength =
value
}
}
}
RowLayout
{
Label
{
text
:
&
quot;Softness (&
quot; +
(sceneEnvironment.aoSoftness).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
50.0
value
:
sceneEnvironment.aoSoftness
onValueChanged
:
sceneEnvironment.aoSoftness =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Distance (&
quot; +
(sceneEnvironment.aoDistance).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
5.0
value
:
sceneEnvironment.aoDistance
onValueChanged
:
sceneEnvironment.aoDistance =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Sample Rate&
quot;
Layout.fillWidth
:
true
}
ComboBox
{
id
:
aoSampleRateComboBox
textRole
:
&
quot;text
&
quot;
valueRole
:
&
quot;value
&
quot;
implicitContentWidthPolicy
:
ComboBox.WidestText
onActivated
:
sceneEnvironment.aoSampleRate =
currentValue
Component.onCompleted
:
aoSampleRateComboBox.currentIndex =
aoSampleRateComboBox.indexOfValue(sceneEnvironment.aoSampleRate)
model
:
[
{
value
:
2
, text
:
&
quot;2
&
quot;}
,
{
value
:
3
, text
:
&
quot;3
&
quot;}
,
{
value
:
4
, text
:
&
quot;4
&
quot;}
]
}
}
RowLayout
{
Label
{
text
:
&
quot;Bias (&
quot; +
(sceneEnvironment.aoBias).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
-
1.0
to
:
1.0
stepSize
:
0.01
value
:
sceneEnvironment.aoBias
onValueChanged
:
sceneEnvironment.aoBias =
value
}
}
CheckBox
{
text
:
&
quot;Enable AO Dither&
quot;
checked
:
sceneEnvironment.aoDither
onCheckedChanged
: {
sceneEnvironment.
aoDither =
checked
}
}
}
// DOF
SectionLayout {
id
:
dofSection
title
:
&
quot;Depth of Field&
quot;
CheckBox
{
text
:
&
quot;Enabled&
quot;
checked
:
sceneEnvironment.depthOfFieldEnabled
onCheckedChanged
: {
sceneEnvironment.
depthOfFieldEnabled =
checked
}
}
Label
{
text
:
&
quot;Focus Distance (&
quot; +
(sceneEnvironment.depthOfFieldFocusDistance).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Label
{
text
:
&
quot;Focus Range (&
quot; +
(sceneEnvironment.depthOfFieldFocusRange).toFixed(2
) +&
quot;)&
quot;
Layout.fillWidth
:
true
}
Label
{
text
:
&
quot;Focus Near (&
quot; +
dofFocusSlider.first.value.toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Label
{
text
:
&
quot;Focus Far (&
quot; +
dofFocusSlider.second.value.toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
RangeSlider {
id
:
dofFocusSlider
from
:
camera.clipNear
to
:
camera.clipFar
Layout.fillWidth
:
true
Component.onCompleted
: {
first.
value =
sceneEnvironment.
depthOfFieldFocusDistance -
sceneEnvironment.
depthOfFieldFocusRange *
0
.
5
second.
value =
sceneEnvironment.
depthOfFieldFocusDistance +
sceneEnvironment.
depthOfFieldFocusRange *
0
.
5
}
first.onMoved
: {
sceneEnvironment.
depthOfFieldFocusRange =
second.
value -
first.
value
sceneEnvironment.
depthOfFieldFocusDistance =
first.
value +
sceneEnvironment.
depthOfFieldFocusRange *
0
.
5
}
second.onMoved
: {
sceneEnvironment.
depthOfFieldFocusRange =
second.
value -
first.
value
sceneEnvironment.
depthOfFieldFocusDistance =
first.
value +
sceneEnvironment.
depthOfFieldFocusRange *
0
.
5
}
}
RowLayout
{
Label
{
text
:
&
quot;Blur Amount (&
quot; +
(sceneEnvironment.depthOfFieldBlurAmount).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
25.0
value
:
sceneEnvironment.depthOfFieldBlurAmount
onValueChanged
:
sceneEnvironment.depthOfFieldBlurAmount =
value
}
}
}
// FOG
SectionLayout {
id
:
fogSection
title
:
&
quot;Fog&
quot;
CheckBox
{
text
:
&
quot;Enabled&
quot;
checked
:
sceneEnvironment.fog.enabled
onCheckedChanged
: {
sceneEnvironment.
fog.
enabled =
checked
}
}
RowLayout
{
Label
{
text
:
&
quot;Density (&
quot; +
sceneEnvironment.fog.density.toFixed(2
) +
&
quot;)&
quot;
}
Slider
{
id
:
valDensity
focusPolicy
:
Qt.NoFocus
Layout.fillWidth
:
true
from
:
0.0
to
:
1.0
value
:
sceneEnvironment.fog.density
onValueChanged
:
sceneEnvironment.fog.density =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Color&
quot;
Layout.fillWidth
:
true
}
ColorPicker {
color
:
sceneEnvironment.fog.color
onColorChanged
:
sceneEnvironment.fog.color =
color
}
}
// DEPTH FOG
CheckBox
{
text
:
&
quot;Depth fog enabled
&
quot;
checked
:
sceneEnvironment.fog.depthEnabled
onCheckedChanged
: {
sceneEnvironment.
fog.
depthEnabled =
checked
}
}
RowLayout
{
Label
{
text
:
&
quot;Near (&
quot; +
sceneEnvironment.fog.depthNear.toFixed(2
) +
&
quot;) /
Far (&
quot; +
sceneEnvironment.fog.depthFar.toFixed(2
) +
&
quot;)&
quot;
}
RangeSlider {
id
:
valDepth
focusPolicy
:
Qt.NoFocus
Layout.fillWidth
:
true
from
:
-
1000.0
to
:
1000.0
first.value
:
sceneEnvironment.fog.depthNear
second.value
:
sceneEnvironment.fog.depthFar
first.onValueChanged
:
sceneEnvironment.fog.depthNear =
first.value
second.onValueChanged
:
sceneEnvironment.fog.depthFar =
second.value
}
}
RowLayout
{
Label
{
text
:
&
quot;Curve (&
quot; +
sceneEnvironment.fog.depthCurve.toFixed(2
) +
&
quot;)&
quot;
}
Slider
{
id
:
valDepthCurve
focusPolicy
:
Qt.NoFocus
Layout.fillWidth
:
true
from
:
0.0
to
:
1.0
value
:
sceneEnvironment.fog.depthCurve
onValueChanged
:
sceneEnvironment.fog.depthCurve =
value
}
}
// HEIGHT FOG
CheckBox
{
text
:
&
quot;Height fog enabled
&
quot;
checked
:
sceneEnvironment.fog.heightEnabled
onCheckedChanged
: {
sceneEnvironment.
fog.
heightEnabled =
checked
}
}
RowLayout
{
Label
{
text
:
&
quot;Least Intense Y (&
quot; +
sceneEnvironment.fog.leastIntenseY.toFixed(2
) +
&
quot;)&
quot;
}
Slider
{
id
:
valHeightMin
focusPolicy
:
Qt.NoFocus
Layout.fillWidth
:
true
from
:
-
1000.0
to
:
1000.0
value
:
sceneEnvironment.fog.leastIntenseY
onValueChanged
:
sceneEnvironment.fog.leastIntenseY =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Most Intense Y (&
quot; +
sceneEnvironment.fog.mostIntenseY.toFixed(2
) +
&
quot;)&
quot;
}
Slider
{
id
:
valHeightMax
focusPolicy
:
Qt.NoFocus
Layout.fillWidth
:
true
from
:
-
1000.0
to
:
1000.0
value
:
sceneEnvironment.fog.mostIntenseY
onValueChanged
:
sceneEnvironment.fog.mostIntenseY =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Curve (&
quot; +
sceneEnvironment.fog.heightCurve.toFixed(2
) +
&
quot;)&
quot;
}
Slider
{
id
:
valHeightCurve
focusPolicy
:
Qt.NoFocus
Layout.fillWidth
:
true
from
:
0.0
to
:
100.0
value
:
sceneEnvironment.fog.heightCurve
onValueChanged
:
sceneEnvironment.fog.heightCurve =
value
}
}
// TRANSMISSION
CheckBox
{
text
:
&
quot;Light transmission enabled
&
quot;
checked
:
sceneEnvironment.fog.transmitEnabled
onCheckedChanged
: {
sceneEnvironment.
fog.
transmitEnabled =
checked
}
}
RowLayout
{
Label
{
text
:
&
quot;Curve (&
quot; +
sceneEnvironment.fog.transmitCurve.toFixed(2
) +
&
quot;)&
quot;
}
Slider
{
id
:
valTransmitCurve
focusPolicy
:
Qt.NoFocus
Layout.fillWidth
:
true
from
:
0.0
to
:
100.0
value
:
sceneEnvironment.fog.transmitCurve
onValueChanged
:
sceneEnvironment.fog.transmitCurve =
value
}
}
Button
{
text
:
&
quot;Reset to
Defaults&
quot;
onClicked
: {
sceneEnvironment.
fog.
enabled =
false
sceneEnvironment.
fog.
depthEnabled =
false
sceneEnvironment.
fog.
heightEnabled =
false
sceneEnvironment.
fog.
transmitEnabled =
false
sceneEnvironment.
fog.
density =
1
.
0
;
sceneEnvironment.
fog.
color =
Qt.rgba
(
0
.
5
,
0
.
6
,
0
.
7
,
1
.
0
);
sceneEnvironment.
fog.
depthNear =
10
.
0
;
sceneEnvironment.
fog.
depthFar =
1000
.
0
;
sceneEnvironment.
fog.
depthCurve =
1
.
0
;
sceneEnvironment.
fog.
leastIntenseY =
10
.
0
;
sceneEnvironment.
fog.
mostIntenseY =
0
.
0
;
sceneEnvironment.
fog.
heightCurve =
1
.
0
;
sceneEnvironment.
fog.
transmitCurve =
1
.
0
;
}
}
}
// GLOW
SectionLayout {
id
:
glowSection
title
:
&
quot;Glow
&
quot;
CheckBox
{
text
:
&
quot;Enable Glow
&
quot;
checked
:
sceneEnvironment.glowEnabled
onCheckedChanged
: {
sceneEnvironment.
glowEnabled =
checked
}
}
CheckBox
{
text
:
&
quot;High Quality Mode&
quot;
checked
:
sceneEnvironment.glowQualityHigh
onCheckedChanged
: {
sceneEnvironment.
glowQualityHigh =
checked
}
}
CheckBox
{
text
:
&
quot;Use Bicubic Upscale&
quot;
checked
:
sceneEnvironment.glowUseBicubicUpscale
onCheckedChanged
: {
sceneEnvironment.
glowUseBicubicUpscale =
checked
}
}
RowLayout
{
Label
{
text
:
&
quot;Strength (&
quot; +
(sceneEnvironment.glowStrength).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
2.0
value
:
sceneEnvironment.glowStrength
onValueChanged
:
sceneEnvironment.glowStrength =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Intensity (&
quot; +
(sceneEnvironment.glowIntensity).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
2.0
value
:
sceneEnvironment.glowIntensity
onValueChanged
:
sceneEnvironment.glowIntensity =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Bloom (&
quot; +
(sceneEnvironment.glowBloom).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
1.0
value
:
sceneEnvironment.glowBloom
onValueChanged
:
sceneEnvironment.glowBloom =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;HDR Upper Threshold (&
quot; +
(sceneEnvironment.glowHDRMaximumValue).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
256.0
value
:
sceneEnvironment.glowHDRMaximumValue
onValueChanged
:
sceneEnvironment.glowHDRMaximumValue =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;HDR Lower Threshold (&
quot; +
(sceneEnvironment.glowHDRMinimumValue).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
4.0
value
:
sceneEnvironment.glowHDRMinimumValue
onValueChanged
:
sceneEnvironment.glowHDRMinimumValue =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;HDR Scale
(&
quot; +
(sceneEnvironment.glowHDRScale).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
4.0
value
:
sceneEnvironment.glowHDRScale
onValueChanged
:
sceneEnvironment.glowHDRScale =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Blend
Mode&
quot;
Layout.fillWidth
:
true
}
ComboBox
{
id
:
glowBlendModeComboBox
textRole
:
&
quot;text
&
quot;
valueRole
:
&
quot;value
&
quot;
implicitContentWidthPolicy
:
ComboBox.WidestText
onActivated
:
sceneEnvironment.glowBlendMode =
currentValue
Component.onCompleted
:
glowBlendModeComboBox.currentIndex =
glowBlendModeComboBox.indexOfValue(sceneEnvironment.glowBlendMode)
model
:
[
{
value
:
ExtendedSceneEnvironment.GlowBlendMode.Additive, text
:
&
quot;Additive&
quot;}
,
{
value
:
ExtendedSceneEnvironment.GlowBlendMode.Screen, text
:
&
quot;Screen
&
quot;}
,
{
value
:
ExtendedSceneEnvironment.GlowBlendMode.SoftLight, text
:
&
quot;Softlight&
quot;}
,
{
value
:
ExtendedSceneEnvironment.GlowBlendMode.Replace, text
:
&
quot;Replace&
quot;}
]
}
}
RowLayout
{
id
:
glowLevelSettings
Label
{
text
:
&
quot;Glow
Level&
quot;
Layout.fillWidth
:
true
}
function
updateGlowLevels(value
, enable) {
if (
enable)
sceneEnvironment.
glowLevel |=
value
else
sceneEnvironment.
glowLevel &
amp;=
~
value
}
ColumnLayout
{
id
:
glowLevelCheckBoxes
function
isChecked(flag) {
return ((
sceneEnvironment.
glowLevel &
amp;
flag) ===
flag) }
CheckBox
{
text
:
qsTr(&
quot;One&
quot;)
checked
:
glowLevelCheckBoxes.isChecked(ExtendedSceneEnvironment.GlowLevel.One)
onCheckStateChanged
: {
glowLevelSettings.updateGlowLevels
(
ExtendedSceneEnvironment.
GlowLevel.
One,
checkState ===
Qt.
Checked)
}
}
CheckBox
{
text
:
qsTr(&
quot;Two&
quot;)
checked
:
glowLevelCheckBoxes.isChecked(ExtendedSceneEnvironment.GlowLevel.Two)
onCheckStateChanged
: {
glowLevelSettings.updateGlowLevels
(
ExtendedSceneEnvironment.
GlowLevel.
Two,
checkState ===
Qt.
Checked)
}
}
CheckBox
{
text
:
qsTr(&
quot;Three&
quot;)
checked
:
glowLevelCheckBoxes.isChecked(ExtendedSceneEnvironment.GlowLevel.Three)
onCheckStateChanged
: {
glowLevelSettings.updateGlowLevels
(
ExtendedSceneEnvironment.
GlowLevel.
Three,
checkState ===
Qt.
Checked)
}
}
CheckBox
{
text
:
qsTr(&
quot;Four&
quot;)
checked
:
glowLevelCheckBoxes.isChecked(ExtendedSceneEnvironment.GlowLevel.Four)
onCheckStateChanged
: {
glowLevelSettings.updateGlowLevels
(
ExtendedSceneEnvironment.
GlowLevel.
Four,
checkState ===
Qt.
Checked)
}
}
CheckBox
{
text
:
qsTr(&
quot;Five&
quot;)
checked
:
glowLevelCheckBoxes.isChecked(ExtendedSceneEnvironment.GlowLevel.Five)
onCheckStateChanged
: {
glowLevelSettings.updateGlowLevels
(
ExtendedSceneEnvironment.
GlowLevel.
Five,
checkState ===
Qt.
Checked)
}
}
CheckBox
{
text
:
qsTr(&
quot;Six&
quot;)
checked
:
glowLevelCheckBoxes.isChecked(ExtendedSceneEnvironment.GlowLevel.Six)
onCheckStateChanged
: {
glowLevelSettings.updateGlowLevels
(
ExtendedSceneEnvironment.
GlowLevel.
Six,
checkState ===
Qt.
Checked)
}
}
CheckBox
{
text
:
qsTr(&
quot;Seven&
quot;)
checked
:
glowLevelCheckBoxes.isChecked(ExtendedSceneEnvironment.GlowLevel.Seven)
onCheckStateChanged
: {
glowLevelSettings.updateGlowLevels
(
ExtendedSceneEnvironment.
GlowLevel.
Seven,
checkState ===
Qt.
Checked)
}
}
}
}
Button
{
text
:
&
quot;Reset to
Defaults&
quot;
onClicked
: {
sceneEnvironment.
glowQualityHigh =
false
sceneEnvironment.
glowUseBicubicUpscale =
false
sceneEnvironment.
glowStrength =
1
.
0
sceneEnvironment.
glowIntensity =
0
.
8
sceneEnvironment.
glowBloom =
0
.
0
sceneEnvironment.
glowBlendMode =
2
sceneEnvironment.
glowHDRMaximumValue =
12
.
0
sceneEnvironment.
glowHDRScale =
2
.
0
sceneEnvironment.
glowHDRMinimumValue =
1
.
0
sceneEnvironment.
glowLevel =
1
}
}
}
// TONEMAPPING
SectionLayout {
id
:
tonemappingSection
title
:
&
quot;Tonemapping&
quot;
RowLayout
{
Label
{
text
:
&
quot;Tonemapping Mode&
quot;
Layout.fillWidth
:
true
}
ComboBox
{
id
:
tonemappingModeComboBox
textRole
:
&
quot;text
&
quot;
valueRole
:
&
quot;value
&
quot;
implicitContentWidthPolicy
:
ComboBox.WidestText
onActivated
:
sceneEnvironment.tonemapMode =
currentValue
Component.onCompleted
:
tonemappingModeComboBox.currentIndex =
tonemappingModeComboBox.indexOfValue(sceneEnvironment.tonemapMode)
model
:
[
{
value
:
SceneEnvironment.TonemapModeNone, text
:
&
quot;None&
quot;}
,
{
value
:
SceneEnvironment.TonemapModeAces, text
:
&
quot;ACES&
quot;}
,
{
value
:
SceneEnvironment.TonemapModeFilmic, text
:
&
quot;Filmic&
quot;}
,
{
value
:
SceneEnvironment.TonemapModeHejlDawson, text
:
&
quot;HejlDawson&
quot;}
,
{
value
:
SceneEnvironment.TonemapModeLinear, text
:
&
quot;Linear&
quot;}
]
}
}
RowLayout
{
Label
{
text
:
&
quot;Exposure (&
quot; +
(sceneEnvironment.exposure).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
10.0
value
:
sceneEnvironment.exposure
onValueChanged
:
sceneEnvironment.exposure =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;White Point (&
quot; +
(sceneEnvironment.whitePoint).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
1.0
value
:
sceneEnvironment.whitePoint
onValueChanged
:
sceneEnvironment.whitePoint =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Sharpness Amount (&
quot; +
(sceneEnvironment.sharpnessAmount).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
1.0
value
:
sceneEnvironment.sharpnessAmount
onValueChanged
:
sceneEnvironment.sharpnessAmount =
value
}
}
CheckBox
{
text
:
&
quot;Enable Dithering&
quot;
checked
:
sceneEnvironment.ditheringEnabled
onCheckedChanged
: {
sceneEnvironment.
ditheringEnabled =
checked
}
}
Button
{
text
:
&
quot;Reset to
Defaults&
quot;
onClicked
: {
sceneEnvironment.
tonemapMode =
SceneEnvironment.
TonemapModeLinear
sceneEnvironment.
exposure =
1
.
0
sceneEnvironment.
whitePoint =
1
.
0
sceneEnvironment.
sharpnessAmount =
0
.
0
sceneEnvironment.
ditheringEnabled =
false
}
}
}
// ADJUSTMENT
SectionLayout {
id
:
adjustmentsSection
title
:
&
quot;Adjustments&
quot;
CheckBox
{
text
:
&
quot;Enable Color Adjustments&
quot;
checked
:
sceneEnvironment.colorAdjustmentsEnabled
onCheckedChanged
: {
sceneEnvironment.
colorAdjustmentsEnabled =
checked
}
}
RowLayout
{
Label
{
text
:
&
quot;Brightness (&
quot; +
(sceneEnvironment.adjustmentBrightness).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.01
to
:
8.0
stepSize
:
0.01
value
:
sceneEnvironment.adjustmentBrightness
onValueChanged
:
sceneEnvironment.adjustmentBrightness =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Contrast (&
quot; +
(sceneEnvironment.adjustmentContrast).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.01
to
:
8.0
stepSize
:
0.01
value
:
sceneEnvironment.adjustmentContrast
onValueChanged
:
sceneEnvironment.adjustmentContrast =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Saturation (&
quot; +
(sceneEnvironment.adjustmentSaturation).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.01
to
:
8.0
stepSize
:
0.01
value
:
sceneEnvironment.adjustmentSaturation
onValueChanged
:
sceneEnvironment.adjustmentSaturation =
value
}
}
Button
{
text
:
&
quot;Reset to
Defaults&
quot;
onClicked
: {
//sceneEnvironment.bcsAdjustments = Qt.vector3d(1.0, 1.0, 1.0);
sceneEnvironment.
adjustmentBrightness =
1
.
0
sceneEnvironment.
adjustmentContrast =
1
.
0
sceneEnvironment.
adjustmentSaturation =
1
.
0
}
}
}
// COLORGRADING
SectionLayout {
id
:
colorGradingSection
title
:
&
quot;Color Grading&
quot;
CheckBox
{
text
:
&
quot;Enable&
quot;
checked
:
sceneEnvironment.lutEnabled
onCheckedChanged
: {
sceneEnvironment.
lutEnabled =
checked
}
}
RowLayout
{
Label
{
text
:
&
quot;Alpha Filtering (&
quot; +
(sceneEnvironment.lutFilterAlpha).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
1.0
value
:
sceneEnvironment.lutFilterAlpha
onValueChanged
:
sceneEnvironment.lutFilterAlpha =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Look Up Texture (LUT)&
quot;
Layout.fillWidth
:
true
}
ComboBox
{
id
:
lutSourceTextureComboBox
textRole
:
&
quot;text
&
quot;
valueRole
:
&
quot;value
&
quot;
implicitContentWidthPolicy
:
ComboBox.WidestText
onActivated
:
lutTexture.source =
currentValue
Component.onCompleted
:
lutSourceTextureComboBox.currentIndex =
lutSourceTextureComboBox.indexOfValue(lutTexture.source)
model
:
[
{
value
:
Qt.url(&
quot;qrc
:/
luts/
grayscale.png&
quot;), text
:
&
quot;Greyscale&
quot;}
,
{
value
:
Qt.url(&
quot;qrc
:/
luts/
identity.png&
quot;), text
:
&
quot;Identity&
quot;}
,
{
value
:
Qt.url(&
quot;qrc
:/
luts/
inverted.png&
quot;), text
:
&
quot;Inverted&
quot;}
]
}
}
Button
{
text
:
&
quot;Reset to
Defaults&
quot;
onClicked
: {
sceneEnvironment.
lutFilterAlpha =
1
.
0
;
lutTexture.
source =
Qt.url
(&
quot;
qrc
:/
luts/
identity.
png&
quot;
);
}
}
}
// VIGNETTE
SectionLayout {
id
:
vignetteSection
title
:
&
quot;Vignette&
quot;
CheckBox
{
text
:
&
quot;Enable&
quot;
checked
:
sceneEnvironment.vignetteEnabled
onCheckedChanged
: {
sceneEnvironment.
vignetteEnabled =
checked
}
}
RowLayout
{
Label
{
text
:
&
quot;Vignette Strength(&
quot; +
(sceneEnvironment.vignetteStrength).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
15.0
value
:
sceneEnvironment.vignetteStrength
onValueChanged
:
sceneEnvironment.vignetteStrength =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Vignette Color&
quot;
Layout.fillWidth
:
true
}
ColorPicker {
color
:
sceneEnvironment.vignetteColor
onColorChanged
:
sceneEnvironment.vignetteColor =
color
}
}
RowLayout
{
Label
{
text
:
&
quot;Vignette Radius(&
quot; +
(sceneEnvironment.vignetteRadius).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
5.0
value
:
sceneEnvironment.vignetteRadius
onValueChanged
:
sceneEnvironment.vignetteRadius =
value
}
}
Button
{
text
:
&
quot;Reset to
Defaults&
quot;
onClicked
: {
sceneEnvironment.
vignetteStrength =
15
.
0
sceneEnvironment.
vignetteColor =
Qt.rgba
(
0
.
5
,
0
.
5
,
0
.
5
,
1
.
0
)
sceneEnvironment.
vignetteRadius =
0
.
35
}
}
}
// LENSFLARE
SectionLayout {
id
:
lensFlareSection
title
:
&
quot;Lens Flare&
quot;
CheckBox
{
text
:
&
quot;Enable&
quot;
checked
:
sceneEnvironment.lensFlareEnabled
onCheckedChanged
: {
sceneEnvironment.
lensFlareEnabled =
checked
}
}
RowLayout
{
Label
{
text
:
&
quot;Bloom Scale
(&
quot; +
(sceneEnvironment.lensFlareBloomScale).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
20.0
value
:
sceneEnvironment.lensFlareBloomScale
onValueChanged
:
sceneEnvironment.lensFlareBloomScale =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Bloom Bias(&
quot; +
(sceneEnvironment.lensFlareBloomBias).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
10.0
value
:
sceneEnvironment.lensFlareBloomBias
onValueChanged
:
sceneEnvironment.lensFlareBloomBias =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Ghost Dispersal(&
quot; +
(sceneEnvironment.lensFlareGhostDispersal).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
1.0
value
:
sceneEnvironment.lensFlareGhostDispersal
onValueChanged
:
sceneEnvironment.lensFlareGhostDispersal =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Ghost Count(&
quot; +
(sceneEnvironment.lensFlareGhostCount) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0
to
:
20
stepSize
:
1
value
:
sceneEnvironment.lensFlareGhostCount
onValueChanged
:
sceneEnvironment.lensFlareGhostCount =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Halo Width(&
quot; +
(sceneEnvironment.lensFlareHaloWidth).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
1.0
value
:
sceneEnvironment.lensFlareHaloWidth
onValueChanged
:
sceneEnvironment.lensFlareHaloWidth =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Stretch Aspect(&
quot; +
(sceneEnvironment.lensFlareStretchToAspect).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
1.0
value
:
sceneEnvironment.lensFlareStretchToAspect
onValueChanged
:
sceneEnvironment.lensFlareStretchToAspect =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Distortion(&
quot; +
(sceneEnvironment.lensFlareDistortion).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
20.0
value
:
sceneEnvironment.lensFlareDistortion
onValueChanged
:
sceneEnvironment.lensFlareDistortion =
value
}
}
RowLayout
{
Label
{
text
:
&
quot;Blur Amount(&
quot; +
(sceneEnvironment.lensFlareBlurAmount).toFixed(2
) +
&
quot;)&
quot;
Layout.fillWidth
:
true
}
Slider
{
from
:
0.0
to
:
50.0
value
:
sceneEnvironment.lensFlareBlurAmount
onValueChanged
:
sceneEnvironment.lensFlareBlurAmount =
value
}
}
CheckBox
{
text
:
&
quot;Apply Lens Dirt&
quot;
checked
:
sceneEnvironment.lensFlareApplyDirtTexture
onCheckedChanged
: {
sceneEnvironment.
lensFlareApplyDirtTexture =
checked
}
}
CheckBox
{
text
:
&
quot;Apply Starburst&
quot;
checked
:
sceneEnvironment.lensFlareApplyStarburstTexture
onCheckedChanged
: {
sceneEnvironment.
lensFlareApplyStarburstTexture =
checked
}
}
Button
{
text
:
&
quot;Reset to
Defaults&
quot;
onClicked
: {
sceneEnvironment.
lensFlareBloomScale =
10
sceneEnvironment.
lensFlareBloomBias =
2
.
75
sceneEnvironment.
lensFlareGhostDispersal =
0
.
5
sceneEnvironment.
lensFlareGhostCount =
4
sceneEnvironment.
lensFlareHaloWidth =
0
.
25
sceneEnvironment.
lensFlareStretchToAspect =
0
.
5
sceneEnvironment.
lensFlareDistortion =
5
sceneEnvironment.
lensFlareBlurAmount =
3
sceneEnvironment.
lensFlareApplyDirtTexture =
true
sceneEnvironment.
lensFlareApplyStarburstTexture =
true
}
}
}
}
}
}