CascadesSection.qml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. // Copyright (C) 2024 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
  3. import QtQuick 2.15
  4. import QtQuick.Layouts 1.15
  5. import HelperWidgets 2.0
  6. import StudioTheme 1.0 as StudioTheme
  7. Section {
  8. caption: qsTr("Cascades")
  9. width: parent.width
  10. SectionLayout {
  11. PropertyLabel {
  12. text: qsTr("No. Splits")
  13. tooltip: qsTr("The number of cascade splits for this light.")
  14. }
  15. SecondColumnLayout {
  16. ComboBox {
  17. id: numSplitsComboBox
  18. valueType: ComboBox.ValueType.Integer
  19. model: [0, 1, 2, 3]
  20. backendValue: backendValues.csmNumSplits
  21. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  22. + StudioTheme.Values.actionIndicatorWidth
  23. }
  24. ExpandingSpacer {}
  25. }
  26. PropertyLabel {
  27. visible: numSplitsComboBox.currentIndex > 0
  28. text: qsTr("Blend ratio")
  29. tooltip: qsTr("Defines how much of the shadow of any cascade should be blended together with the previous one.")
  30. }
  31. SecondColumnLayout {
  32. visible: numSplitsComboBox.currentIndex > 0
  33. SpinBox {
  34. minimumValue: 0
  35. maximumValue: 1
  36. decimals: 2
  37. stepSize: 0.01
  38. backendValue: backendValues.csmBlendRatio
  39. sliderIndicatorVisible: true
  40. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  41. + StudioTheme.Values.actionIndicatorWidth
  42. }
  43. ExpandingSpacer {}
  44. }
  45. PropertyLabel {
  46. visible: numSplitsComboBox.currentIndex > 0
  47. text: qsTr("Split 1")
  48. tooltip: qsTr("Defines where the first cascade of the shadow map split will occur.")
  49. }
  50. SecondColumnLayout {
  51. visible: numSplitsComboBox.currentIndex > 0
  52. SpinBox {
  53. minimumValue: 0
  54. maximumValue: 1
  55. decimals: 2
  56. stepSize: 0.01
  57. backendValue: backendValues.csmSplit1
  58. sliderIndicatorVisible: true
  59. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  60. + StudioTheme.Values.actionIndicatorWidth
  61. }
  62. ExpandingSpacer {}
  63. }
  64. PropertyLabel {
  65. visible: numSplitsComboBox.currentIndex > 1
  66. text: qsTr("Split 2")
  67. tooltip: qsTr("Defines where the second cascade of the shadow map split will occur.")
  68. }
  69. SecondColumnLayout {
  70. visible: numSplitsComboBox.currentIndex > 1
  71. SpinBox {
  72. minimumValue: 0
  73. maximumValue: 1
  74. decimals: 2
  75. stepSize: 0.01
  76. backendValue: backendValues.csmSplit2
  77. sliderIndicatorVisible: true
  78. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  79. + StudioTheme.Values.actionIndicatorWidth
  80. }
  81. ExpandingSpacer {}
  82. }
  83. PropertyLabel {
  84. visible: numSplitsComboBox.currentIndex > 2
  85. text: qsTr("Split 3")
  86. tooltip: qsTr("Defines where the third cascade of the shadow map split will occur.")
  87. }
  88. SecondColumnLayout {
  89. visible: numSplitsComboBox.currentIndex > 2
  90. SpinBox {
  91. minimumValue: 0
  92. maximumValue: 1
  93. decimals: 2
  94. stepSize: 0.01
  95. backendValue: backendValues.csmSplit3
  96. sliderIndicatorVisible: true
  97. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  98. + StudioTheme.Values.actionIndicatorWidth
  99. }
  100. ExpandingSpacer {}
  101. }
  102. PropertyLabel {
  103. text: qsTr("Lock Shadowmap Texels")
  104. tooltip: qsTr("Locks the shadowmap texels for this light to remove shadow edge shimmering.")
  105. }
  106. SecondColumnLayout {
  107. CheckBox {
  108. id: lockShadowmapTexelsCheckBox
  109. text: backendValues.lockShadowmapTexels.valueToString
  110. backendValue: backendValues.lockShadowmapTexels
  111. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  112. + StudioTheme.Values.actionIndicatorWidth
  113. }
  114. ExpandingSpacer {}
  115. }
  116. }
  117. }