QGIS API Documentation 4.1.0-Master (ca2ac17535b)
Loading...
Searching...
No Matches
qgsenvironmentlight.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsenvironmentlight.h
3 --------------------------------------
4 Date : May 2026
5 Copyright : (C) 2026 by Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSENVIRONMENTLIGHT_H
17#define QGSENVIRONMENTLIGHT_H
18
19#include "qgis.h"
20#include "qgis_3d.h"
21
22#include <QMap>
23#include <QString>
24#include <QVector>
25#include <Qt3DCore/QEntity>
26
27#define SIP_NO_FILE
28
29namespace Qt3DRender
30{
31 class QParameter;
32 class QTextureCubeMap;
33 class QTexture2D;
34} //namespace Qt3DRender
35
36class QgsImageTexture;
37class QgsFrameGraph;
38
45class _3D_EXPORT QgsEnvironmentLight : public Qt3DCore::QEntity
46{
47 Q_OBJECT
48
49 public:
51 enum class Mode
52 {
53 Disabled,
54 SpecularMapWithSphericalHarmonics,
55 };
56
58 QgsEnvironmentLight( QgsFrameGraph *frameGraph, QNode *parent = nullptr );
59
63 void setMode( Mode mode );
64
68 void setStrength( float strength );
69
73 void setSphericalHarmonics( const QVector<QVector3D> &harmonics );
74
78 void setSpecularMap( Qt3DRender::QTextureCubeMap *specularTexture, int mipLevels );
79
80 private:
81 Qt3DRender::QParameter *mEnvironmentLightModeParam = nullptr; // whether environmental lighting is enabled
82 Qt3DRender::QParameter *mEnvironmentLightStrengthParam = nullptr; // strength of environmental lighting effect
83 Qt3DRender::QParameter *mShParam = nullptr;
84 Qt3DRender::QParameter *mSpecularMapParam = nullptr;
85 Qt3DRender::QParameter *mMipLevelsParam = nullptr;
86 Qt3DRender::QTextureCubeMap *mDummyCubeMap = nullptr;
87};
88
89
90#endif // QGSENVIRONMENTLIGHT_H
An environment light entity.
QgsEnvironmentLight(QgsFrameGraph *frameGraph, QNode *parent=nullptr)
Constructor.
Mode
Environmental lighting modes.
Container class that holds different objects related to frame graphs of 3D scenes.
Holds an image that can be used as a texture in the 3D view.