DefaultMaterialSection.qml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. // Copyright (C) 2021 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. Column {
  8. width: parent.width
  9. Section {
  10. caption: qsTr("Default Material")
  11. width: parent.width
  12. SectionLayout {
  13. PropertyLabel {
  14. text: qsTr("Lighting")
  15. tooltip: qsTr("Sets the lighting method. NoLighting is faster while FragmentLighting\ncalculates diffuse and specular lighting for each rendered pixel.")
  16. }
  17. SecondColumnLayout {
  18. ComboBox {
  19. scope: "DefaultMaterial"
  20. model: ["NoLighting", "FragmentLighting"]
  21. backendValue: backendValues.lighting
  22. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  23. + StudioTheme.Values.actionIndicatorWidth
  24. }
  25. ExpandingSpacer {}
  26. }
  27. PropertyLabel {
  28. text: qsTr("Blend Mode")
  29. tooltip: qsTr("Sets how the colors of the model blend with colors behind it.")
  30. }
  31. SecondColumnLayout {
  32. ComboBox {
  33. scope: "DefaultMaterial"
  34. model: ["SourceOver", "Screen", "Multiply"]
  35. backendValue: backendValues.blendMode
  36. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  37. + StudioTheme.Values.actionIndicatorWidth
  38. }
  39. ExpandingSpacer {}
  40. }
  41. PropertyLabel {
  42. text: qsTr("Enable Vertex Colors")
  43. tooltip: qsTr("Sets the material to use vertex colors from the mesh.\nVertex colors are multiplied with any other color for the material.")
  44. }
  45. SecondColumnLayout {
  46. CheckBox {
  47. text: backendValues.vertexColorsEnabled.valueToString
  48. backendValue: backendValues.vertexColorsEnabled
  49. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  50. + StudioTheme.Values.actionIndicatorWidth
  51. }
  52. ExpandingSpacer {}
  53. }
  54. PropertyLabel {
  55. text: qsTr("Point Size")
  56. tooltip: qsTr("Sets the size of the points rendered when the geometry is using a primitive type of points.")
  57. }
  58. SecondColumnLayout {
  59. SpinBox {
  60. minimumValue: -9999999
  61. maximumValue: 9999999
  62. decimals: 2
  63. backendValue: backendValues.pointSize
  64. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  65. + StudioTheme.Values.actionIndicatorWidth
  66. }
  67. }
  68. PropertyLabel {
  69. text: qsTr("Line Width")
  70. tooltip: qsTr("Sets the width of the lines rendered when the geometry is using a primitive type of lines or line strips.")
  71. }
  72. SecondColumnLayout {
  73. SpinBox {
  74. minimumValue: -9999999
  75. maximumValue: 9999999
  76. decimals: 2
  77. backendValue: backendValues.lineWidth
  78. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  79. + StudioTheme.Values.actionIndicatorWidth
  80. }
  81. }
  82. }
  83. }
  84. Section {
  85. caption: qsTr("Diffuse")
  86. width: parent.width
  87. SectionLayout {
  88. PropertyLabel {
  89. text: qsTr("Color")
  90. tooltip: qsTr("Sets the base color.")
  91. }
  92. ColorEditor {
  93. backendValue: backendValues.diffuseColor
  94. supportGradient: false
  95. }
  96. PropertyLabel {
  97. text: qsTr("Map")
  98. tooltip: qsTr("Sets a texture to apply to the material.")
  99. }
  100. SecondColumnLayout {
  101. ItemFilterComboBox {
  102. typeFilter: "QtQuick3D.Texture"
  103. backendValue: backendValues.diffuseMap
  104. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  105. + StudioTheme.Values.actionIndicatorWidth
  106. }
  107. ExpandingSpacer {}
  108. }
  109. }
  110. }
  111. Section {
  112. caption: qsTr("Emissive")
  113. width: parent.width
  114. ColumnLayout {
  115. spacing: StudioTheme.Values.transform3DSectionSpacing
  116. SectionLayout {
  117. PropertyLabel {
  118. text: qsTr("Factor")
  119. tooltip: qsTr("Sets the color of self-illumination.\nThe default value (0, 0, 0) means no self-illumination.")
  120. }
  121. SecondColumnLayout {
  122. SpinBox {
  123. minimumValue: 0
  124. maximumValue: 1
  125. decimals: 2
  126. stepSize: 0.01
  127. backendValue: backendValues.emissiveFactor_x
  128. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  129. + StudioTheme.Values.actionIndicatorWidth
  130. }
  131. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  132. ControlLabel {
  133. text: qsTr("R")
  134. color: StudioTheme.Values.theme3DAxisXColor
  135. }
  136. ExpandingSpacer {}
  137. }
  138. PropertyLabel {}
  139. SecondColumnLayout {
  140. SpinBox {
  141. minimumValue: 0
  142. maximumValue: 1
  143. decimals: 2
  144. stepSize: 0.01
  145. backendValue: backendValues.emissiveFactor_y
  146. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  147. + StudioTheme.Values.actionIndicatorWidth
  148. }
  149. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  150. ControlLabel {
  151. text: qsTr("G")
  152. color: StudioTheme.Values.theme3DAxisYColor
  153. }
  154. ExpandingSpacer {}
  155. }
  156. PropertyLabel {}
  157. SecondColumnLayout {
  158. SpinBox {
  159. minimumValue: 0
  160. maximumValue: 1
  161. decimals: 2
  162. stepSize: 0.01
  163. backendValue: backendValues.emissiveFactor_z
  164. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  165. + StudioTheme.Values.actionIndicatorWidth
  166. }
  167. Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
  168. ControlLabel {
  169. text: qsTr("B")
  170. color: StudioTheme.Values.theme3DAxisZColor
  171. }
  172. ExpandingSpacer {}
  173. }
  174. PropertyLabel {
  175. text: qsTr("Map")
  176. tooltip: qsTr("Sets a texture to define the intensity of the emissive color.")
  177. }
  178. SecondColumnLayout {
  179. ItemFilterComboBox {
  180. typeFilter: "QtQuick3D.Texture"
  181. backendValue: backendValues.emissiveMap
  182. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  183. + StudioTheme.Values.actionIndicatorWidth
  184. }
  185. ExpandingSpacer {}
  186. }
  187. }
  188. }
  189. }
  190. Section {
  191. caption: qsTr("Specular")
  192. width: parent.width
  193. SectionLayout {
  194. PropertyLabel {
  195. text: qsTr("Tint")
  196. tooltip: qsTr("Sets the color tint for the specular reflections.\nUse white for no color effect.")
  197. }
  198. ColorEditor {
  199. backendValue: backendValues.specularTint
  200. supportGradient: false
  201. }
  202. PropertyLabel {
  203. text: qsTr("Amount")
  204. tooltip: qsTr("Sets the strength of specularity (highlights and reflections).\nThe default value (0) disables specularity.")
  205. }
  206. SecondColumnLayout {
  207. SpinBox {
  208. minimumValue: 0
  209. maximumValue: 1
  210. decimals: 2
  211. stepSize: 0.1
  212. backendValue: backendValues.specularAmount
  213. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  214. + StudioTheme.Values.actionIndicatorWidth
  215. }
  216. ExpandingSpacer {}
  217. }
  218. PropertyLabel {
  219. text: qsTr("Map")
  220. tooltip: qsTr("Sets a texture to define the amount and the color of specularity.")
  221. }
  222. SecondColumnLayout {
  223. ItemFilterComboBox {
  224. typeFilter: "QtQuick3D.Texture"
  225. backendValue: backendValues.specularMap
  226. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  227. + StudioTheme.Values.actionIndicatorWidth
  228. }
  229. ExpandingSpacer {}
  230. }
  231. PropertyLabel {
  232. text: qsTr("Model")
  233. tooltip: qsTr("Sets the functions to calculate specular highlights for lights in the scene.\nDefault is faster while KGGX is more physically accurate.")
  234. }
  235. SecondColumnLayout {
  236. ComboBox {
  237. scope: "DefaultMaterial"
  238. model: ["Default", "KGGX"]
  239. backendValue: backendValues.specularModel
  240. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  241. + StudioTheme.Values.actionIndicatorWidth
  242. }
  243. ExpandingSpacer {}
  244. }
  245. PropertyLabel {
  246. text: qsTr("Reflection Map")
  247. tooltip: qsTr("Sets a texture to define specular highlights.")
  248. }
  249. SecondColumnLayout {
  250. ItemFilterComboBox {
  251. typeFilter: "QtQuick3D.Texture"
  252. backendValue: backendValues.specularReflectionMap
  253. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  254. + StudioTheme.Values.actionIndicatorWidth
  255. }
  256. ExpandingSpacer {}
  257. }
  258. PropertyLabel {
  259. text: qsTr("Index of Refraction")
  260. tooltip: qsTr("Sets the angles of reflections affected by the fresnel power.")
  261. }
  262. SecondColumnLayout {
  263. SpinBox {
  264. minimumValue: 1
  265. maximumValue: 3
  266. decimals: 2
  267. stepSize: 0.1
  268. backendValue: backendValues.indexOfRefraction
  269. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  270. + StudioTheme.Values.actionIndicatorWidth
  271. }
  272. ExpandingSpacer {}
  273. }
  274. PropertyLabel {
  275. text: qsTr("Fresnel Power")
  276. tooltip: qsTr("Sets the strength of the fresnel power. The default value (0) means no fresnel power while a higher value\ndecreases head-on reflections (looking directly at the surface) while maintaining reflections seen at grazing angles.")
  277. }
  278. SecondColumnLayout {
  279. SpinBox {
  280. minimumValue: -9999999
  281. maximumValue: 9999999
  282. decimals: 2
  283. backendValue: backendValues.fresnelPower
  284. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  285. + StudioTheme.Values.actionIndicatorWidth
  286. }
  287. ExpandingSpacer {}
  288. }
  289. PropertyLabel {
  290. text: qsTr("Specular Roughness")
  291. tooltip: qsTr("Sets the size of the specular highlight generated from lights and the clarity of reflections in general.")
  292. }
  293. SecondColumnLayout {
  294. SpinBox {
  295. minimumValue: 0.001
  296. maximumValue: 1
  297. decimals: 3
  298. stepSize: 0.1
  299. backendValue: backendValues.specularRoughness
  300. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  301. + StudioTheme.Values.actionIndicatorWidth
  302. }
  303. ExpandingSpacer {}
  304. }
  305. PropertyLabel {
  306. text: qsTr("Roughness Map")
  307. tooltip: qsTr("Sets a texture to define the specular roughness.")
  308. }
  309. SecondColumnLayout {
  310. ItemFilterComboBox {
  311. typeFilter: "QtQuick3D.Texture"
  312. backendValue: backendValues.roughnessMap
  313. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  314. + StudioTheme.Values.actionIndicatorWidth
  315. }
  316. ExpandingSpacer {}
  317. }
  318. PropertyLabel {
  319. text: qsTr("Roughness Channel")
  320. tooltip: qsTr("Sets the texture channel to read the roughness value from roughnessMap.")
  321. }
  322. SecondColumnLayout {
  323. ComboBox {
  324. scope: "Material"
  325. model: ["R", "G", "B", "A"]
  326. backendValue: backendValues.roughnessChannel
  327. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  328. + StudioTheme.Values.actionIndicatorWidth
  329. }
  330. ExpandingSpacer {}
  331. }
  332. }
  333. }
  334. Section {
  335. caption: qsTr("Opacity")
  336. width: parent.width
  337. SectionLayout {
  338. PropertyLabel {
  339. text: qsTr("Amount")
  340. tooltip: qsTr("Sets the opacity of just this material, separate from the model.")
  341. }
  342. SecondColumnLayout {
  343. SpinBox {
  344. minimumValue: 0
  345. maximumValue: 1
  346. decimals: 2
  347. stepSize: 0.1
  348. backendValue: backendValues.opacity
  349. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  350. + StudioTheme.Values.actionIndicatorWidth
  351. }
  352. ExpandingSpacer {}
  353. }
  354. PropertyLabel {
  355. text: qsTr("Map")
  356. tooltip: qsTr("Sets a texture to control the opacity differently for different parts.")
  357. }
  358. SecondColumnLayout {
  359. ItemFilterComboBox {
  360. typeFilter: "QtQuick3D.Texture"
  361. backendValue: backendValues.opacityMap
  362. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  363. + StudioTheme.Values.actionIndicatorWidth
  364. }
  365. ExpandingSpacer {}
  366. }
  367. PropertyLabel {
  368. text: qsTr("Channel")
  369. tooltip: qsTr("Sets the texture channel to read the opacity value from the opacity map.")
  370. }
  371. SecondColumnLayout {
  372. ComboBox {
  373. scope: "Material"
  374. model: ["R", "G", "B", "A"]
  375. backendValue: backendValues.opacityChannel
  376. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  377. + StudioTheme.Values.actionIndicatorWidth
  378. }
  379. ExpandingSpacer {}
  380. }
  381. }
  382. }
  383. Section {
  384. caption: qsTr("Bump/Normal")
  385. width: parent.width
  386. SectionLayout {
  387. PropertyLabel {
  388. text: qsTr("Bump Amount")
  389. tooltip: qsTr("Sets the amount of simulated displacement for the bump map or normal map.")
  390. }
  391. SecondColumnLayout {
  392. SpinBox {
  393. minimumValue: 0
  394. maximumValue: 1
  395. decimals: 2
  396. stepSize: 0.1
  397. backendValue: backendValues.bumpAmount
  398. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  399. + StudioTheme.Values.actionIndicatorWidth
  400. }
  401. ExpandingSpacer {}
  402. }
  403. PropertyLabel {
  404. text: qsTr("Bump Map")
  405. tooltip: qsTr("Sets a grayscale texture to simulate fine geometry displacement across the surface.")
  406. }
  407. SecondColumnLayout {
  408. ItemFilterComboBox {
  409. id: bumpMapComboBox
  410. typeFilter: "QtQuick3D.Texture"
  411. backendValue: backendValues.bumpMap
  412. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  413. + StudioTheme.Values.actionIndicatorWidth
  414. Connections {
  415. target: normalMapComboBox.backendValue
  416. function onExpressionChanged() {
  417. if (normalMapComboBox.backendValue.expression !== "")
  418. bumpMapComboBox.backendValue.resetValue()
  419. }
  420. }
  421. }
  422. ExpandingSpacer {}
  423. }
  424. PropertyLabel {
  425. text: qsTr("Normal Map")
  426. tooltip: qsTr("Sets a image to simulate fine geometry displacement across the surface.")
  427. }
  428. SecondColumnLayout {
  429. ItemFilterComboBox {
  430. id: normalMapComboBox
  431. typeFilter: "QtQuick3D.Texture"
  432. backendValue: backendValues.normalMap
  433. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  434. + StudioTheme.Values.actionIndicatorWidth
  435. Connections {
  436. target: bumpMapComboBox.backendValue
  437. function onExpressionChanged() {
  438. if (bumpMapComboBox.backendValue.expression !== "")
  439. normalMapComboBox.backendValue.resetValue()
  440. }
  441. }
  442. }
  443. ExpandingSpacer {}
  444. }
  445. }
  446. }
  447. Section {
  448. caption: qsTr("Translucency")
  449. width: parent.width
  450. SectionLayout {
  451. PropertyLabel {
  452. text: qsTr("Falloff")
  453. tooltip: qsTr("Sets the amount of falloff for the translucency based on the angle of the normals of the object to the light source.")
  454. }
  455. SecondColumnLayout {
  456. SpinBox {
  457. minimumValue: -999999
  458. maximumValue: 999999
  459. decimals: 2
  460. backendValue: backendValues.translucentFalloff
  461. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  462. + StudioTheme.Values.actionIndicatorWidth
  463. }
  464. ExpandingSpacer {}
  465. }
  466. PropertyLabel {
  467. text: qsTr("Diffuse Light Wrap")
  468. tooltip: qsTr("Sets the amount of light wrap for the translucency map.\nA value of 0 will not wrap the light at all, while a value of 1 will wrap the light all around the object.")
  469. }
  470. SecondColumnLayout {
  471. SpinBox {
  472. minimumValue: 0
  473. maximumValue: 1
  474. decimals: 2
  475. stepSize: 0.1
  476. backendValue: backendValues.diffuseLightWrap
  477. implicitWidth: StudioTheme.Values.twoControlColumnWidth
  478. + StudioTheme.Values.actionIndicatorWidth
  479. }
  480. ExpandingSpacer {}
  481. }
  482. PropertyLabel {
  483. text: qsTr("Map")
  484. tooltip: qsTr("Sets a grayscale texture to control how much light can pass through the material from behind.")
  485. }
  486. SecondColumnLayout {
  487. ItemFilterComboBox {
  488. typeFilter: "QtQuick3D.Texture"
  489. backendValue: backendValues.translucencyMap
  490. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  491. + StudioTheme.Values.actionIndicatorWidth
  492. }
  493. ExpandingSpacer {}
  494. }
  495. PropertyLabel {
  496. text: qsTr("Channel")
  497. tooltip: qsTr("Sets the texture channel to read the translucency value from translucencyMap.")
  498. }
  499. SecondColumnLayout {
  500. ComboBox {
  501. scope: "Material"
  502. model: ["R", "G", "B", "A"]
  503. backendValue: backendValues.translucencyChannel
  504. implicitWidth: StudioTheme.Values.singleControlColumnWidth
  505. + StudioTheme.Values.actionIndicatorWidth
  506. }
  507. ExpandingSpacer {}
  508. }
  509. }
  510. }
  511. }