1 /****************************************************************************
2 **
3 ** Copyright (C) 2008-2012 NVIDIA Corporation.
4 ** Copyright (C) 2019 The Qt Company Ltd.
5 ** Contact: https://www.qt.io/licensing/
6 **
7 ** This file is part of Qt Quick 3D.
8 **
9 ** $QT_BEGIN_LICENSE:GPL$
10 ** Commercial License Usage
11 ** Licensees holding valid commercial Qt licenses may use this file in
12 ** accordance with the commercial license agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and The Qt Company. For licensing terms
15 ** and conditions see https://www.qt.io/terms-conditions. For further
16 ** information use the contact form at https://www.qt.io/contact-us.
17 **
18 ** GNU General Public License Usage
19 ** Alternatively, this file may be used under the terms of the GNU
20 ** General Public License version 3 or (at your option) any later version
21 ** approved by the KDE Free Qt Foundation. The licenses are as published by
22 ** the Free Software Foundation and appearing in the file LICENSE.GPL3
23 ** included in the packaging of this file. Please review the following
24 ** information to ensure the GNU General Public License requirements will
25 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
26 **
27 ** $QT_END_LICENSE$
28 **
29 ****************************************************************************/
30 
31 #ifndef QSSG_RENDERABLE_IMAGE_H
32 #define QSSG_RENDERABLE_IMAGE_H
33 
34 //
35 //  W A R N I N G
36 //  -------------
37 //
38 // This file is not part of the Qt API.  It exists purely as an
39 // implementation detail.  This header file may change from version to
40 // version without notice, or even be removed.
41 //
42 // We mean it.
43 //
44 
45 #include <QtQuick3DRuntimeRender/private/qtquick3druntimerenderglobal_p.h>
46 #include <QtQuick3DRuntimeRender/private/qssgrenderimage_p.h>
47 
48 QT_BEGIN_NAMESPACE
49 
50 enum class QSSGImageMapTypes
51 {
52     Unknown = 0,
53     Diffuse = 1,
54     Opacity = 2,
55     Specular = 3,
56     Emissive = 4,
57     Bump = 5,
58     SpecularAmountMap = 6,
59     Normal = 7,
60     Displacement = 8,
61     Translucency = 9,
62     LightmapIndirect = 10,
63     LightmapRadiosity = 11,
64     LightmapShadow = 12,
65     Roughness = 13,
66     BaseColor = 14,
67     Metalness = 15,
68     Occlusion = 16
69 };
70 
qHash(QSSGImageMapTypes t,uint)71 inline uint qHash(QSSGImageMapTypes t, uint) { return qHash(static_cast<uint>(t)); }
72 /**
73  *	Some precomputed information on a given image.  When generating a renderable, the shader
74  *	generator goes through all the possible images on a material and for each valid image
75  *	computes this renderable image and attaches it to the renderable.
76  */
77 struct QSSGRenderableImage
78 {
79     QSSGImageMapTypes m_mapType;
80     QSSGRenderImage &m_image;
81     QSSGRenderableImage *m_nextImage;
QSSGRenderableImageQSSGRenderableImage82     QSSGRenderableImage(QSSGImageMapTypes inMapType, QSSGRenderImage &inImage)
83         : m_mapType(inMapType), m_image(inImage), m_nextImage(nullptr)
84     {
85     }
86 };
87 QT_END_NAMESPACE
88 #endif
89