1// Copyright (C) 2020 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 QT3DRENDER_RENDER_OPENGL_GLLIGHTS_P_H
5#define QT3DRENDER_RENDER_OPENGL_GLLIGHTS_P_H
6
7#include <QString>
8
9QT_BEGIN_NAMESPACE
10
11namespace Qt3DRender {
12namespace Render {
13namespace OpenGL {
14
15#define MAX_LIGHTS 8
16
17static_assert (MAX_LIGHTS < 10, "GL_Lights can't use the QChar trick anymore");
18
19struct GLLights
20{
21 static int LIGHT_COUNT_NAME_ID;
22
23 static QString LIGHT_STRUCT_NAMES[MAX_LIGHTS];
24 static int LIGHT_POSITION_NAMES[MAX_LIGHTS];
25 static int LIGHT_TYPE_NAMES[MAX_LIGHTS];
26 static int LIGHT_COLOR_NAMES[MAX_LIGHTS];
27 static int LIGHT_INTENSITY_NAMES[MAX_LIGHTS];
28 static int LIGHT_DIRECTION_NAMES[MAX_LIGHTS];
29 static int LIGHT_LINEAR_ATTENUATION_NAMES[MAX_LIGHTS];
30 static int LIGHT_QUADRATIC_ATTENUATION_NAMES[MAX_LIGHTS];
31 static int LIGHT_CONSTANT_ATTENUATION_NAMES[MAX_LIGHTS];
32 static int LIGHT_CUT_OFF_ANGLE_NAMES[MAX_LIGHTS];
33
34 static QString LIGHT_STRUCT_UNROLL_NAMES[MAX_LIGHTS];
35 static int LIGHT_POSITION_UNROLL_NAMES[MAX_LIGHTS];
36 static int LIGHT_TYPE_UNROLL_NAMES[MAX_LIGHTS];
37 static int LIGHT_COLOR_UNROLL_NAMES[MAX_LIGHTS];
38 static int LIGHT_INTENSITY_UNROLL_NAMES[MAX_LIGHTS];
39 static int LIGHT_DIRECTION_UNROLL_NAMES[MAX_LIGHTS];
40 static int LIGHT_LINEAR_ATTENUATION_UNROLL_NAMES[MAX_LIGHTS];
41 static int LIGHT_QUADRATIC_ATTENUATION_UNROLL_NAMES[MAX_LIGHTS];
42 static int LIGHT_CONSTANT_ATTENUATION_UNROLL_NAMES[MAX_LIGHTS];
43 static int LIGHT_CUT_OFF_ANGLE_UNROLL_NAMES[MAX_LIGHTS];
44};
45
46} // namespace OpenGL
47} // namespace Render
48} // namespace Qt3DRender
49
50QT_END_NAMESPACE
51
52#endif // QT3DRENDER_RENDER_OPENGL_GLLIGHTS_P_H
53

source code of qt3d/src/plugins/renderers/opengl/renderer/gllights_p.h