32 Q_PROPERTY(
QColor albedoColor READ albedoColor WRITE setAlbedoColor NOTIFY albedoColorChanged)
34 Q_PROPERTY(
bool albedoSingleChannelEnabled READ albedoSingleChannelEnabled WRITE setAlbedoSingleChannelEnabled NOTIFY albedoSingleChannelEnabledChanged REVISION(6, 8))
37 Q_PROPERTY(
QColor specularColor READ specularColor WRITE setSpecularColor NOTIFY specularColorChanged)
39 Q_PROPERTY(
bool specularSingleChannelEnabled READ specularSingleChannelEnabled WRITE setSpecularSingleChannelEnabled NOTIFY specularSingleChannelEnabledChanged REVISION(6, 8))
42 Q_PROPERTY(
float glossiness READ glossiness WRITE setGlossiness NOTIFY glossinessChanged)
46 Q_PROPERTY(
QVector3D emissiveFactor READ emissiveFactor WRITE setEmissiveFactor NOTIFY emissiveFactorChanged)
48 Q_PROPERTY(
bool emissiveSingleChannelEnabled READ emissiveSingleChannelEnabled WRITE setEmissiveSingleChannelEnabled NOTIFY emissiveSingleChannelEnabledChanged REVISION(6, 8))
51 Q_PROPERTY(
bool invertOpacityMapValue READ invertOpacityMapValue WRITE setInvertOpacityMapValue NOTIFY invertOpacityMapValueChanged REVISION(6, 8))
52 Q_PROPERTY(
float opacity READ opacity WRITE setOpacity NOTIFY opacityChanged)
57 Q_PROPERTY(
float normalStrength READ normalStrength WRITE setNormalStrength NOTIFY normalStrengthChanged)
61 Q_PROPERTY(
float occlusionAmount READ occlusionAmount WRITE setOcclusionAmount NOTIFY occlusionAmountChanged)
64 Q_PROPERTY(
float alphaCutoff READ alphaCutoff WRITE setAlphaCutoff NOTIFY alphaCutoffChanged)
66 Q_PROPERTY(
float pointSize READ pointSize WRITE setPointSize NOTIFY pointSizeChanged)
71 Q_PROPERTY(
float heightAmount READ heightAmount WRITE setHeightAmount NOTIFY heightAmountChanged)
72 Q_PROPERTY(
int minHeightMapSamples READ minHeightMapSamples WRITE setMinHeightMapSamples NOTIFY minHeightMapSamplesChanged)
73 Q_PROPERTY(
int maxHeightMapSamples READ maxHeightMapSamples WRITE setMaxHeightMapSamples NOTIFY maxHeightMapSamplesChanged)
75 Q_PROPERTY(
float clearcoatAmount READ clearcoatAmount WRITE setClearcoatAmount NOTIFY clearcoatAmountChanged)
78 clearcoatChannelChanged)
79 Q_PROPERTY(
float clearcoatRoughnessAmount READ clearcoatRoughnessAmount WRITE setClearcoatRoughnessAmount NOTIFY
80 clearcoatRoughnessAmountChanged)
82 setClearcoatRoughnessChannel NOTIFY clearcoatRoughnessChannelChanged)
84 clearcoatRoughnessMapChanged)
86 clearcoatNormalMapChanged)
87 Q_PROPERTY(
float clearcoatNormalStrength READ clearcoatNormalStrength WRITE setClearcoatNormalStrength NOTIFY clearcoatNormalStrengthChanged REVISION(6, 8))
89 Q_PROPERTY(
float transmissionFactor READ transmissionFactor WRITE setTransmissionFactor NOTIFY transmissionFactorChanged)
93 Q_PROPERTY(
float thicknessFactor READ thicknessFactor WRITE setThicknessFactor NOTIFY thicknessFactorChanged)
96 thicknessChannelChanged)
97 Q_PROPERTY(
float attenuationDistance READ attenuationDistance WRITE setAttenuationDistance NOTIFY attenuationDistanceChanged)
98 Q_PROPERTY(
QColor attenuationColor READ attenuationColor WRITE setAttenuationColor NOTIFY attenuationColorChanged)
100 Q_PROPERTY(
bool vertexColorsEnabled READ vertexColorsEnabled WRITE setVertexColorsEnabled NOTIFY vertexColorsEnabledChanged REVISION(6, 5))
102 Q_PROPERTY(
bool fresnelScaleBiasEnabled READ fresnelScaleBiasEnabled WRITE setFresnelScaleBiasEnabled NOTIFY fresnelScaleBiasEnabledChanged REVISION(6, 8))
103 Q_PROPERTY(
float fresnelScale READ fresnelScale WRITE setFresnelScale NOTIFY fresnelScaleChanged REVISION(6, 8))
104 Q_PROPERTY(
float fresnelBias READ fresnelBias WRITE setFresnelBias NOTIFY fresnelBiasChanged REVISION(6, 8))
105 Q_PROPERTY(
float fresnelPower READ fresnelPower WRITE setFresnelPower NOTIFY fresnelPowerChanged REVISION(6, 8))
107 Q_PROPERTY(
bool clearcoatFresnelScaleBiasEnabled READ clearcoatFresnelScaleBiasEnabled WRITE setClearcoatFresnelScaleBiasEnabled NOTIFY clearcoatFresnelScaleBiasEnabledChanged REVISION(6, 8))
108 Q_PROPERTY(
float clearcoatFresnelScale READ clearcoatFresnelScale WRITE setClearcoatFresnelScale NOTIFY clearcoatFresnelScaleChanged REVISION(6, 8))
109 Q_PROPERTY(
float clearcoatFresnelBias READ clearcoatFresnelBias WRITE setClearcoatFresnelBias NOTIFY clearcoatFresnelBiasChanged REVISION(6, 8))
110 Q_PROPERTY(
float clearcoatFresnelPower READ clearcoatFresnelPower WRITE setClearcoatFresnelPower NOTIFY clearcoatFresnelPowerChanged REVISION(6, 8))
112 Q_PROPERTY(
bool vertexColorsMaskEnabled READ vertexColorsMaskEnabled WRITE setVertexColorsMaskEnabled NOTIFY vertexColorsMaskEnabledChanged REVISION(6, 8))
113 Q_PROPERTY(VertexColorMaskFlags vertexColorRedMask READ vertexColorRedMask WRITE setVertexColorRedMask NOTIFY vertexColorRedMaskChanged REVISION(6, 8))
114 Q_PROPERTY(VertexColorMaskFlags vertexColorGreenMask READ vertexColorGreenMask WRITE setVertexColorGreenMask NOTIFY vertexColorGreenMaskChanged REVISION(6, 8))
115 Q_PROPERTY(VertexColorMaskFlags vertexColorBlueMask READ vertexColorBlueMask WRITE setVertexColorBlueMask NOTIFY vertexColorBlueMaskChanged REVISION(6, 8))
116 Q_PROPERTY(VertexColorMaskFlags vertexColorAlphaMask READ vertexColorAlphaMask WRITE setVertexColorAlphaMask NOTIFY vertexColorAlphaMaskChanged REVISION(6, 8))
161 Lighting lighting()
const;
162 BlendMode blendMode()
const;
163 QColor albedoColor()
const;
165 bool albedoSingleChannelEnabled()
const;
166 TextureChannelMapping albedoChannel()
const;
167 bool specularSingleChannelEnabled()
const;
168 TextureChannelMapping specularChannel()
const;
169 bool emissiveSingleChannelEnabled()
const;
170 TextureChannelMapping emissiveChannel()
const;
173 float glossiness()
const;
175 bool invertOpacityMapValue()
const;
176 float opacity()
const;
179 QColor specularColor()
const;
181 float normalStrength()
const;
183 float occlusionAmount()
const;
184 AlphaMode alphaMode()
const;
185 float alphaCutoff()
const;
186 TextureChannelMapping glossinessChannel()
const;
187 TextureChannelMapping opacityChannel()
const;
188 TextureChannelMapping occlusionChannel()
const;
189 float pointSize()
const;
190 float lineWidth()
const;
192 TextureChannelMapping heightChannel()
const;
193 float heightAmount()
const;
194 int minHeightMapSamples()
const;
195 int maxHeightMapSamples()
const;
197 float clearcoatAmount()
const;
199 TextureChannelMapping clearcoatChannel()
const;
200 float clearcoatRoughnessAmount()
const;
201 TextureChannelMapping clearcoatRoughnessChannel()
const;
205 float transmissionFactor()
const;
207 TextureChannelMapping transmissionChannel()
const;
209 float thicknessFactor()
const;
211 TextureChannelMapping thicknessChannel()
const;
212 float attenuationDistance()
const;
213 QColor attenuationColor()
const;
220 Q_REVISION(6, 8)
bool clearcoatFresnelScaleBiasEnabled() const;
229 Q_REVISION(6, 8) VertexColorMaskFlags vertexColorRedMask() const;
230 Q_REVISION(6, 8) VertexColorMaskFlags vertexColorGreenMask() const;
231 Q_REVISION(6, 8) VertexColorMaskFlags vertexColorBlueMask() const;
232 Q_REVISION(6, 8) VertexColorMaskFlags vertexColorAlphaMask() const;
237 void setAlbedoColor(const
QColor &albedo);
239 void setAlbedoSingleChannelEnabled(
bool albedoSingleChannelEnabled);
241 void setSpecularSingleChannelEnabled(
bool specularSingleChannelEnabled);
243 void setEmissiveSingleChannelEnabled(
bool emissiveSingleChannelEnabled);
246 void setEmissiveFactor(const
QVector3D &emissiveFactor);
247 void setGlossiness(
float glossiness);
249 void setInvertOpacityMapValue(
bool invertOpacityMapValue);
250 void setOpacity(
float opacity);
253 void setSpecularColor(const
QColor &specular);
255 void setNormalStrength(
float normalStrength);
257 void setOcclusionAmount(
float occlusionAmount);
259 void setAlphaCutoff(
float alphaCutoff);
263 void setPointSize(
float size);
267 void setHeightAmount(
float heightAmount);
268 void setMinHeightMapSamples(
int samples);
269 void setMaxHeightMapSamples(
int samples);
271 void setClearcoatAmount(
float newClearcoatAmount);
274 void setClearcoatRoughnessAmount(
float newClearcoatRoughnessAmount);
276 void setClearcoatRoughnessMap(
QQuick3DTexture *newClearcoatRoughnessMap);
278 Q_REVISION(6, 8)
void setClearcoatNormalStrength(
float newClearcoatNormalStrength );
280 void setTransmissionFactor(
float newTransmissionFactor);
284 void setThicknessFactor(
float newThicknessFactor);
287 void setAttenuationDistance(
float newAttenuationDistance);
288 void setAttenuationColor(const
QColor &newAttenuationColor);
290 Q_REVISION(6, 8)
void setFresnelScaleBiasEnabled(
bool fresnelScaleBias);
295 Q_REVISION(6, 8)
void setClearcoatFresnelScaleBiasEnabled(
bool clearcoatFresnelScaleBias);
296 Q_REVISION(6, 8)
void setClearcoatFresnelScale(
float clearcoatFresnelScale);
297 Q_REVISION(6, 8)
void setClearcoatFresnelBias(
float clearcoatFresnelBias);
298 Q_REVISION(6, 8)
void setClearcoatFresnelPower(
float clearcoatFresnelPower);
300 Q_REVISION(6, 5)
void setVertexColorsEnabled(
bool vertexColorsEnabled);
302 Q_REVISION(6, 8)
void setVertexColorsMaskEnabled(
bool vertexColorsMaskEnabled);
303 Q_REVISION(6, 8)
void setVertexColorRedMask(VertexColorMaskFlags vertexColorRedMask);
304 Q_REVISION(6, 8)
void setVertexColorGreenMask(VertexColorMaskFlags vertexColorGreenMask);
305 Q_REVISION(6, 8)
void setVertexColorBlueMask(VertexColorMaskFlags vertexColorBlueMask);
306 Q_REVISION(6, 8)
void setVertexColorAlphaMask(VertexColorMaskFlags vertexColorAlphaMask);
309 void lightingChanged();
310 void blendModeChanged();
311 void albedoColorChanged();
312 void albedoMapChanged();
313 void albedoSingleChannelEnabledChanged();
314 void albedoChannelChanged();
315 void specularSingleChannelEnabledChanged();
316 void specularChannelChanged();
317 void emissiveSingleChannelEnabledChanged();
318 void emissiveChannelChanged();
319 void emissiveMapChanged();
320 void emissiveFactorChanged();
321 void glossinessChanged();
322 void glossinessMapChanged();
323 void invertOpacityMapValueChanged();
324 void opacityChanged();
325 void opacityMapChanged();
326 void normalMapChanged();
327 void specularColorChanged();
328 void specularMapChanged();
329 void normalStrengthChanged();
330 void occlusionMapChanged();
331 void occlusionAmountChanged();
332 void alphaModeChanged();
333 void alphaCutoffChanged();
334 void glossinessChannelChanged();
335 void opacityChannelChanged();
336 void occlusionChannelChanged();
337 void pointSizeChanged();
338 void lineWidthChanged();
339 void heightMapChanged();
340 void heightChannelChanged();
341 void heightAmountChanged();
342 void minHeightMapSamplesChanged();
343 void maxHeightMapSamplesChanged();
345 void clearcoatAmountChanged();
346 void clearcoatMapChanged();
347 void clearcoatChannelChanged();
348 void clearcoatRoughnessAmountChanged();
349 void clearcoatRoughnessChannelChanged();
350 void clearcoatRoughnessMapChanged();
351 void clearcoatNormalMapChanged();
352 void clearcoatNormalStrengthChanged();
354 void transmissionFactorChanged();
355 void transmissionMapChanged();
356 void transmissionChannelChanged();
358 void thicknessFactorChanged();
359 void thicknessMapChanged();
360 void thicknessChannelChanged();
361 void attenuationDistanceChanged();
362 void attenuationColorChanged();
364 Q_REVISION(6, 5)
void vertexColorsEnabledChanged(
bool vertexColorsEnabled);
366 Q_REVISION(6, 8)
void fresnelScaleBiasEnabledChanged(
bool fresnelScaleBiasEnabled);
367 Q_REVISION(6, 8)
void fresnelScaleChanged(
float fresnelScale);
369 Q_REVISION(6, 8)
void fresnelPowerChanged(
float fresnelPower);
371 Q_REVISION(6, 8)
void clearcoatFresnelScaleBiasEnabledChanged(
bool clearcoatFresnelScaleBiasEnabled);
372 Q_REVISION(6, 8)
void clearcoatFresnelScaleChanged(
float clearcoatFresnelScale);
373 Q_REVISION(6, 8)
void clearcoatFresnelBiasChanged(
float clearcoatFresnelBias);
374 Q_REVISION(6, 8)
void clearcoatFresnelPowerChanged(
float clearcoatFresnelPower);
384 void markAllDirty() override;
385 void itemChange(ItemChange, const ItemChangeData &) override;
389 LightingModeDirty = 0x00000001,
390 BlendModeDirty = 0x00000002,
391 AlbedoDirty = 0x00000004,
392 EmissiveDirty = 0x00000008,
393 SpecularDirty = 0x00000010,
394 OpacityDirty = 0x00000020,
395 NormalDirty = 0x00000040,
396 GlossyDirty = 0x00000080,
397 OcclusionDirty = 0x00000100,
398 AlphaModeDirty = 0x00000200,
399 PointSizeDirty = 0x00000400,
400 LineWidthDirty = 0x00000800,
401 HeightDirty = 0x00001000,
402 ClearcoatDirty = 0x00002000,
403 TransmissionDirty = 0x00004000,
404 VolumeDirty = 0x00008000,
405 VertexColorsDirty = 0x00001000
410 Lighting m_lighting = FragmentLighting;
411 BlendMode m_blendMode = SourceOver;
412 AlphaMode m_alphaMode =
Default;
415 bool m_albedoSingleChannelEnabled =
false;
417 bool m_specularSingleChannelEnabled =
false;
419 bool m_emissiveSingleChannelEnabled =
false;
428 float m_glossiness = 1.0f;
429 bool m_invertOpacityMapValue =
false;
430 float m_opacity = 1.0f;
432 float m_normalStrength = 1.0f;
433 float m_occlusionAmount = 1.0f;
434 float m_alphaCutoff = 0.5f;
438 float m_pointSize = 1.0f;
439 float m_lineWidth = 1.0f;
442 float m_heightAmount = 0.0f;
443 int m_minHeightMapSamples = 8;
444 int m_maxHeightMapSamples = 32;
445 float m_clearcoatAmount = 0.0f;
448 float m_clearcoatRoughnessAmount = 0.0f;
452 float m_clearcoatNormalStrength = 1.0f;
453 float m_transmissionFactor = 0.0f;
456 float m_thicknessFactor = 0.0f;
459 float m_attenuationDistance = std::numeric_limits<float>::infinity();
461 bool m_fresnelScaleBiasEnabled =
false;
462 float m_fresnelScale = 1.0f;
463 float m_fresnelBias = 0.0f;
464 float m_fresnelPower = 5.0f;
465 bool m_clearcoatFresnelScaleBiasEnabled =
false;
466 float m_clearcoatFresnelScale = 1.0f;
467 float m_clearcoatFresnelBias = 0.0f;
468 float m_clearcoatFresnelPower = 5.0f;
469 bool m_vertexColorsEnabled =
true;
470 bool m_vertexColorsMaskEnabled =
false;
471 VertexColorMaskFlags m_vertexColorRedMask = NoMask;
472 VertexColorMaskFlags m_vertexColorGreenMask = NoMask;
473 VertexColorMaskFlags m_vertexColorBlueMask = NoMask;
474 VertexColorMaskFlags m_vertexColorAlphaMask = NoMask;
476 quint32 m_dirtyAttributes = 0xffffffff;
477 void markDirty(DirtyType
type);
479 static constexpr float ensureNormalized(
float val) {
return qBound(0.0f,
val, 1.0f); }