Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquick3dmaterial_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QSSGMATERIAL_H
5#define QSSGMATERIAL_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick3D/qquick3dobject.h>
19#include <QtQuick3D/private/qquick3dtexture_p.h>
20
21#include <QtCore/QVector>
22
24
26class Q_QUICK3D_EXPORT QQuick3DMaterial : public QQuick3DObject
27{
29 Q_PROPERTY(QQuick3DTexture *lightProbe READ lightProbe WRITE setLightProbe NOTIFY lightProbeChanged)
30 Q_PROPERTY(CullMode cullMode READ cullMode WRITE setCullMode NOTIFY cullModeChanged)
31 Q_PROPERTY(DepthDrawMode depthDrawMode READ depthDrawMode WRITE setDepthDrawMode NOTIFY depthDrawModeChanged)
32
33 QML_NAMED_ELEMENT(Material)
34 QML_UNCREATABLE("Material is Abstract")
35
36public:
37 enum CullMode {
38 BackFaceCulling = 1,
39 FrontFaceCulling = 2,
40 NoCulling = 3
41 };
42 Q_ENUM(CullMode)
43
45 R = 0,
49 };
50 Q_ENUM(TextureChannelMapping)
51
58 Q_ENUM(DepthDrawMode)
59
61 NoMask = 0,
62 RoughnessMask = 1,
63 NormalStrengthMask = 2,
64 SpecularAmountMask = 4,
65 ClearcoatAmountMask = 8,
66 ClearcoatRoughnessAmountMask = 16,
67 ClearcoatNormalStrengthMask = 32,
68 HeightAmountMask = 64,
69 MetalnessMask = 128,
70 OcclusionAmountMask = 256,
71 ThicknessFactorMask = 512,
72 TransmissionFactorMask = 1024
73 };
74 Q_ENUM(VertexColorMask)
75 Q_DECLARE_FLAGS(VertexColorMaskFlags, VertexColorMask)
76
77 ~QQuick3DMaterial() override;
78
79 QQuick3DTexture *lightProbe() const;
80
81 CullMode cullMode() const;
82
83 DepthDrawMode depthDrawMode() const;
84
85public Q_SLOTS:
86 void setLightProbe(QQuick3DTexture *lightProbe);
87 void setCullMode(QQuick3DMaterial::CullMode cullMode);
88 void setDepthDrawMode(QQuick3DMaterial::DepthDrawMode depthDrawMode);
89
94
95protected:
96 explicit QQuick3DMaterial(QQuick3DObjectPrivate &dd, QQuick3DObject *parent = nullptr);
97 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
98 void itemChange(ItemChange, const ItemChangeData &) override;
99
100private:
101 void updateSceneManager(QQuick3DSceneManager *sceneManager);
102 QQuick3DTexture *m_iblProbe = nullptr;
103
104 CullMode m_cullMode = CullMode::BackFaceCulling;
105 DepthDrawMode m_depthDrawMode = DepthDrawMode::OpaqueOnlyDepthDraw;
106};
107
109
110#endif // QSSGMATERIAL_H
void cullModeChanged(QQuick3DMaterial::CullMode cullMode)
void depthDrawModeChanged(QQuick3DMaterial::DepthDrawMode depthDrawMode)
void lightProbeChanged(QQuick3DTexture *lightProbe)
\qmltype Object3D \inqmlmodule QtQuick3D \instantiates QQuick3DObject \inherits QtObject
Combined button and popup list for selecting options.
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define QML_UNCREATABLE(REASON)
#define QML_NAMED_ELEMENT(NAME)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS