Qt 6.x
The Qt SDK
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
53 OpaqueOnlyDepthDraw = 0,
57 };
58 Q_ENUM(DepthDrawMode)
59
60 ~QQuick3DMaterial() override;
61
62 QQuick3DTexture *lightProbe() const;
63
64 CullMode cullMode() const;
65
66 DepthDrawMode depthDrawMode() const;
67
68public Q_SLOTS:
69 void setLightProbe(QQuick3DTexture *lightProbe);
70 void setCullMode(QQuick3DMaterial::CullMode cullMode);
71 void setDepthDrawMode(QQuick3DMaterial::DepthDrawMode depthDrawMode);
72
77
78protected:
81 void itemChange(ItemChange, const ItemChangeData &) override;
82
83private:
84 void updateSceneManager(QQuick3DSceneManager *sceneManager);
85 QQuick3DTexture *m_iblProbe = nullptr;
86
87 CullMode m_cullMode = CullMode::BackFaceCulling;
88 DepthDrawMode m_depthDrawMode = DepthDrawMode::OpaqueOnlyDepthDraw;
89};
90
92
93#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
virtual QSSGRenderGraphObject * updateSpatialNode(QSSGRenderGraphObject *node)
virtual void itemChange(ItemChange, const ItemChangeData &)
Combined button and popup list for selecting options.
#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
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent