1// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QT3DEXTRAS_QMETALROUGHMATERIAL_H
5#define QT3DEXTRAS_QMETALROUGHMATERIAL_H
6
7#include <Qt3DExtras/qt3dextras_global.h>
8#include <Qt3DRender/qmaterial.h>
9#include <QtGui/qcolor.h>
10
11QT_BEGIN_NAMESPACE
12
13namespace Qt3DRender {
14class QAbstractTexture;
15}
16
17namespace Qt3DExtras {
18
19class QMetalRoughMaterialPrivate;
20
21class Q_3DEXTRASSHARED_EXPORT QMetalRoughMaterial : public Qt3DRender::QMaterial
22{
23 Q_OBJECT
24 Q_PROPERTY(QVariant baseColor READ baseColor WRITE setBaseColor NOTIFY baseColorChanged)
25 Q_PROPERTY(QVariant metalness READ metalness WRITE setMetalness NOTIFY metalnessChanged)
26 Q_PROPERTY(QVariant roughness READ roughness WRITE setRoughness NOTIFY roughnessChanged)
27 Q_PROPERTY(QVariant ambientOcclusion READ ambientOcclusion WRITE setAmbientOcclusion NOTIFY ambientOcclusionChanged REVISION 10)
28 Q_PROPERTY(QVariant normal READ normal WRITE setNormal NOTIFY normalChanged REVISION 10)
29 Q_PROPERTY(float textureScale READ textureScale WRITE setTextureScale NOTIFY textureScaleChanged REVISION 10)
30
31public:
32 explicit QMetalRoughMaterial(Qt3DCore::QNode *parent = nullptr);
33 ~QMetalRoughMaterial();
34
35 QVariant baseColor() const;
36 QVariant metalness() const;
37 QVariant roughness() const;
38 QVariant ambientOcclusion() const;
39 QVariant normal() const;
40 float textureScale() const;
41
42public Q_SLOTS:
43 void setBaseColor(const QVariant &baseColor);
44 void setMetalness(const QVariant &metalness);
45 void setRoughness(const QVariant &roughness);
46 void setAmbientOcclusion(const QVariant &ambientOcclusion);
47 void setNormal(const QVariant &normal);
48 void setTextureScale(float textureScale);
49
50Q_SIGNALS:
51 void baseColorChanged(const QVariant &baseColor);
52 void metalnessChanged(const QVariant &metalness);
53 void roughnessChanged(const QVariant &roughness);
54 void ambientOcclusionChanged(const QVariant &ambientOcclusion);
55 void normalChanged(const QVariant &normal);
56 void textureScaleChanged(float textureScale);
57
58protected:
59 explicit QMetalRoughMaterial(QMetalRoughMaterialPrivate &dd, Qt3DCore::QNode *parent = nullptr);
60
61private:
62 Q_DECLARE_PRIVATE(QMetalRoughMaterial)
63};
64
65} // namespace Qt3DExtras
66
67QT_END_NAMESPACE
68
69#endif // QT3DEXTRAS_QMETALROUGHMATERIAL_H
70

source code of qt3d/src/extras/defaults/qmetalroughmaterial.h