29 enum class DirtyFlag : quint8
33 using FlagT = std::underlying_type_t<DirtyFlag>;
36 enum class SoftShadowQuality {
45 static constexpr DirtyFlag DirtyMask { std::numeric_limits<FlagT>::max() };
47 QSSGRenderNode *m_scope;
48 QVector3D m_diffuseColor;
49 QVector3D m_specularColor;
50 QVector3D m_ambientColor;
57 float m_quadraticFade;
60 float m_innerConeAngle;
62 FlagT m_lightDirtyFlags = 0;
66 quint32 m_shadowMapRes;
69 SoftShadowQuality m_softShadowQuality = SoftShadowQuality::PCF4;
71 float m_pcfFactor = 2.0f;
72 bool m_use32BitShadowmap =
false;
74 bool m_bakingEnabled =
false;
75 bool m_fullyBaked =
false;
78 float m_csmSplit1 = 0.1f;
79 float m_csmSplit2 = 0.25f;
80 float m_csmSplit3 = 0.5f;
81 int m_csmNumSplits = 0;
82 float m_csmBlendRatio = 0.05f;
83 bool m_lockShadowmapTexels =
false;
86 explicit QSSGRenderLight(Type type = Type::DirectionalLight);
88 [[nodiscard]]
inline bool isEnabled()
const {
return (m_brightness > 0.0f); }
90 [[nodiscard]]
inline bool isDirty(DirtyFlag dirtyFlag = DirtyMask)
const
92 return ((m_lightDirtyFlags & FlagT(dirtyFlag)) != 0)
93 || ((dirtyFlag == DirtyMask) && QSSGRenderNode::isDirty());
95 void markDirty(DirtyFlag dirtyFlag);
96 void clearDirty(DirtyFlag dirtyFlag);