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
qssgrenderlight_p.h
Go to the documentation of this file.
1// Copyright (C) 2008-2012 NVIDIA Corporation.
2// Copyright (C) 2019 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
5#ifndef QSSG_RENDER_LIGHT_H
6#define QSSG_RENDER_LIGHT_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuick3DRuntimeRender/private/qssgrendernode_p.h>
20
22
23struct QSSGRenderImage;
24
25struct Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderLight : public QSSGRenderNode
26{
27 enum class DirtyFlag : quint8
28 {
29 LightDirty = 0x1
30 };
31 using FlagT = std::underlying_type_t<DirtyFlag>;
32
33 static constexpr DirtyFlag DirtyMask { std::numeric_limits<FlagT>::max() };
34
36 QVector3D m_diffuseColor; // colors are 0-1 normalized
37 QVector3D m_specularColor; // colors are 0-1 normalized
38 QVector3D m_ambientColor; // colors are 0-1 normalized
39
40 // The variables below are in the same range as Studio
41 // Only valid if node is a point light
46
47 float m_coneAngle; // 0-180
48 float m_innerConeAngle; // 0-180
49
50 FlagT m_lightDirtyFlags = 0;
51 bool m_castShadow; // true if this light produce shadows
52 float m_shadowBias; // depth shift to avoid self-shadowing artifacts
53 float m_shadowFactor; // Darkening factor for ESMs
54 quint32 m_shadowMapRes; // Resolution of shadow map
55 float m_shadowMapFar; // Far clip plane for the shadow map
56 float m_shadowFilter; // Shadow map filter step size
57
59 bool m_fullyBaked; // direct+indirect
60
61 // Defaults to directional light
62 explicit QSSGRenderLight(Type type = Type::DirectionalLight);
63
64 [[nodiscard]] inline bool isEnabled() const { return (m_brightness > 0.0f); }
65
66 [[nodiscard]] inline bool isDirty(DirtyFlag dirtyFlag = DirtyMask) const
67 {
68 return ((m_lightDirtyFlags & FlagT(dirtyFlag)) != 0)
69 || ((dirtyFlag == DirtyMask) && QSSGRenderNode::isDirty());
70 }
71 void markDirty(DirtyFlag dirtyFlag);
72 void clearDirty(DirtyFlag dirtyFlag);
73};
75
76#endif
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
Combined button and popup list for selecting options.
GLenum type
unsigned int quint32
Definition qtypes.h:50
unsigned char quint8
Definition qtypes.h:46
QVector3D m_specularColor
bool isDirty(DirtyFlag dirtyFlag=DirtyMask) const
bool isEnabled() const
QSSGRenderNode * m_scope
std::underlying_type_t< DirtyFlag > FlagT
constexpr bool isDirty(DirtyFlag dirtyFlag=DirtyFlag::DirtyMask) const
Definition moc.h:23