27 enum class DirtyFlag : quint8
31 using FlagT = std::underlying_type_t<DirtyFlag>;
34 enum class SoftShadowQuality {
43 static constexpr DirtyFlag DirtyMask { std::numeric_limits<FlagT>::max() };
45 QSSGRenderNode *m_scope;
46 QVector3D m_diffuseColor;
47 QVector3D m_specularColor;
48 QVector3D m_ambientColor;
55 float m_quadraticFade;
58 float m_innerConeAngle;
60 FlagT m_lightDirtyFlags = 0;
64 quint32 m_shadowMapRes;
67 SoftShadowQuality m_softShadowQuality = SoftShadowQuality::PCF4;
69 float m_pcfFactor = 2.0f;
70 bool m_use32BitShadowmap =
false;
72 bool m_bakingEnabled =
false;
73 bool m_fullyBaked =
false;
76 float m_csmSplit1 = 0.1f;
77 float m_csmSplit2 = 0.25f;
78 float m_csmSplit3 = 0.5f;
79 int m_csmNumSplits = 0;
80 float m_csmBlendRatio = 0.05f;
81 bool m_lockShadowmapTexels =
false;
84 explicit QSSGRenderLight(Type type = Type::DirectionalLight);
86 [[nodiscard]]
inline bool isEnabled()
const {
return (m_brightness > 0.0f); }
88 [[nodiscard]]
inline bool isDirty(DirtyFlag dirtyFlag = DirtyMask)
const
90 return ((m_lightDirtyFlags & FlagT(dirtyFlag)) != 0)
91 || ((dirtyFlag == DirtyMask) && QSSGRenderNode::isDirty());
93 void markDirty(DirtyFlag dirtyFlag);
94 void clearDirty(DirtyFlag dirtyFlag);