Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquick3dspecularglossymaterial_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QQUICK3DSPECULARGLOSSYMATERIAL_P_H
7#define QQUICK3DSPECULARGLOSSYMATERIAL_P_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version toSpecularGlossyMaterial
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtQuick3D/private/qquick3dmaterial_p.h>
21#include <QtQuick3D/private/qquick3dtexture_p.h>
22
23#include <QColor>
24#include <QHash>
25
27
28class Q_QUICK3D_EXPORT QQuick3DSpecularGlossyMaterial : public QQuick3DMaterial
29{
30 Q_OBJECT
31 Q_PROPERTY(Lighting lighting READ lighting WRITE setLighting NOTIFY lightingChanged)
32 Q_PROPERTY(BlendMode blendMode READ blendMode WRITE setBlendMode NOTIFY blendModeChanged)
33
34 Q_PROPERTY(QColor albedoColor READ albedoColor WRITE setAlbedoColor NOTIFY albedoColorChanged)
35 Q_PROPERTY(QQuick3DTexture *albedoMap READ albedoMap WRITE setAlbedoMap NOTIFY albedoMapChanged)
36 Q_PROPERTY(bool albedoSingleChannelEnabled READ albedoSingleChannelEnabled WRITE setAlbedoSingleChannelEnabled NOTIFY albedoSingleChannelEnabledChanged REVISION(6, 8))
37 Q_PROPERTY(QQuick3DMaterial::TextureChannelMapping albedoChannel READ albedoChannel WRITE setAlbedoChannel NOTIFY albedoChannelChanged REVISION(6, 8))
38
39 Q_PROPERTY(QColor specularColor READ specularColor WRITE setSpecularColor NOTIFY specularColorChanged)
40 Q_PROPERTY(QQuick3DTexture *specularMap READ specularMap WRITE setSpecularMap NOTIFY specularMapChanged)
41 Q_PROPERTY(bool specularSingleChannelEnabled READ specularSingleChannelEnabled WRITE setSpecularSingleChannelEnabled NOTIFY specularSingleChannelEnabledChanged REVISION(6, 8))
42 Q_PROPERTY(QQuick3DMaterial::TextureChannelMapping specularChannel READ specularChannel WRITE setSpecularChannel NOTIFY specularChannelChanged REVISION(6, 8))
43
44 Q_PROPERTY(float glossiness READ glossiness WRITE setGlossiness NOTIFY glossinessChanged)
45 Q_PROPERTY(QQuick3DTexture *glossinessMap READ glossinessMap WRITE setGlossinessMap NOTIFY glossinessMapChanged)
46 Q_PROPERTY(QQuick3DMaterial::TextureChannelMapping glossinessChannel READ glossinessChannel WRITE setGlossinessChannel NOTIFY glossinessChannelChanged)
47
48 Q_PROPERTY(QVector3D emissiveFactor READ emissiveFactor WRITE setEmissiveFactor NOTIFY emissiveFactorChanged)
49 Q_PROPERTY(QQuick3DTexture *emissiveMap READ emissiveMap WRITE setEmissiveMap NOTIFY emissiveMapChanged)
50 Q_PROPERTY(bool emissiveSingleChannelEnabled READ emissiveSingleChannelEnabled WRITE setEmissiveSingleChannelEnabled NOTIFY emissiveSingleChannelEnabledChanged REVISION(6, 8))
51 Q_PROPERTY(QQuick3DMaterial::TextureChannelMapping emissiveChannel READ emissiveChannel WRITE setEmissiveChannel NOTIFY emissiveChannelChanged REVISION(6, 8))
52
53 Q_PROPERTY(bool invertOpacityMapValue READ invertOpacityMapValue WRITE setInvertOpacityMapValue NOTIFY invertOpacityMapValueChanged REVISION(6, 8))
54 Q_PROPERTY(float opacity READ opacity WRITE setOpacity NOTIFY opacityChanged)
55 Q_PROPERTY(QQuick3DTexture *opacityMap READ opacityMap WRITE setOpacityMap NOTIFY opacityMapChanged)
56 Q_PROPERTY(QQuick3DMaterial::TextureChannelMapping opacityChannel READ opacityChannel WRITE setOpacityChannel NOTIFY opacityChannelChanged)
57
58 Q_PROPERTY(QQuick3DTexture *normalMap READ normalMap WRITE setNormalMap NOTIFY normalMapChanged)
59 Q_PROPERTY(float normalStrength READ normalStrength WRITE setNormalStrength NOTIFY normalStrengthChanged)
60
61 Q_PROPERTY(QQuick3DTexture *occlusionMap READ occlusionMap WRITE setOcclusionMap NOTIFY occlusionMapChanged)
62 Q_PROPERTY(QQuick3DMaterial::TextureChannelMapping occlusionChannel READ occlusionChannel WRITE setOcclusionChannel NOTIFY occlusionChannelChanged)
63 Q_PROPERTY(float occlusionAmount READ occlusionAmount WRITE setOcclusionAmount NOTIFY occlusionAmountChanged)
64
65 Q_PROPERTY(AlphaMode alphaMode READ alphaMode WRITE setAlphaMode NOTIFY alphaModeChanged)
66 Q_PROPERTY(float alphaCutoff READ alphaCutoff WRITE setAlphaCutoff NOTIFY alphaCutoffChanged)
67
68 Q_PROPERTY(float pointSize READ pointSize WRITE setPointSize NOTIFY pointSizeChanged)
69 Q_PROPERTY(float lineWidth READ lineWidth WRITE setLineWidth NOTIFY lineWidthChanged)
70
71 Q_PROPERTY(QQuick3DTexture *heightMap READ heightMap WRITE setHeightMap NOTIFY heightMapChanged)
72 Q_PROPERTY(QQuick3DMaterial::TextureChannelMapping heightChannel READ heightChannel WRITE setHeightChannel NOTIFY heightChannelChanged)
73 Q_PROPERTY(float heightAmount READ heightAmount WRITE setHeightAmount NOTIFY heightAmountChanged)
74 Q_PROPERTY(int minHeightMapSamples READ minHeightMapSamples WRITE setMinHeightMapSamples NOTIFY minHeightMapSamplesChanged)
75 Q_PROPERTY(int maxHeightMapSamples READ maxHeightMapSamples WRITE setMaxHeightMapSamples NOTIFY maxHeightMapSamplesChanged)
76
77 Q_PROPERTY(float clearcoatAmount READ clearcoatAmount WRITE setClearcoatAmount NOTIFY clearcoatAmountChanged)
78 Q_PROPERTY(QQuick3DTexture *clearcoatMap READ clearcoatMap WRITE setClearcoatMap NOTIFY clearcoatMapChanged)
79 Q_PROPERTY(QQuick3DMaterial::TextureChannelMapping clearcoatChannel READ clearcoatChannel WRITE setClearcoatChannel NOTIFY
80 clearcoatChannelChanged)
81 Q_PROPERTY(float clearcoatRoughnessAmount READ clearcoatRoughnessAmount WRITE setClearcoatRoughnessAmount NOTIFY
82 clearcoatRoughnessAmountChanged)
83 Q_PROPERTY(QQuick3DMaterial::TextureChannelMapping clearcoatRoughnessChannel READ clearcoatRoughnessChannel WRITE
84 setClearcoatRoughnessChannel NOTIFY clearcoatRoughnessChannelChanged)
85 Q_PROPERTY(QQuick3DTexture *clearcoatRoughnessMap READ clearcoatRoughnessMap WRITE setClearcoatRoughnessMap NOTIFY
86 clearcoatRoughnessMapChanged)
87 Q_PROPERTY(QQuick3DTexture *clearcoatNormalMap READ clearcoatNormalMap WRITE setClearcoatNormalMap NOTIFY
88 clearcoatNormalMapChanged)
89 Q_PROPERTY(float clearcoatNormalStrength READ clearcoatNormalStrength WRITE setClearcoatNormalStrength NOTIFY clearcoatNormalStrengthChanged REVISION(6, 8))
91 Q_PROPERTY(float transmissionFactor READ transmissionFactor WRITE setTransmissionFactor NOTIFY transmissionFactorChanged)
92 Q_PROPERTY(QQuick3DTexture * transmissionMap READ transmissionMap WRITE setTransmissionMap NOTIFY transmissionMapChanged)
93 Q_PROPERTY(QQuick3DMaterial::TextureChannelMapping transmissionChannel READ transmissionChannel WRITE setTransmissionChannel NOTIFY transmissionChannelChanged)
95 Q_PROPERTY(float thicknessFactor READ thicknessFactor WRITE setThicknessFactor NOTIFY thicknessFactorChanged)
96 Q_PROPERTY(QQuick3DTexture *thicknessMap READ thicknessMap WRITE setThicknessMap NOTIFY thicknessMapChanged)
97 Q_PROPERTY(QQuick3DMaterial::TextureChannelMapping thicknessChannel READ thicknessChannel WRITE setThicknessChannel NOTIFY
98 thicknessChannelChanged)
99 Q_PROPERTY(float attenuationDistance READ attenuationDistance WRITE setAttenuationDistance NOTIFY attenuationDistanceChanged)
100 Q_PROPERTY(QColor attenuationColor READ attenuationColor WRITE setAttenuationColor NOTIFY attenuationColorChanged)
102 Q_PROPERTY(bool vertexColorsEnabled READ vertexColorsEnabled WRITE setVertexColorsEnabled NOTIFY vertexColorsEnabledChanged REVISION(6, 5))
104 Q_PROPERTY(bool fresnelScaleBiasEnabled READ fresnelScaleBiasEnabled WRITE setFresnelScaleBiasEnabled NOTIFY fresnelScaleBiasEnabledChanged REVISION(6, 8))
105 Q_PROPERTY(float fresnelScale READ fresnelScale WRITE setFresnelScale NOTIFY fresnelScaleChanged REVISION(6, 8))
106 Q_PROPERTY(float fresnelBias READ fresnelBias WRITE setFresnelBias NOTIFY fresnelBiasChanged REVISION(6, 8))
107 Q_PROPERTY(float fresnelPower READ fresnelPower WRITE setFresnelPower NOTIFY fresnelPowerChanged REVISION(6, 8))
109 Q_PROPERTY(bool clearcoatFresnelScaleBiasEnabled READ clearcoatFresnelScaleBiasEnabled WRITE setClearcoatFresnelScaleBiasEnabled NOTIFY clearcoatFresnelScaleBiasEnabledChanged REVISION(6, 8))
110 Q_PROPERTY(float clearcoatFresnelScale READ clearcoatFresnelScale WRITE setClearcoatFresnelScale NOTIFY clearcoatFresnelScaleChanged REVISION(6, 8))
111 Q_PROPERTY(float clearcoatFresnelBias READ clearcoatFresnelBias WRITE setClearcoatFresnelBias NOTIFY clearcoatFresnelBiasChanged REVISION(6, 8))
112 Q_PROPERTY(float clearcoatFresnelPower READ clearcoatFresnelPower WRITE setClearcoatFresnelPower NOTIFY clearcoatFresnelPowerChanged REVISION(6, 8))
113
114 Q_PROPERTY(bool vertexColorsMaskEnabled READ vertexColorsMaskEnabled WRITE setVertexColorsMaskEnabled NOTIFY vertexColorsMaskEnabledChanged REVISION(6, 8))
115 Q_PROPERTY(VertexColorMaskFlags vertexColorRedMask READ vertexColorRedMask WRITE setVertexColorRedMask NOTIFY vertexColorRedMaskChanged REVISION(6, 8))
116 Q_PROPERTY(VertexColorMaskFlags vertexColorGreenMask READ vertexColorGreenMask WRITE setVertexColorGreenMask NOTIFY vertexColorGreenMaskChanged REVISION(6, 8))
117 Q_PROPERTY(VertexColorMaskFlags vertexColorBlueMask READ vertexColorBlueMask WRITE setVertexColorBlueMask NOTIFY vertexColorBlueMaskChanged REVISION(6, 8))
118 Q_PROPERTY(VertexColorMaskFlags vertexColorAlphaMask READ vertexColorAlphaMask WRITE setVertexColorAlphaMask NOTIFY vertexColorAlphaMaskChanged REVISION(6, 8))
120 QML_NAMED_ELEMENT(SpecularGlossyMaterial)
121 QML_ADDED_IN_VERSION(6, 4)
122
123public:
124 enum Lighting {
125 NoLighting = 0,
126 FragmentLighting
127 };
128 Q_ENUM(Lighting)
129
130 enum BlendMode {
131 SourceOver = 0,
132 Screen,
133 Multiply
134 };
135 Q_ENUM(BlendMode)
136
137 enum AlphaMode {
138 Default = 0,
139 Mask,
140 Blend,
141 Opaque
142 };
143 Q_ENUM(AlphaMode)
145 enum VertexColorMask {
146 NoMask = QQuick3DMaterial::NoMask,
147 GlossinessMask = QQuick3DMaterial::RoughnessMask,
148 NormalStrengthMask = QQuick3DMaterial::NormalStrengthMask,
149 ClearcoatAmountMask = QQuick3DMaterial::ClearcoatAmountMask,
150 ClearcoatRoughnessAmountMask = QQuick3DMaterial::ClearcoatRoughnessAmountMask,
151 ClearcoatNormalStrengthMask = QQuick3DMaterial::NormalStrengthMask,
152 HeightAmountMask = QQuick3DMaterial::HeightAmountMask,
153 OcclusionAmountMask = QQuick3DMaterial::OcclusionAmountMask,
154 ThicknessFactorMask = QQuick3DMaterial::ThicknessFactorMask,
155 TransmissionFactorMask = QQuick3DMaterial::TransmissionFactorMask
156 };
157 Q_ENUM(VertexColorMask)
158 Q_DECLARE_FLAGS(VertexColorMaskFlags, VertexColorMask)
159 Q_FLAG(VertexColorMaskFlags)
160
161 explicit QQuick3DSpecularGlossyMaterial(QQuick3DObject *parent = nullptr);
162 ~QQuick3DSpecularGlossyMaterial() override;
164 Lighting lighting() const;
165 BlendMode blendMode() const;
166 QColor albedoColor() const;
167 QQuick3DTexture *albedoMap() const;
168 Q_REVISION(6, 8) bool albedoSingleChannelEnabled() const;
169 Q_REVISION(6, 8) TextureChannelMapping albedoChannel() const;
170 Q_REVISION(6, 8) bool specularSingleChannelEnabled() const;
171 Q_REVISION(6, 8) TextureChannelMapping specularChannel() const;
172 Q_REVISION(6, 8) bool emissiveSingleChannelEnabled() const;
173 Q_REVISION(6, 8) TextureChannelMapping emissiveChannel() const;
174 QQuick3DTexture *emissiveMap() const;
175 QVector3D emissiveFactor() const;
176 float glossiness() const;
177 QQuick3DTexture *glossinessMap() const;
178 Q_REVISION(6, 8) bool invertOpacityMapValue() const;
179 float opacity() const;
180 QQuick3DTexture *opacityMap() const;
181 QQuick3DTexture *normalMap() const;
182 QColor specularColor() const;
183 QQuick3DTexture *specularMap() const;
184 float normalStrength() const;
185 QQuick3DTexture *occlusionMap() const;
186 float occlusionAmount() const;
187 AlphaMode alphaMode() const;
188 float alphaCutoff() const;
189 TextureChannelMapping glossinessChannel() const;
190 TextureChannelMapping opacityChannel() const;
191 TextureChannelMapping occlusionChannel() const;
192 float pointSize() const;
193 float lineWidth() const;
194 QQuick3DTexture *heightMap() const;
195 TextureChannelMapping heightChannel() const;
196 float heightAmount() const;
197 int minHeightMapSamples() const;
198 int maxHeightMapSamples() const;
199
200 float clearcoatAmount() const;
201 QQuick3DTexture *clearcoatMap() const;
202 TextureChannelMapping clearcoatChannel() const;
203 float clearcoatRoughnessAmount() const;
204 TextureChannelMapping clearcoatRoughnessChannel() const;
205 QQuick3DTexture *clearcoatRoughnessMap() const;
206 QQuick3DTexture *clearcoatNormalMap() const;
207
208 float transmissionFactor() const;
209 QQuick3DTexture *transmissionMap() const;
210 TextureChannelMapping transmissionChannel() const;
211
212 float thicknessFactor() const;
213 QQuick3DTexture *thicknessMap() const;
214 TextureChannelMapping thicknessChannel() const;
215 float attenuationDistance() const;
216 QColor attenuationColor() const;
218 Q_REVISION(6, 8) bool fresnelScaleBiasEnabled() const;
219 Q_REVISION(6, 8) float fresnelScale() const;
220 Q_REVISION(6, 8) float fresnelBias() const;
221 Q_REVISION(6, 8) float fresnelPower() const;
223 Q_REVISION(6, 8) bool clearcoatFresnelScaleBiasEnabled() const;
224 Q_REVISION(6, 8) float clearcoatFresnelScale() const;
225 Q_REVISION(6, 8) float clearcoatFresnelBias() const;
226 Q_REVISION(6, 8) float clearcoatFresnelPower() const;
228 Q_REVISION(6, 5) bool vertexColorsEnabled() const;
229 Q_REVISION(6, 8) float clearcoatNormalStrength() const;
230
231 Q_REVISION(6, 8) bool vertexColorsMaskEnabled() const;
232 Q_REVISION(6, 8) VertexColorMaskFlags vertexColorRedMask() const;
233 Q_REVISION(6, 8) VertexColorMaskFlags vertexColorGreenMask() const;
234 Q_REVISION(6, 8) VertexColorMaskFlags vertexColorBlueMask() const;
235 Q_REVISION(6, 8) VertexColorMaskFlags vertexColorAlphaMask() const;
237public Q_SLOTS:
238 void setLighting(QQuick3DSpecularGlossyMaterial::Lighting lighting);
239 void setBlendMode(QQuick3DSpecularGlossyMaterial::BlendMode blendMode);
240 void setAlbedoColor(const QColor &albedo);
241 void setAlbedoMap(QQuick3DTexture *albedoMap);
242 Q_REVISION(6, 8) void setAlbedoSingleChannelEnabled(bool albedoSingleChannelEnabled);
243 Q_REVISION(6, 8) void setAlbedoChannel(QQuick3DMaterial::TextureChannelMapping channel);
244 Q_REVISION(6, 8) void setSpecularSingleChannelEnabled(bool specularSingleChannelEnabled);
245 Q_REVISION(6, 8) void setSpecularChannel(QQuick3DMaterial::TextureChannelMapping channel);
246 Q_REVISION(6, 8) void setEmissiveSingleChannelEnabled(bool emissiveSingleChannelEnabled);
247 Q_REVISION(6, 8) void setEmissiveChannel(QQuick3DMaterial::TextureChannelMapping channel);
248 void setEmissiveMap(QQuick3DTexture *emissiveMap);
249 void setEmissiveFactor(const QVector3D &emissiveFactor);
250 void setGlossiness(float glossiness);
251 void setGlossinessMap(QQuick3DTexture *glossinessMap);
252 Q_REVISION(6, 8) void setInvertOpacityMapValue(bool invertOpacityMapValue);
253 void setOpacity(float opacity);
254 void setOpacityMap(QQuick3DTexture *opacityMap);
255 void setNormalMap(QQuick3DTexture *normalMap);
256 void setSpecularColor(const QColor &specular);
257 void setSpecularMap(QQuick3DTexture *specularMap);
258 void setNormalStrength(float normalStrength);
259 void setOcclusionMap(QQuick3DTexture *occlusionMap);
260 void setOcclusionAmount(float occlusionAmount);
261 void setAlphaMode(QQuick3DSpecularGlossyMaterial::AlphaMode alphaMode);
262 void setAlphaCutoff(float alphaCutoff);
263 void setGlossinessChannel(QQuick3DMaterial::TextureChannelMapping channel);
264 void setOpacityChannel(QQuick3DMaterial::TextureChannelMapping channel);
265 void setOcclusionChannel(QQuick3DMaterial::TextureChannelMapping channel);
266 void setPointSize(float size);
267 void setLineWidth(float width);
268 void setHeightMap(QQuick3DTexture *heightMap);
269 void setHeightChannel(QQuick3DMaterial::TextureChannelMapping channel);
270 void setHeightAmount(float heightAmount);
271 void setMinHeightMapSamples(int samples);
272 void setMaxHeightMapSamples(int samples);
273
274 void setClearcoatAmount(float newClearcoatAmount);
275 void setClearcoatMap(QQuick3DTexture *newClearcoatMap);
276 void setClearcoatChannel(QQuick3DMaterial::TextureChannelMapping newClearcoatChannel);
277 void setClearcoatRoughnessAmount(float newClearcoatRoughnessAmount);
278 void setClearcoatRoughnessChannel(QQuick3DMaterial::TextureChannelMapping newClearcoatRoughnessChannel);
279 void setClearcoatRoughnessMap(QQuick3DTexture *newClearcoatRoughnessMap);
280 void setClearcoatNormalMap(QQuick3DTexture *newClearcoatNormalMap);
281 Q_REVISION(6, 8) void setClearcoatNormalStrength( float newClearcoatNormalStrength );
282
283 void setTransmissionFactor(float newTransmissionFactor);
284 void setTransmissionMap(QQuick3DTexture *newTransmissionMap);
285 void setTransmissionChannel(QQuick3DMaterial::TextureChannelMapping newTransmissionChannel);
286
287 void setThicknessFactor(float newThicknessFactor);
288 void setThicknessMap(QQuick3DTexture *newThicknessMap);
289 void setThicknessChannel(QQuick3DMaterial::TextureChannelMapping newThicknessChannel);
290 void setAttenuationDistance(float newAttenuationDistance);
291 void setAttenuationColor(const QColor &newAttenuationColor);
293 Q_REVISION(6, 8) void setFresnelScaleBiasEnabled(bool fresnelScaleBias);
294 Q_REVISION(6, 8) void setFresnelScale(float fresnelScale);
295 Q_REVISION(6, 8) void setFresnelBias(float fresnelBias);
296 Q_REVISION(6, 8) void setFresnelPower(float fresnelPower);
298 Q_REVISION(6, 8) void setClearcoatFresnelScaleBiasEnabled(bool clearcoatFresnelScaleBias);
299 Q_REVISION(6, 8) void setClearcoatFresnelScale(float clearcoatFresnelScale);
300 Q_REVISION(6, 8) void setClearcoatFresnelBias(float clearcoatFresnelBias);
301 Q_REVISION(6, 8) void setClearcoatFresnelPower(float clearcoatFresnelPower);
303 Q_REVISION(6, 5) void setVertexColorsEnabled(bool vertexColorsEnabled);
304
305 Q_REVISION(6, 8) void setVertexColorsMaskEnabled(bool vertexColorsMaskEnabled);
306 Q_REVISION(6, 8) void setVertexColorRedMask(VertexColorMaskFlags vertexColorRedMask);
307 Q_REVISION(6, 8) void setVertexColorGreenMask(VertexColorMaskFlags vertexColorGreenMask);
308 Q_REVISION(6, 8) void setVertexColorBlueMask(VertexColorMaskFlags vertexColorBlueMask);
309 Q_REVISION(6, 8) void setVertexColorAlphaMask(VertexColorMaskFlags vertexColorAlphaMask);
311Q_SIGNALS:
312 void lightingChanged();
313 void blendModeChanged();
314 void albedoColorChanged();
315 void albedoMapChanged();
316 Q_REVISION(6, 8) void albedoSingleChannelEnabledChanged();
317 Q_REVISION(6, 8) void albedoChannelChanged();
318 Q_REVISION(6, 8) void specularSingleChannelEnabledChanged();
319 Q_REVISION(6, 8) void specularChannelChanged();
320 Q_REVISION(6, 8) void emissiveSingleChannelEnabledChanged();
321 Q_REVISION(6, 8) void emissiveChannelChanged();
322 void emissiveMapChanged();
323 void emissiveFactorChanged();
324 void glossinessChanged();
325 void glossinessMapChanged();
326 Q_REVISION(6, 8) void invertOpacityMapValueChanged();
327 void opacityChanged();
328 void opacityMapChanged();
329 void normalMapChanged();
330 void specularColorChanged();
331 void specularMapChanged();
332 void normalStrengthChanged();
333 void occlusionMapChanged();
334 void occlusionAmountChanged();
335 void alphaModeChanged();
336 void alphaCutoffChanged();
337 void glossinessChannelChanged();
338 void opacityChannelChanged();
339 void occlusionChannelChanged();
340 void pointSizeChanged();
341 void lineWidthChanged();
342 void heightMapChanged();
343 void heightChannelChanged();
344 void heightAmountChanged();
345 void minHeightMapSamplesChanged();
346 void maxHeightMapSamplesChanged();
348 void clearcoatAmountChanged();
349 void clearcoatMapChanged();
350 void clearcoatChannelChanged();
351 void clearcoatRoughnessAmountChanged();
352 void clearcoatRoughnessChannelChanged();
353 void clearcoatRoughnessMapChanged();
354 void clearcoatNormalMapChanged();
355 void clearcoatNormalStrengthChanged();
357 void transmissionFactorChanged();
358 void transmissionMapChanged();
359 void transmissionChannelChanged();
360
361 void thicknessFactorChanged();
362 void thicknessMapChanged();
363 void thicknessChannelChanged();
364 void attenuationDistanceChanged();
365 void attenuationColorChanged();
367 Q_REVISION(6, 5) void vertexColorsEnabledChanged(bool vertexColorsEnabled);
369 Q_REVISION(6, 8) void fresnelScaleBiasEnabledChanged(bool fresnelScaleBiasEnabled);
370 Q_REVISION(6, 8) void fresnelScaleChanged(float fresnelScale);
371 Q_REVISION(6, 8) void fresnelBiasChanged(float fresnelBias);
372 Q_REVISION(6, 8) void fresnelPowerChanged(float fresnelPower);
374 Q_REVISION(6, 8) void clearcoatFresnelScaleBiasEnabledChanged(bool clearcoatFresnelScaleBiasEnabled);
375 Q_REVISION(6, 8) void clearcoatFresnelScaleChanged(float clearcoatFresnelScale);
376 Q_REVISION(6, 8) void clearcoatFresnelBiasChanged(float clearcoatFresnelBias);
377 Q_REVISION(6, 8) void clearcoatFresnelPowerChanged(float clearcoatFresnelPower);
378
379 Q_REVISION(6, 8) void vertexColorsMaskEnabledChanged();
380 Q_REVISION(6, 8) void vertexColorRedMaskChanged();
381 Q_REVISION(6, 8) void vertexColorGreenMaskChanged();
382 Q_REVISION(6, 8) void vertexColorBlueMaskChanged();
383 Q_REVISION(6, 8) void vertexColorAlphaMaskChanged();
384
385protected:
386 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
387 void markAllDirty() override;
388 void itemChange(ItemChange, const ItemChangeData &) override;
389private:
390
391 enum DirtyType {
392 LightingModeDirty = 0x00000001,
393 BlendModeDirty = 0x00000002,
394 AlbedoDirty = 0x00000004,
395 EmissiveDirty = 0x00000008,
396 SpecularDirty = 0x00000010,
397 OpacityDirty = 0x00000020,
398 NormalDirty = 0x00000040,
399 GlossyDirty = 0x00000080,
400 OcclusionDirty = 0x00000100,
401 AlphaModeDirty = 0x00000200,
402 PointSizeDirty = 0x00000400,
403 LineWidthDirty = 0x00000800,
404 HeightDirty = 0x00001000,
405 ClearcoatDirty = 0x00002000,
406 TransmissionDirty = 0x00004000,
407 VolumeDirty = 0x00008000,
408 VertexColorsDirty = 0x00001000
409 };
410
411 void updateSceneManager(QQuick3DSceneManager *window);
412
413 Lighting m_lighting = FragmentLighting;
414 BlendMode m_blendMode = SourceOver;
415 AlphaMode m_alphaMode = Default;
416 QColor m_albedo = Qt::white;
417 QQuick3DTexture *m_albedoMap = nullptr;
418 bool m_albedoSingleChannelEnabled = false;
419 TextureChannelMapping m_albedoChannel = QQuick3DMaterial::R;
420 bool m_specularSingleChannelEnabled = false;
421 TextureChannelMapping m_specularChannel = QQuick3DMaterial::R;
422 bool m_emissiveSingleChannelEnabled = false;
423 TextureChannelMapping m_emissiveChannel = QQuick3DMaterial::R;
424 QVector3D m_emissiveFactor;
425 QQuick3DTexture *m_emissiveMap = nullptr;
426 QQuick3DTexture *m_glossinessMap = nullptr;
427 QQuick3DTexture *m_opacityMap = nullptr;
428 QQuick3DTexture *m_normalMap = nullptr;
429 QQuick3DTexture *m_specularMap = nullptr;
430 QQuick3DTexture *m_occlusionMap = nullptr;
431 float m_glossiness = 1.0f;
432 bool m_invertOpacityMapValue = false;
433 float m_opacity = 1.0f;
434 QColor m_specular = Qt::white;
435 float m_normalStrength = 1.0f;
436 float m_occlusionAmount = 1.0f;
437 float m_alphaCutoff = 0.5f;
438 TextureChannelMapping m_glossinessChannel = QQuick3DMaterial::A;
439 TextureChannelMapping m_opacityChannel = QQuick3DMaterial::A;
440 TextureChannelMapping m_occlusionChannel = QQuick3DMaterial::R;
441 float m_pointSize = 1.0f;
442 float m_lineWidth = 1.0f;
443 QQuick3DTexture *m_heightMap = nullptr;
444 TextureChannelMapping m_heightChannel = QQuick3DMaterial::R;
445 float m_heightAmount = 0.0f;
446 int m_minHeightMapSamples = 8;
447 int m_maxHeightMapSamples = 32;
448 float m_clearcoatAmount = 0.0f;
449 QQuick3DTexture *m_clearcoatMap = nullptr;
450 TextureChannelMapping m_clearcoatChannel = QQuick3DMaterial::R;
451 float m_clearcoatRoughnessAmount = 0.0f;
452 TextureChannelMapping m_clearcoatRoughnessChannel = QQuick3DMaterial::G;
453 QQuick3DTexture *m_clearcoatRoughnessMap = nullptr;
454 QQuick3DTexture *m_clearcoatNormalMap = nullptr;
455 float m_clearcoatNormalStrength = 1.0f;
456 float m_transmissionFactor = 0.0f;
457 QQuick3DTexture *m_transmissionMap = nullptr;
458 TextureChannelMapping m_transmissionChannel = QQuick3DMaterial::R;
459 float m_thicknessFactor = 0.0f;
460 QQuick3DTexture *m_thicknessMap = nullptr;
461 TextureChannelMapping m_thicknessChannel = QQuick3DMaterial::G;
462 float m_attenuationDistance = std::numeric_limits<float>::infinity();
463 QColor m_attenuationColor = Qt::white;
464 bool m_fresnelScaleBiasEnabled = false;
465 float m_fresnelScale = 1.0f;
466 float m_fresnelBias = 0.0f;
467 float m_fresnelPower = 5.0f;
468 bool m_clearcoatFresnelScaleBiasEnabled = false;
469 float m_clearcoatFresnelScale = 1.0f;
470 float m_clearcoatFresnelBias = 0.0f;
471 float m_clearcoatFresnelPower = 5.0f;
472 bool m_vertexColorsEnabled = true;
473 bool m_vertexColorsMaskEnabled = false;
474 VertexColorMaskFlags m_vertexColorRedMask = NoMask;
475 VertexColorMaskFlags m_vertexColorGreenMask = NoMask;
476 VertexColorMaskFlags m_vertexColorBlueMask = NoMask;
477 VertexColorMaskFlags m_vertexColorAlphaMask = NoMask;
478
479 quint32 m_dirtyAttributes = 0xffffffff; // all dirty by default
480 void markDirty(DirtyType type);
481
482 static constexpr float ensureNormalized(float val) { return qBound(0.0f, val, 1.0f); }
483};
484
485QT_END_NAMESPACE
486
487#endif // QQUICK3DSPECULARGLOSSYMATERIAL_P_H
Combined button and popup list for selecting options.