1/****************************************************************************
2**
3** Copyright (C) 2020 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of Qt Quick 3D.
7**
8** $QT_BEGIN_LICENSE:GPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU
19** General Public License version 3 or (at your option) any later version
20** approved by the KDE Free Qt Foundation. The licenses are as published by
21** the Free Software Foundation and appearing in the file LICENSE.GPL3
22** included in the packaging of this file. Please review the following
23** information to ensure the GNU General Public License requirements will
24** be met: https://www.gnu.org/licenses/gpl-3.0.html.
25**
26** $QT_END_LICENSE$
27**
28****************************************************************************/
29
30import QtQuick 2.15
31import HelperWidgets 2.0
32import QtQuick.Layouts 1.12
33
34Column {
35    width: parent.width
36
37    Section {
38        caption: qsTr("Principled Material")
39        width: parent.width
40
41        SectionLayout {
42            Label {
43                text: qsTr("Alpha Mode")
44                tooltip: qsTr("Sets the mode for how the alpha channel of material color is used.")
45            }
46            SecondColumnLayout {
47                ComboBox {
48                    scope: "PrincipledMaterial"
49                    model: ["Opaque", "Mask", "Blend"]
50                    backendValue: backendValues.alphaMode
51                    Layout.fillWidth: true
52                }
53            }
54
55            Label {
56                text: qsTr("Alpha Cutoff")
57                tooltip: qsTr("Specifies the cutoff value when using the Mask alphaMode.")
58            }
59            SecondColumnLayout {
60                SpinBox {
61                    minimumValue: 0
62                    maximumValue: 1
63                    decimals: 2
64                    stepSize: 0.1
65                    backendValue: backendValues.alphaCutoff
66                    Layout.fillWidth: true
67                }
68            }
69
70            Label {
71                text: qsTr("Blend Mode")
72                tooltip: qsTr("Determines how the colors of the model rendered blend with those behind it.")
73            }
74            SecondColumnLayout {
75                ComboBox {
76                    scope: "PrincipledMaterial"
77                    model: ["SourceOver", "Screen", "Multiply", "Overlay", "ColorBurn", "ColorDodge"]
78                    backendValue: backendValues.blendMode
79                    Layout.fillWidth: true
80                }
81            }
82
83            Label {
84                text: qsTr("Index Of Refraction")
85                tooltip: qsTr("Controls how fast light travels through the material.")
86            }
87            SecondColumnLayout {
88                SpinBox {
89                    minimumValue: 1
90                    maximumValue: 3
91                    decimals: 2
92                    stepSize: 0.1
93                    backendValue: backendValues.indexOfRefraction
94                    Layout.fillWidth: true
95                }
96            }
97
98            Label {
99                text: qsTr("Lighting")
100                tooltip: qsTr("Defines which lighting method is used when generating this material.")
101            }
102            SecondColumnLayout {
103                ComboBox {
104                    scope: "PrincipledMaterial"
105                    model: ["NoLighting", "FragmentLighting"]
106                    backendValue: backendValues.lighting
107                    Layout.fillWidth: true
108                }
109            }
110        }
111    }
112
113    Section {
114        caption: qsTr("Metalness")
115        width: parent.width
116        SectionLayout {
117            Label {
118                text: qsTr("Metalness")
119                tooltip: qsTr("Defines the metalness of the the material.")
120            }
121            SecondColumnLayout {
122                SpinBox {
123                    minimumValue: 0
124                    maximumValue: 1
125                    decimals: 2
126                    stepSize: 0.1
127                    backendValue: backendValues.metalness
128                    Layout.fillWidth: true
129                }
130            }
131
132            Label {
133                text: qsTr("Metalness Map")
134                tooltip: qsTr("Sets a texture to be used to set the metalness amount for the different parts of the material.")
135            }
136            SecondColumnLayout {
137                IdComboBox {
138                    typeFilter: "QtQuick3D.Texture"
139                    Layout.fillWidth: true
140                    backendValue: backendValues.metalnessMap
141                }
142            }
143
144            Label {
145                text: qsTr("Metalness Channel")
146                tooltip: qsTr("Defines the texture channel used to read the metalness value from metalnessMap.")
147            }
148            SecondColumnLayout {
149                ComboBox {
150                    scope: "Material"
151                    model: ["R", "G", "B", "A"]
152                    backendValue: backendValues.metalnessChannel
153                    Layout.fillWidth: true
154                }
155            }
156        }
157    }
158
159    Section {
160        caption: qsTr("Normal")
161        width: parent.width
162        SectionLayout {
163            Label {
164                text: qsTr("Normal Map")
165                tooltip: qsTr("Defines an RGB image used to simulate fine geometry displacement across the surface of the material.")
166            }
167            SecondColumnLayout {
168                IdComboBox {
169                    typeFilter: "QtQuick3D.Texture"
170                    Layout.fillWidth: true
171                    backendValue: backendValues.normalMap
172                }
173            }
174
175            Label {
176                text: qsTr("Normal Strength")
177                tooltip: qsTr("Controls the amount of simulated displacement for the normalMap.")
178            }
179            SecondColumnLayout {
180                SpinBox {
181                    minimumValue: 0
182                    maximumValue: 1
183                    decimals: 2
184                    stepSize: 0.1
185                    backendValue: backendValues.normalStrength
186                    Layout.fillWidth: true
187                }
188            }
189        }
190    }
191
192    Section {
193        caption: qsTr("Occlusion")
194        width: parent.width
195        SectionLayout {
196            Label {
197                text: qsTr("Occlusion Amount")
198                tooltip: qsTr("Contains the factor used to modify the values from the occlusionMap texture.")
199            }
200            SecondColumnLayout {
201                SpinBox {
202                    minimumValue: 0
203                    maximumValue: 1
204                    decimals: 2
205                    stepSize: 0.1
206                    backendValue: backendValues.occlusionAmount
207                    Layout.fillWidth: true
208                }
209            }
210
211            Label {
212                text: qsTr("Occlusion Map")
213                tooltip: qsTr("Defines a texture used to determine how much indirect light the different areas of the material should receive.")
214            }
215            SecondColumnLayout {
216                IdComboBox {
217                    typeFilter: "QtQuick3D.Texture"
218                    Layout.fillWidth: true
219                    backendValue: backendValues.occlusionMap
220                }
221            }
222
223            Label {
224                text: qsTr("Occlusion Channel")
225                tooltip: qsTr("Defines the texture channel used to read the occlusion value from occlusionMap.")
226            }
227            SecondColumnLayout {
228                ComboBox {
229                    scope: "Material"
230                    model: ["R", "G", "B", "A"]
231                    backendValue: backendValues.occlusionChannel
232                    Layout.fillWidth: true
233                }
234            }
235        }
236    }
237
238    Section {
239        caption: qsTr("Opacity")
240        width: parent.width
241        SectionLayout {
242            Label {
243                text: qsTr("Opacity")
244                tooltip: qsTr("Drops the opacity of just this material, separate from the model.")
245            }
246            SecondColumnLayout {
247                SpinBox {
248                    maximumValue: 1
249                    minimumValue: 0
250                    decimals: 2
251                    stepSize: 0.1
252                    backendValue: backendValues.opacity
253                    Layout.fillWidth: true
254                }
255            }
256
257            Label {
258                text: qsTr("Opacity Map")
259                tooltip: qsTr("Defines a texture used to control the opacity differently for different parts of the material.")
260            }
261            SecondColumnLayout {
262                IdComboBox {
263                    typeFilter: "QtQuick3D.Texture"
264                    Layout.fillWidth: true
265                    backendValue: backendValues.opacityMap
266                }
267            }
268
269            Label {
270                text: qsTr("Opacity Channel")
271                tooltip: qsTr("Defines the texture channel used to read the opacity value from opacityMap.")
272            }
273            SecondColumnLayout {
274                ComboBox {
275                    scope: "Material"
276                    model: ["R", "G", "B", "A"]
277                    backendValue: backendValues.opacityChannel
278                    Layout.fillWidth: true
279                }
280            }
281        }
282    }
283
284    Section {
285        caption: qsTr("Roughness")
286        width: parent.width
287        SectionLayout {
288            Label {
289                text: qsTr("Roughness")
290                tooltip: qsTr("Controls the size of the specular highlight generated from lights, and the clarity of reflections in general.")
291            }
292            SecondColumnLayout {
293                SpinBox {
294                    minimumValue: 0
295                    maximumValue: 1
296                    decimals: 2
297                    stepSize: 0.1
298                    backendValue: backendValues.roughness
299                    Layout.fillWidth: true
300                }
301            }
302
303            Label {
304                text: qsTr("Roughness Map")
305                tooltip: qsTr("Defines a texture to control the specular roughness of the material.")
306            }
307            SecondColumnLayout {
308                IdComboBox {
309                    typeFilter: "QtQuick3D.Texture"
310                    Layout.fillWidth: true
311                    backendValue: backendValues.roughnessMap
312                }
313            }
314
315            Label {
316                text: qsTr("Roughness Channel")
317                tooltip: qsTr("Defines the texture channel used to read the roughness value from roughnessMap.")
318            }
319            SecondColumnLayout {
320                ComboBox {
321                    scope: "Material"
322                    model: ["R", "G", "B", "A"]
323                    backendValue: backendValues.roughnessChannel
324                    Layout.fillWidth: true
325                }
326            }
327        }
328    }
329
330    Section {
331        caption: qsTr("Specular")
332        width: parent.width
333        SectionLayout {
334            Label {
335                text: qsTr("Specular Amount")
336                tooltip: qsTr("Controls the strength of specularity (highlights and reflections).")
337            }
338            SecondColumnLayout {
339                SpinBox {
340                    minimumValue: 0
341                    maximumValue: 1
342                    decimals: 2
343                    stepSize: 0.1
344                    backendValue: backendValues.specularAmount
345                    Layout.fillWidth: true
346                }
347            }
348
349            Label {
350                text: qsTr("Specular Map")
351                tooltip: qsTr("Defines a RGB Texture to modulate the amount and the color of specularity across the surface of the material.")
352            }
353            SecondColumnLayout {
354                IdComboBox {
355                    typeFilter: "QtQuick3D.Texture"
356                    Layout.fillWidth: true
357                    backendValue: backendValues.specularMap
358                }
359            }
360
361            Label {
362                text: qsTr("Specular Reflection Map")
363                tooltip: qsTr("Sets a texture used for specular highlights on the material.")
364            }
365            SecondColumnLayout {
366                IdComboBox {
367                    typeFilter: "QtQuick3D.Texture"
368                    Layout.fillWidth: true
369                    backendValue: backendValues.specularReflectionMap
370                }
371            }
372
373            Label {
374                text: qsTr("Specular Tint")
375                tooltip: qsTr("Defines how much of the base color contributes to the specular reflections.")
376            }
377            SecondColumnLayout {
378                SpinBox {
379                    minimumValue: 0
380                    maximumValue: 1
381                    decimals: 2
382                    stepSize: 0.1
383                    backendValue: backendValues.specularTint
384                    Layout.fillWidth: true
385                }
386            }
387        }
388    }
389
390    Section {
391        caption: qsTr("Base Color")
392        width: parent.width
393
394        Column {
395            width: parent.width
396
397            ColorEditor {
398                caption: qsTr("Base Color")
399                backendValue: backendValues.baseColor
400                supportGradient: false
401                Layout.fillWidth: true
402            }
403            SectionLayout {
404                Label {
405                    text: qsTr("Base Color Map")
406                    tooltip: qsTr("Defines a texture used to set the base color of the material.")
407                }
408                SecondColumnLayout {
409                    IdComboBox {
410                        typeFilter: "QtQuick3D.Texture"
411                        Layout.fillWidth: true
412                        backendValue: backendValues.baseColorMap
413                    }
414                }
415            }
416        }
417    }
418
419    Section {
420        caption: qsTr("Emissive Color")
421        width: parent.width
422
423        Column {
424            width: parent.width
425
426            ColorEditor {
427                caption: qsTr("Emissive Color")
428                backendValue: backendValues.emissiveColor
429                supportGradient: false
430                Layout.fillWidth: true
431            }
432            SectionLayout {
433                Label {
434                    text: qsTr("Emissive Map")
435                    tooltip: qsTr("Sets a texture to be used to set the emissive factor for different parts of the material.")
436                }
437                SecondColumnLayout {
438                    IdComboBox {
439                        typeFilter: "QtQuick3D.Texture"
440                        Layout.fillWidth: true
441                        backendValue: backendValues.emissiveMap
442                    }
443                }
444            }
445        }
446    }
447}
448